diff --git a/src/gateway/handlers/guildEmojiUpdate.ts b/src/gateway/handlers/guildEmojiUpdate.ts index db5e254..fddb657 100644 --- a/src/gateway/handlers/guildEmojiUpdate.ts +++ b/src/gateway/handlers/guildEmojiUpdate.ts @@ -17,7 +17,7 @@ export const guildEmojiUpdate: GatewayEventHandler = async ( const _updated: EmojiPayload[] = [] for (const raw of d.emojis) { - const emojiID = raw.id !== null ? raw.id : raw.name + const emojiID = (raw.id !== null ? raw.id : raw.name) as string const has = emojis.get(emojiID) if (has === undefined) { await guild.emojis.set(emojiID, raw) @@ -27,7 +27,7 @@ export const guildEmojiUpdate: GatewayEventHandler = async ( } for (const emoji of emojis.values()) { - const emojiID = emoji.id !== null ? emoji.id : emoji.name + const emojiID = (emoji.id !== null ? emoji.id : emoji.name) as string const find = _updated.find((e) => { const eID = e.id !== null ? e.id : e.name return emojiID === eID @@ -36,7 +36,7 @@ export const guildEmojiUpdate: GatewayEventHandler = async ( await guild.emojis.delete(emojiID) deleted.push(emoji) } else { - const foundID = find.id !== null ? find.id : find.name + const foundID = (find.id !== null ? find.id : find.name) as string const before = (await guild.emojis.get(foundID)) as Emoji await guild.emojis.set(foundID, find) const after = (await guild.emojis.get(foundID)) as Emoji diff --git a/src/gateway/handlers/messageReactionAdd.ts b/src/gateway/handlers/messageReactionAdd.ts index 5b05ddd..edc88ae 100644 --- a/src/gateway/handlers/messageReactionAdd.ts +++ b/src/gateway/handlers/messageReactionAdd.ts @@ -29,7 +29,7 @@ export const messageReactionAdd: GatewayEventHandler = async ( } else return } - const emojiID = d.emoji.id !== null ? d.emoji.id : d.emoji.name + const emojiID = (d.emoji.id !== null ? d.emoji.id : d.emoji.name) as string let reaction = await message.reactions.get(emojiID) if (reaction === undefined) { await message.reactions.set(emojiID, { diff --git a/src/gateway/handlers/messageReactionRemove.ts b/src/gateway/handlers/messageReactionRemove.ts index 9cf50fa..77ca7df 100644 --- a/src/gateway/handlers/messageReactionRemove.ts +++ b/src/gateway/handlers/messageReactionRemove.ts @@ -27,7 +27,7 @@ export const messageReactionRemove: GatewayEventHandler = async ( } else return } - const emojiID = d.emoji.id !== null ? d.emoji.id : d.emoji.name + const emojiID = (d.emoji.id !== null ? d.emoji.id : d.emoji.name) as string const reaction = await message.reactions.get(emojiID) if (reaction === undefined) return diff --git a/src/gateway/handlers/messageReactionRemoveEmoji.ts b/src/gateway/handlers/messageReactionRemoveEmoji.ts index 0d1cd05..273ebc1 100644 --- a/src/gateway/handlers/messageReactionRemoveEmoji.ts +++ b/src/gateway/handlers/messageReactionRemoveEmoji.ts @@ -19,7 +19,7 @@ export const messageReactionRemoveEmoji: GatewayEventHandler = async ( } else return } - const emojiID = d.emoji.id !== null ? d.emoji.id : d.emoji.name + const emojiID = (d.emoji.id !== null ? d.emoji.id : d.emoji.name) as string const reaction = await message.reactions.get(emojiID) if (reaction === undefined) return