createEmoji and editEmoji helper options roles bigints doesn't call .toString()

This commit is contained in:
lts20050703
2022-01-26 10:01:22 +07:00
parent 4ed54a91b5
commit 306fa22112
2 changed files with 10 additions and 12 deletions
+6 -6
View File
@@ -8,12 +8,12 @@ export async function createEmoji(bot: Bot, guildId: bigint, options: CreateGuil
options.image = await bot.utils.urlToBase64(options.image);
}
const emoji = await bot.rest.runMethod<Emoji>(
bot.rest,
"post",
bot.constants.endpoints.GUILD_EMOJIS(guildId),
options
);
const emoji = await bot.rest.runMethod<Emoji>(bot.rest, "post", bot.constants.endpoints.GUILD_EMOJIS(guildId), {
name: options.name,
image: options.image,
roles: options.roles?.map((role) => role.toString()),
reason: options.reason,
});
return {
...emoji,
+4 -6
View File
@@ -4,12 +4,10 @@ import type { Bot } from "../../bot.ts";
/** Modify the given emoji. Requires the MANAGE_EMOJIS permission. */
export async function editEmoji(bot: Bot, guildId: bigint, id: bigint, options: ModifyGuildEmoji) {
const result = await bot.rest.runMethod<Emoji>(
bot.rest,
"patch",
bot.constants.endpoints.GUILD_EMOJI(guildId, id),
options
);
const result = await bot.rest.runMethod<Emoji>(bot.rest, "patch", bot.constants.endpoints.GUILD_EMOJI(guildId, id), {
name: options.name,
roles: options.roles?.map((role) => role.toString()),
});
return bot.transformers.emoji(bot, result);
}