From b541d5d087f7e7602db5ff8a2a5c3b040d34eedd Mon Sep 17 00:00:00 2001 From: Dragory <2606411+Dragory@users.noreply.github.com> Date: Thu, 29 Apr 2021 00:56:56 +0300 Subject: [PATCH] Fix user mention not working in Automod reply action --- backend/src/plugins/Automod/actions/reply.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/backend/src/plugins/Automod/actions/reply.ts b/backend/src/plugins/Automod/actions/reply.ts index 579ff3fa..c8291e43 100644 --- a/backend/src/plugins/Automod/actions/reply.ts +++ b/backend/src/plugins/Automod/actions/reply.ts @@ -4,6 +4,7 @@ import { convertDelayStringToMS, noop, renderRecursively, + StrictMessageContent, stripObjectToScalars, tDelayString, tMessageContent, @@ -84,7 +85,13 @@ export const ReplyAction = automodAction({ continue; } - const replyMsg = await channel.createMessage(formatted); + const messageContent: StrictMessageContent = typeof formatted === "string" ? { content: formatted } : formatted; + const replyMsg = await channel.createMessage({ + ...messageContent, + allowedMentions: { + users: [user.id], + }, + }); if (typeof actionConfig === "object" && actionConfig.auto_delete) { const delay = convertDelayStringToMS(String(actionConfig.auto_delete))!;