3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-03-15 05:41:51 +00:00

Allow Automod to act on application command replies

This commit is contained in:
Dragory 2021-08-21 00:38:19 +03:00
parent ce8618957f
commit 57705656f9
No known key found for this signature in database
GPG key ID: 5F387BA66DF8AAC1

View file

@ -1,4 +1,4 @@
import { Message, Snowflake } from "discord.js";
import { Constants, Message, MessageType, Snowflake } from "discord.js";
import { messageSaverEvt } from "../types";
import { SECONDS } from "../../../utils";
@ -12,14 +12,15 @@ setInterval(() => {
}
}, 60 * SECONDS);
const AFFECTED_MESSAGE_TYPES: MessageType[] = ["DEFAULT", "REPLY", "APPLICATION_COMMAND"];
export const MessageCreateEvt = messageSaverEvt({
event: "messageCreate",
allowBots: true,
allowSelf: true,
async listener(meta) {
// Only save regular chat messages
if (meta.args.message.type !== "DEFAULT" && meta.args.message.type !== "REPLY") {
if (!AFFECTED_MESSAGE_TYPES.includes(meta.args.message.type)) {
return;
}