diff --git a/Obtaining-Token-and-Channel-IDs.md b/Obtaining-Token-and-Channel-IDs.md index 7258fe2..453e5d0 100644 --- a/Obtaining-Token-and-Channel-IDs.md +++ b/Obtaining-Token-and-Channel-IDs.md @@ -15,58 +15,221 @@ To reset a bot token, click on "[Regenerate](#how-to-get-a-bot-token)". # ### How to get a User Token -> Automating user accounts is technically against TOS, use at your own risk. + +**Caution**: [Automating user accounts violates Discord's terms of service](https://support.discord.com/hc/en-us/articles/115002192352-Automated-user-accounts-self-bots-) and may result in account termination. Use at your own risk. #### Through your web browser -**1.** Open Discord in your **web browser** and login -**2.** Press **Ctrl+Shift+I** (⌥⌘I on macOS) to open **developer tools** -**3.** Press **Ctrl+Shift+M** (⇧⌘M) to toggle **device toolbar** -**4.** Navigate to the **Application** tab -**5.** On the left, expand **Local Storage** and select **https꞉//discord.com** -**6.** Type `token` into the **Filter** box -**7.** If the **token** key does not appear, press **Ctrl+R** (⌘R) to reload -**8.** Copy the **value** of the token key -##### Example, Windows 11, x64, Firefox 98.0.2 (64-bit) +Prerequisite step: Navigate to discord.com and login. -1. Visit https://discord.com/login and login -2. Press **F12**(or Ctrl+Shift+I) to open **Web Developer Tools**, which is in **Application Menu\More Tools** with the mouse -3. Press **Ctrl+Shift+M** to toggle **Responsive Design Mode** , which is a button at upper right of **Web Developer Tools** with the mouse -(3.1. It is like on mobile. It may be useful to change the selection of **Device Settings** at left of top bar such as iPhone) -4. Navigate to the **Storage** tab -5. On the left, expand **Local Storage** and select **https꞉//discord.com** -6. Type `token` into the **Filter** box -7. If the **token** key does not appear, press **Ctrl+R** to reload, or check step 3/3.1 -8. Copy the **value** of the token key, looked like "xODk3NTk4NpeB7jMwMTYzMTU.43QYjx.4k4h_H-i8feb_rY5OTk07bYv9xI" while the "" does not matter +##### In Chrome -> Still can't copy your token? [Try these instructions instead](https://github.com/Tyrrrz/DiscordChatExporter/wiki/Troubleshooting#i-cant-findcopy-my-token). +###### Using the network monitor -#### Through the desktop app -**1.** Find and open `settings.json` in your preferred text editor. +1. Press Ctrl+Shift+I (or ++I on macOS). Chrome's [DevTools](https://developer.chrome.com/docs/devtools/overview) tools will display. -**Windows:** Press **Windows+R** and paste `%appdata%/discord` into the text box, then press Enter. Look for the file in the newly opened window. -**macOS:** Open Finder, press **⇧⌘G** and paste `~/Library/Application Support/discord/settings.json` into the text box, then press Return. -**Linux:** The path is `~/.config/discord/settings.json`. +
+
-**2.** Add `"DANGEROUS_ENABLE_DEVTOOLS_ONLY_ENABLE_IF_YOU_KNOW_WHAT_YOURE_DOING": true,` to the second line, below the open curly bracket`{`. -Your file should look similar to this: +2. Click the `Network` tab. The [network panel](https://developer.chrome.com/docs/devtools/overview/#network) will open + +
+
+ +3. Press F5. The page will reload, and the network log (the lower half of the network panel) will display several entries. + +
+
+ +4. Click the text box labelled `Filter` and type `library`. The entries will filter down to a single entry named `library`. + +
+
+ +5. Click the entry named `library`. A panel will open to the right and display details about the entry. Click the `Headers` tab if it isn't already active. + +
+
+ +6. Scroll through the contents of the `Headers` tab until you find an entry beginning with `authorization:`. + +
+
+ +7. Right-click the entry and click `copy value`. + +
+
+ +###### Using the storage inspector + +1. Press Ctrl+Shift+I (or ++I on macOS). Chrome's [DevTools](https://developer.chrome.com/docs/devtools/overview/) will display. + +
+
+ +2. Press Ctrl+Shift+M (or +Shift+M). Chrome will enter [Device Mode](https://developer.chrome.com/docs/devtools/device-mode/), and the webpage will display as if on a mobile device. + +
+
+ +3. If necessary, click the `>>` at the right end of the tab bar, and click `Application`. The [application panel](https://developer.chrome.com/docs/devtools/overview/#application) will display. + +
+
+ +4. In the menu to the right, under `Storage`, expand `Local Storage` if necessary, then click `https://discord.com`. The pane to the right will display a list of key-value pairs. + +
+
+ +5. In the text box marked `Filter`, type `token`. The entries will filter down to those containing the string `token`. + +
+
+ +6. Click the entry `token`. (Note: if the token doesn't display, try refreshing by pressing F5.) + +
+
+ +7. Click the text box at the bottom, press Ctrl+A (or +A on macOS) then Ctrl+C (or +C on macOS) to copy the value to your clipboard. + +
+
+ +##### In Firefox + +###### Using the network monitor + +1. Press Ctrl+Shift+E (or ++E on macOS). Firefox’s [web developer tools](https://firefox-source-docs.mozilla.org/devtools-user/) will display at the bottom of the window, and the [network monitor](https://firefox-source-docs.mozilla.org/devtools-user/network_monitor/) will display. + +
+
+ +2. Press F5. The page will reload, and the [network request list](https://firefox-source-docs.mozilla.org/devtools-user/network_monitor/request_list/index.html) will populate with entries. + +
+
+ +3. Type `library` into the filter. The network request list will filter out any entries not containing the string `library`. + +
+
+ +4. Click `library`. The [network request details pane](https://firefox-source-docs.mozilla.org/devtools-user/network_monitor/request_details/index.html) will display. The [headers tab](https://firefox-source-docs.mozilla.org/devtools-user/network_monitor/request_details/index.html#network-monitor-request-details-headers-tab) should be active by default. If it isn’t, click it. + +
+
+ +5. Type `authorization` into the text box labelled `Filter Headers`. + +
+
+ +6. Scroll down until you see an entry labeled [authorization](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization) under `Request Headers`. + +
+
+ +7. Right-click the entry labeled `authorization` and select `copy value`. + +
+
+ +###### Using the storage inspector + +1. Press Shift+F9. Firefox’s [web developer tools](https://firefox-source-docs.mozilla.org/devtools-user/) will display at the bottom of the window, and the [storage](https://firefox-source-docs.mozilla.org/devtools-user/storage_inspector/index.html) panel will be selected. + +
+
+ +2. Press Ctrl+Shift+M (or ++M on macOS). Firefox will toggle [responsive design mode](https://firefox-source-docs.mozilla.org/devtools-user/responsive_design_mode/), and the web page will display as if on a mobile device. (Note: Discord may steal focus and respond to the command by toggling mute. If this happens, return focus to Firefox’s web developer tools by clicking somewhere in it, then try the command again.) + +
+
+ +3. In the [storage tree](https://firefox-source-docs.mozilla.org/devtools-user/storage_inspector/index.html#storage-inspector-storage-tree) (the list on the left side of the web developer tools panel), click [Local Storage](https://developer.mozilla.org/en-US/docs/Web/API/Window/localStorage). The entry will expand, and the entry `https://discord.com` will display beneath it. + +
+
+ +4. In the storage tree, click `https://discord.com`. The [table widget](https://firefox-source-docs.mozilla.org/devtools-user/storage_inspector/index.html#storage-inspector-table-widget) to the right of the storage tree will display several key-value pairs. + +
+
+ +5. In the text box labelled `Filter items` at the top of the table widget, enter `token`. The table will now only display entries containing the string `token`. + +
+
+ +6. Click the entry `token`. The [sidebar](https://firefox-source-docs.mozilla.org/devtools-user/storage_inspector/index.html#storage-inspector-sidebar) will display. (Note: If the token doesn’t display, try refreshing by pressing F5.) + +
+
+ +7. Right-click the single entry in the sidebar and select `copy`. + +
+
+ +#### Through the desktop app / Enabling web developer tools + +##### By editing the settings file + +1. If Discord is running, exit the application by right-clicking the icon in your taskbar tray and clicking `Quit Discord`. + +2. Open Discord's settings file in your preferred text editor. See the following table for help finding it: + + | OS | Stable | Canary | Public Test Beta | + |---------|-------------------------------------------------------|-------------------------------------------------------------|----------------------------------------------------------| + | 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 Beta | + |---------|-------------------------------------------------------------------------|-------------------------------------------------------------------------|----------------------------------------------------------------------| + | 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` | + +3. 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: ```json { "DANGEROUS_ENABLE_DEVTOOLS_ONLY_ENABLE_IF_YOU_KNOW_WHAT_YOURE_DOING": true, "BACKGROUND_COLOR": "#202225", - "IS_MAXIMIZED": true, - ... + "IS_MAXIMIZED": true } ``` -> Do not copy and paste the entire block of code above, edit only the second line. +4. Launch Discord. +5. To find your user token, continue [here](https://github.com/Tyrrrz/DiscordChatExporter/wiki/Obtaining-Token-and-Channel-IDs#in-chrome). -**4.** Restart Discord. -**5.** [Follow these steps](https://github.com/Tyrrrz/DiscordChatExporter/wiki/Troubleshooting#i-cant-findcopy-my-token). +##### Via settings menu (BetterDiscord only) -*** +1. Click the User Settings button (the gear icon to the right of your username). Discord’s settings page will open. + +
+
+ +2. In the sidebar to the left, click `Settings` under the `BetterDiscord` group. BetterDiscord’s settings page will display. + +
+
+ +3. In the main panel to the right, expand the `Developer Settings` group if necessary, and toggle `DevTools` to enabled. + +
+
+ +4. Press Esc. The settings page will close. + +5. To find your user token, continue [here](https://github.com/Tyrrrz/DiscordChatExporter/wiki/Obtaining-Token-and-Channel-IDs#in-chrome). ### How to get a Bot Token **1.** Go to [Discord developer portal](https://discord.com/developers/applications)