Skip to content

Commit

Permalink
Fix ClientOptions.allowedMentions not being respected in message edit (
Browse files Browse the repository at this point in the history
  • Loading branch information
TheKodeToad authored Apr 26, 2024
1 parent 4d73673 commit c6c9f52
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/routes/Channels.ts
Original file line number Diff line number Diff line change
Expand Up @@ -488,7 +488,7 @@ export default class Channels {
method: "PATCH",
path: Routes.CHANNEL_MESSAGE(channelID, messageID),
json: {
allowed_mentions: options.allowedMentions ? this.#manager.client.util.formatAllowedMentions(options.allowedMentions) : undefined,
allowed_mentions: this.#manager.client.util.formatAllowedMentions(options.allowedMentions),
attachments: options.attachments,
components: options.components ? this.#manager.client.util.componentsToRaw(options.components) : undefined,
content: options.content,
Expand Down
2 changes: 1 addition & 1 deletion lib/routes/Webhooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ export default class Webhooks {
method: "PATCH",
path: Routes.WEBHOOK_MESSAGE(webhookID, token, messageID),
json: {
allowed_mentions: options.allowedMentions ? this.#manager.client.util.formatAllowedMentions(options.allowedMentions) : undefined,
allowed_mentions: this.#manager.client.util.formatAllowedMentions(options.allowedMentions),
attachments: options.attachments,
components: options.components ? this.#manager.client.util.componentsToRaw(options.components) : undefined,
content: options.content,
Expand Down
2 changes: 1 addition & 1 deletion lib/util/Util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,7 @@ export default class Util {
}));
}

formatAllowedMentions(allowed?: AllowedMentions): RawAllowedMentions {
formatAllowedMentions(allowed?: AllowedMentions | null): RawAllowedMentions {
const result: RawAllowedMentions = { parse: [] };

if (!allowed) {
Expand Down

0 comments on commit c6c9f52

Please sign in to comment.