3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-03-16 22:21:51 +00:00

Add allowed_mentions option to Automod alert action

This commit is contained in:
Dragory 2021-04-29 00:50:25 +03:00
parent f2cf46e734
commit eb9cd080fd
No known key found for this signature in database
GPG key ID: 5F387BA66DF8AAC1

View file

@ -8,6 +8,8 @@ import {
messageLink, messageLink,
resolveMember, resolveMember,
stripObjectToScalars, stripObjectToScalars,
tAllowedMentions,
tNormalizedNullOptional,
tNullable, tNullable,
verboseChannelMention, verboseChannelMention,
} from "../../../utils"; } from "../../../utils";
@ -21,6 +23,7 @@ export const AlertAction = automodAction({
configType: t.type({ configType: t.type({
channel: t.string, channel: t.string,
text: t.string, text: t.string,
allowed_mentions: tNormalizedNullOptional(tAllowedMentions),
}), }),
defaultConfig: {}, defaultConfig: {},
@ -70,7 +73,7 @@ export const AlertAction = automodAction({
} }
try { try {
await createChunkedMessage(channel, rendered); await createChunkedMessage(channel, rendered, actionConfig.allowed_mentions);
} catch (err) { } catch (err) {
if (err.code === 50001) { if (err.code === 50001) {
logs.log(LogType.BOT_ALERT, { logs.log(LogType.BOT_ALERT, {