prompt: Can you write me a TypeScript function that uses discord.js to look up a given emoji by emote ID and guild ID regardless of whether it's cached and return undefined if it cannot be found?
chosen.role: system
chosen.content: A chat.
chosen.role: user
chosen.content: Can you write me a TypeScript function that uses discord.js to look up a given emoji by emote ID and guild ID regardless of whether it's cached and return undefined if it cannot be found?
chosen.role: assistant
chosen.content: Here is a TypeScript function that uses discord.js to look up an emoji:
  
  async function lookUpEmoji(emojiId: string, guildId: string) {
          const guild = await client.guilds.fetch(guildId);
          const emoji = (await guild.emojis.fetch()).get(emojiId);
          if (emoji) return emoji;
  }
rejected.role: system
rejected.content: A chat.
rejected.role: user
rejected.content: Can you write me a TypeScript function that uses discord.js to look up a given emoji by emote ID and guild ID regardless of whether it's cached and return undefined if it cannot be found?
rejected.role: assistant