.docs/Token-and-IDs.md
[!WARNING] Do not share your token! A token gives full access to an account.
To reset a user token, change your account password.
To reset a bot token, click on Reset Token in the bot settings.
Caution: Automating user accounts violates Discord's terms of service and may result in account termination. Use at your own risk.
Prerequisite step: Navigate to discord.com and login.
Click the Console tab. The console will open.
Type
let m;webpackChunkdiscord_app.push([[Math.random()],{},e=>{for(let i in e.c){let x=e.c[i];if(x?.exports?.getToken){m=x;break}}}]);m&&console.log("Token:",m.exports.getToken());
into the console and press <kbd>Enter</kbd>. The console will display your user token.
Network tab. The network panel will openFilter and type messages. The entries will filter down to a single request named messages. If the request doesn't appear, switch to any other Discord channel to trigger it.messages. A panel will open to the right and display details about the entry. Click the Headers tab if it isn't already active.Headers tab until you find an entry beginning with authorization:.copy value.» at the right end of the tab bar, and click Application. The application panel will display.Storage, expand Local Storage if necessary, then click https://discord.com. The pane to the right will display a list of key-value pairs.Filter, type token. The entries will filter down to those containing the string token.token entry. (Note: if the token doesn't display, try refreshing by pressing <kbd>F5</kbd> or <kbd>⌘</kbd>+<kbd>R</kbd> on macOS)Click the Console tab. The console will open.
Type
let m;webpackChunkdiscord_app.push([[Math.random()],{},e=>{for(let i in e.c){let x=e.c[i];if(x?.exports?.getToken){m=x;break}}}]);m&&console.log("Token:",m.exports.getToken());
into the console and press <kbd>Enter</kbd>. The console will display your user token.
messages into the filter. The network request list will filter out any entries not containing the string messages. If the request doesn't appear, switch to any other Discord channel to trigger it.messages. The network request details pane will display. The headers tab should be active by default. If it isn’t, click it.authorization into the text box labelled Filter Headers.Request Headers.authorization and select copy value.https://discord.com will display beneath it.https://discord.com. The table widget to the right of the storage tree will display several key-value pairs.Filter items at the top of the table widget, enter token. The table will now only display entries containing the string token.token. The sidebar will display. (Note: If the token doesn’t display, try refreshing by pressing <kbd>F5</kbd>.)copy.If Discord is running, exit the application by right-clicking the icon in your taskbar tray and clicking Quit Discord.
Open Discord's settings file in your preferred text editor. See the following table for help finding it:
| OS | Stable | Canary | Public Test Build (PTB) |
|---|---|---|---|
| Windows | %APPDATA%\discord\settings.json | %APPDATA%\discordcanary\settings.json | %APPDATA%\discordptb\settings.json |
| macOS | ~/Library/Application Support/discord/settings.json | ~/Library/Application Support/discordcanary/settings.json | ~/Library/Application Support/discordptb/settings.json |
| Linux | ~/.config/discord/settings.json | ~/.config/discordcanary/settings.json | ~/.config/discordptb/settings.json |
If you use BetterDiscord, use the following table instead:
| OS | Stable | Canary | Public Test Build (PTB) |
|---|---|---|---|
| Windows | %APPDATA%\BetterDiscord\data\stable\settings.json | %APPDATA%\BetterDiscord\data\canary\settings.json | %APPDATA%\BetterDiscord\data\ptb\settings.json |
| macOS | ~/Library/Application Support/BetterDiscord/data/stable/settings.json | ~/Library/Application Support/BetterDiscord/data/canary/settings.json | ~/Library/Application Support/BetterDiscord/data/ptb/settings.json |
| Linux | ~/.config/BetterDiscord/data/stable/settings.json | ~/.config/BetterDiscord/data/canary/settings.json | ~/.config/BetterDiscord/data/ptb/settings.json |
Insert a blank line after the first curly bracket ({), add the text "DANGEROUS_ENABLE_DEVTOOLS_ONLY_ENABLE_IF_YOU_KNOW_WHAT_YOURE_DOING": true, to it, and save the file. Your file should resemble the following:
{
"DANGEROUS_ENABLE_DEVTOOLS_ONLY_ENABLE_IF_YOU_KNOW_WHAT_YOURE_DOING": true,
"BACKGROUND_COLOR": "#202225",
"IS_MAXIMIZED": true
}
Launch Discord.
To find your user token, continue here.
Settings under the BetterDiscord group. BetterDiscord’s settings page will display.Developer Settings group if necessary, and toggle DevTools to enabled.You can create a new application or use an existing one. If you want to create a new one:
The bot needs to be invited to the server you'd like to export from.
YOUR_APP_ID with the copied Client ID:https://discord.com/oauth2/authorize?scope=bot&permissions=66560&client_id=YOUR_APP_ID
If this option is not enabled, the exported files will be empty.
If you don't have a bot token yet or if you've lost it, follow these steps to reset it:
Tip: As the token is only shown once, make sure to store it in a safe place. If you lose the token, you will have to reset it again.
[!WARNING] Resetting the token will invalidate the old one. Any integrations relying on the old token will cease to function until they are updated.