Merge pull request #1948 from lts20050703/gh-1900

Parse createEmoji and editEmoji bigint to string
This commit is contained in:
Skillz4Killz
2022-02-01 12:07:46 -05:00
committed by GitHub
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);
}