diff --git a/backend/src/plugins/Automod/Automod.ts b/backend/src/plugins/Automod/Automod.ts index e4aa1344..780dab9f 100644 --- a/backend/src/plugins/Automod/Automod.ts +++ b/backend/src/plugins/Automod/Automod.ts @@ -125,12 +125,6 @@ const defaultMatchAttachmentTypeTrigger: Partial = blacklist_enabled: false, filetype_whitelist: [], whitelist_enabled: false, - match_messages: true, - match_embeds: true, - match_visible_names: false, - match_usernames: false, - match_nicknames: false, - match_custom_status: false, }; const defaultTextSpamTrigger: Partial> = { @@ -541,17 +535,26 @@ export class AutomodPlugin extends ZeppelinPlugin { - return this.evaluateMatchAttachmentTypeTrigger(trigger.match_attachment_type, msg); - }); - if (match) return { ...match, trigger: "match_attachment_type" } as TextTriggerMatchResult; + const match = this.evaluateMatchAttachmentTypeTrigger(trigger.match_attachment_type, msg); + // TODO: Add "attachment" type + if (match) { + const messageInfo: MessageInfo = { channelId: msg.channel_id, messageId: msg.id, userId: msg.user_id }; + return { + type: "message", + userId: msg.user_id, + messageInfo, + ...match, + trigger: "match_attachment_type", + }; + } } if (trigger.message_spam) { diff --git a/backend/src/plugins/Automod/types.ts b/backend/src/plugins/Automod/types.ts index 153d94ee..dbda6dad 100644 --- a/backend/src/plugins/Automod/types.ts +++ b/backend/src/plugins/Automod/types.ts @@ -189,12 +189,6 @@ export const MatchAttachmentTypeTrigger = t.type({ blacklist_enabled: t.boolean, filetype_whitelist: t.array(t.string), whitelist_enabled: t.boolean, - match_messages: t.boolean, - match_embeds: t.boolean, - match_visible_names: t.boolean, - match_usernames: t.boolean, - match_nicknames: t.boolean, - match_custom_status: t.boolean, }); export type TMatchAttachmentTypeTrigger = t.TypeOf;