mirror of
https://github.com/discordeno/discordeno.git
synced 2026-06-16 11:28:15 +00:00
Update get_emoji.ts
This commit is contained in:
@@ -14,16 +14,16 @@ export async function getEmoji(
|
||||
emojiId: string,
|
||||
addToCache = true,
|
||||
) {
|
||||
const result = (await rest.runMethod(
|
||||
const result = await rest.runMethod<Emoji>(
|
||||
"get",
|
||||
endpoints.GUILD_EMOJI(guildId, emojiId),
|
||||
)) as Emoji;
|
||||
);
|
||||
|
||||
if (addToCache) {
|
||||
const guild = await cacheHandlers.get("guilds", guildId);
|
||||
if (!guild) throw new Error(Errors.GUILD_NOT_FOUND);
|
||||
guild.emojis.set(emojiId, result);
|
||||
cacheHandlers.set(
|
||||
await cacheHandlers.set(
|
||||
"guilds",
|
||||
guildId,
|
||||
guild,
|
||||
|
||||
Reference in New Issue
Block a user