Skip to content
This repository has been archived by the owner on Apr 24, 2024. It is now read-only.

Commit

Permalink
Fix allowRoleMentions: false (#58)
Browse files Browse the repository at this point in the history
  • Loading branch information
aronson committed Nov 28, 2023
1 parent 3287286 commit a3cf98e
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions lib/mediator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
},
};
Expand Down

0 comments on commit a3cf98e

Please sign in to comment.