mirror of
https://github.com/discordeno/discordeno.git
synced 2026-09-17 16:57:22 +00:00
fix webhook allowed mentions
This commit is contained in:
@@ -37,6 +37,15 @@ export async function sendWebhook(bot: Bot, webhookId: bigint, webhookToken: str
|
||||
}
|
||||
}
|
||||
|
||||
const allowedMentions = options.allowedMentions
|
||||
? {
|
||||
parse: options.allowedMentions.parse,
|
||||
repliedUser: options.allowedMentions.repliedUser,
|
||||
users: options.allowedMentions.users?.map((id) => id.toString()),
|
||||
roles: options.allowedMentions.roles?.map((id) => id.toString()),
|
||||
}
|
||||
: { parse: [] };
|
||||
|
||||
const result = await bot.rest.runMethod<Message>(
|
||||
bot.rest,
|
||||
"post",
|
||||
@@ -52,7 +61,7 @@ export async function sendWebhook(bot: Bot, webhookId: bigint, webhookToken: str
|
||||
tts: options.tts,
|
||||
file: options.file,
|
||||
embeds: options.embeds,
|
||||
allowed_mentions: options.allowedMentions,
|
||||
allowed_mentions: allowedMentions,
|
||||
}
|
||||
);
|
||||
if (!options.wait) return;
|
||||
|
||||
@@ -22,7 +22,12 @@ export interface ExecuteWebhook {
|
||||
/** Embedded `rich` content */
|
||||
embeds?: Embed[];
|
||||
/** Allowed mentions for the message */
|
||||
allowedMentions?: AllowedMentions;
|
||||
allowedMentions?: Omit<AllowedMentions, "users" | "roles"> & {
|
||||
/** Array of role_ids to mention (Max size of 100) */
|
||||
roles?: bigint[];
|
||||
/** Array of user_ids to mention (Max size of 100) */
|
||||
users?: bigint[];
|
||||
};
|
||||
}
|
||||
|
||||
export type DiscordExecuteWebhook = SnakeCasedPropertiesDeep<Omit<ExecuteWebhook, "wait">>;
|
||||
|
||||
Reference in New Issue
Block a user