Export Discord Emojis

DO NOT RUN CODE YOU DON'T UNDERSTAND

  1. Open dev tools (ctrl+shift+i).
  2. Click the `Application` Tab
  3. Go to Local Storage -> https:// ... discordapp.com ...
  4. Search for token and copy the value (right side of the table only)
  5. Click the `Console` tab
  6. Paste below code and replace the token
  7. Copy the result (wihtout quotes, there might be a copy button which just works)
  8. Paste it in the Text box here and press load
  9. Click on any server and wait a bit for it to load
async function fetchAllEmojis(token) {
  const resp = await fetch(
    "https://canary.discord.com/api/users/@me/guilds",
    {headers: {authorization: token}}
  );
  const json = await resp.json();
  if (resp.status !== 200) {
    console.error('failed to load guilds', json.message || json)
    return '[]';
  }

  let guildEmojis = [];
  for (guild of json) {
    let { id, name, icon } = guild;
    let emojisResp = await fetch(
      `https://canary.discord.com/api/guilds/${id}/emojis`,
      {headers: {authorization: token}}
    );
    let emojisJSON = await emojisResp.json();
    if (resp.status !== 200) {
      console.warn('failed to load guild emojis', emojisJSON.message || emojisJSON);
      continue;
    }

    guildEmojis.push({
      name,
      icon: id + "/" + icon,
      emojis: emojisJSON.map(e => [e.name, e.id]),
    })
  } 
  
  return JSON.stringify(guildEmojis);
}

console.log(await fetchAllEmojis("YOUR_TOKEN_HERE"));