Update get_emoji.ts

This commit is contained in:
ITOH
2021-04-24 19:37:27 +02:00
parent 9b0a1d06ce
commit cab507c71b
+3 -3
View File
@@ -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,