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
-
Hi, Is there an api endpoint for fetching all the emoji urls you have access to? |
Beta Was this translation helpful? Give feedback.
Answered by
rigwild
Jul 9, 2021
Replies: 1 comment
-
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)
}
console.log('All emojis', emojis)
} |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
rigwild
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.