diff --git a/backend/src/plugins/Automod/triggers/joinVoiceChannel.ts b/backend/src/plugins/Automod/triggers/joinVoiceChannel.ts index 6e310510..e2093fa9 100644 --- a/backend/src/plugins/Automod/triggers/joinVoiceChannel.ts +++ b/backend/src/plugins/Automod/triggers/joinVoiceChannel.ts @@ -1,5 +1,6 @@ import * as t from "io-ts"; import { ChannelTypeStrings } from "../../../types"; +import { tNullable } from "../../../utils"; import { automodTrigger } from "../helpers"; interface JoinVoiceChannelResult { @@ -8,8 +9,7 @@ interface JoinVoiceChannelResult { export const JoinVoiceChannelTrigger = automodTrigger()({ configType: t.type({ - channels: t.union([t.string, t.array(t.string)]), - include_moves: t.boolean, + include_moves: tNullable(t.boolean), }), defaultConfig: { @@ -25,11 +25,6 @@ export const JoinVoiceChannelTrigger = automodTrigger()( return; } - const triggerChannels = Array.isArray(triggerConfig.channels) ? triggerConfig.channels : [triggerConfig.channels]; - if (!triggerChannels.includes(matchedChannelId)) { - return; - } - return { extra: { matchedChannelId, diff --git a/backend/src/plugins/Automod/triggers/leaveVoiceChannel.ts b/backend/src/plugins/Automod/triggers/leaveVoiceChannel.ts index 309240ca..cde57d7c 100644 --- a/backend/src/plugins/Automod/triggers/leaveVoiceChannel.ts +++ b/backend/src/plugins/Automod/triggers/leaveVoiceChannel.ts @@ -1,5 +1,6 @@ import * as t from "io-ts"; import { ChannelTypeStrings } from "../../../types"; +import { tNullable } from "../../../utils"; import { automodTrigger } from "../helpers"; interface LeaveVoiceChannelResult { @@ -8,8 +9,7 @@ interface LeaveVoiceChannelResult { export const LeaveVoiceChannelTrigger = automodTrigger()({ configType: t.type({ - channels: t.union([t.string, t.array(t.string)]), - include_moves: t.boolean, + include_moves: tNullable(t.boolean), }), defaultConfig: { @@ -25,11 +25,6 @@ export const LeaveVoiceChannelTrigger = automodTrigger( return; } - const triggerChannels = Array.isArray(triggerConfig.channels) ? triggerConfig.channels : [triggerConfig.channels]; - if (!triggerChannels.includes(matchedChannelId)) { - return; - } - return { extra: { matchedChannelId,