3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-05-23 09:35:02 +00:00

Update backend/src/plugins/Automod/actions/setSlowmode.ts

Co-authored-by: Almeida <almeidx@pm.me>
This commit is contained in:
metal 2021-09-06 17:33:38 +01:00 committed by GitHub
parent 53b82b6214
commit 6966818d66
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -17,7 +17,7 @@ export const SetSlowmodeAction = automodAction({
async apply({ pluginData, actionConfig, contexts }) {
const slowmodeMs = Math.max(actionConfig.duration ? convertDelayStringToMS(actionConfig.duration)! : 0, 0);
const channels: string[] = actionConfig.channels ?? [];
const channels: Snowflake[] = actionConfig.channels ?? [];
if (channels.length === 0) {
channels.push(...contexts.filter(c => c.message?.channel_id).map(c => c.message!.channel_id));
}