mirror of
https://github.com/discordeno/discordeno.git
synced 2026-09-17 08:47:22 +00:00
Merge pull request #1948 from lts20050703/gh-1900
Parse createEmoji and editEmoji bigint to string
This commit is contained in:
@@ -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,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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user