From 060ad2d9d45be55f7dcc7401c5e56080fbd1857d Mon Sep 17 00:00:00 2001 From: Isaac Aronson Date: Tue, 28 Nov 2023 16:44:40 -0600 Subject: [PATCH] Fix allowRoleMentions: false --- lib/mediator.ts | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/lib/mediator.ts b/lib/mediator.ts index 60d2bdb..5535681 100644 --- a/lib/mediator.ts +++ b/lib/mediator.ts @@ -657,17 +657,18 @@ export class Mediator { USERNAME_MIN_LENGTH, '_', ); + const allowedMentions = [AllowedMentionType.Users]; + if (canPingEveryone) { + allowedMentions.push(AllowedMentionType.Everyone); + } + if (this.allowRolePings) { + allowedMentions.push(AllowedMentionType.Roles); + } const payload: AllWebhookMessageOptions = { name: username, avatar: avatarURL, allowedMentions: { - parse: canPingEveryone - ? [ - AllowedMentionType.Roles, - AllowedMentionType.Users, - AllowedMentionType.Everyone, - ] - : [AllowedMentionType.Roles, AllowedMentionType.Users], + parse: allowedMentions, replied_user: true, }, };