Skip to content

How to list all custom emojis urls from all guilds you are a member of #2

Answered by rigwild
eggsampler asked this question in Q&A
Discussion options

You must be logged in to vote

Yes there is. Here is the endpoint: https://discord.com/developers/docs/resources/emoji#list-guild-emojis

I added it to the script as it was missing. You can combine it with a user guilds list (https://discord.com/developers/docs/resources/user#get-current-user-guilds) to get all the emojis.

{
  let guilds = await api.listCurrentUserGuilds()
  const emojis = []
  for (const guild of guilds) {
    const guildEmojis = await api.listEmojis(guild.id)
    // Add `emoji.url`
    guildEmojis.forEach((emoji, i) => guildEmojis[i].url = `${emoji.name}:${emoji.id}`)
    console.log(`Emojis from guild ${guild.name} (${guild.id})`, guildEmojis)
    emojis.push(...guildEmojis)
    await delay(200)
  }
  

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by rigwild
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants