From 30ba273fb146c127d11fb4740a360e894cf2676d Mon Sep 17 00:00:00 2001 From: Yudi <12040397+Yudi@users.noreply.github.com> Date: Sun, 4 May 2025 13:49:42 -0300 Subject: [PATCH] Update bot token docs (#1371) Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: Oleksii Holub <1935960+Tyrrrz@users.noreply.github.com> --- .docs/Token-and-IDs.md | 61 ++++++++++++++++--- .docs/Troubleshooting.md | 2 +- .../Commands/GuideCommand.cs | 9 ++- .../Views/Components/DashboardView.axaml | 16 ++++- DiscordChatExporter.Gui/Views/MainView.axaml | 2 +- 5 files changed, 78 insertions(+), 12 deletions(-) diff --git a/.docs/Token-and-IDs.md b/.docs/Token-and-IDs.md index 9374d9ff..f83bcef8 100644 --- a/.docs/Token-and-IDs.md +++ b/.docs/Token-and-IDs.md @@ -1,10 +1,11 @@ # Obtaining Token and Channel IDs -> **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 [Regenerate](#how-to-get-a-bot-token) in the bot settings. +> [!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](#how-to-export-with-a-bot-token) in the bot settings. -## How to get a User Token +## How to get a user token **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. @@ -254,17 +255,61 @@ Prerequisite step: Navigate to [discord.com](https://discord.com) and login. 4. Press Esc. The settings page will close. 5. To find your user token, continue [here](#in-chrome). -## How to get a Bot Token +## How to export with a bot token + +### Step 1 - Create an application + +You can create a new application or use an existing one. If you want to create a new one: + +1. Go to [Discord developer portal](https://discord.com/developers/applications) +2. Click on **New Application** in the top right corner +3. Enter a name for your application and click **Create** + +### Step 2 - Invite the bot to your server + +The bot needs to be invited to the server you'd like to export from. + +1. Go to [Discord developer portal](https://discord.com/developers/applications) +2. Navigate to **General Information** on the left +3. Copy the **Application ID** +4. Open the following URL in your browser, replacing `YOUR_APP_ID` with the copied Client ID: + + + +``` +https://discord.com/oauth2/authorize?scope=bot&permissions=66560&client_id=YOUR_APP_ID +``` + +### Step 3 - Ensure message content intent is enabled + +If this option is not enabled, the exported files will be empty. 1. Go to [Discord developer portal](https://discord.com/developers/applications) 2. Open your Application's settings 3. Navigate to the **Bot** section on the left -4. Under **Token** click **Copy** +4. Scroll down to the **Privileged Gateway Intents** section +5. Enable **Message Content Intent** by toggling the switch + + + +### Step 4 - Copy the bot token + +If you don't have a bot token yet or if you've lost it, follow these steps to reset it: + +1. Go to [Discord developer portal](https://discord.com/developers/applications) +2. Open your Application's settings +3. Navigate to the **Bot** section on the left +4. Under **Token** click **Reset Token** +5. Click **Yes, do it!** and authenticate to confirm + +> **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**: -> Your bot needs to have **Message Content Intent** enabled for it to be able to read messages! +> Resetting the token will invalidate the old one. Any integrations relying on the old token will cease to function until they are updated. -![https://discord.com/developers/applications/](https://i.imgur.com/BdrrxlY.png) +![https://discord.com/developers/applications/](https://i.imgur.com/soiB8Qc.png) --- diff --git a/.docs/Troubleshooting.md b/.docs/Troubleshooting.md index 9fde7feb..76e206a3 100644 --- a/.docs/Troubleshooting.md +++ b/.docs/Troubleshooting.md @@ -24,7 +24,7 @@ Follow the [instructions here](Token-and-IDs.md). ### Will I get banned if I use this? -Automating user accounts is technically against [TOS](https://discord.com/terms), use at your discretion. [Bot accounts](https://discord.com/developers/docs/topics/oauth2#bots) don't have this restriction. +Automating user accounts is technically against [TOS](https://discord.com/terms), use at your discretion. [Bot accounts](https://discord.com/developers/docs/topics/oauth2#bot-users) don't have this restriction. ### Will the messages disappear from the exported file if I delete a message, delete my account or block a person? diff --git a/DiscordChatExporter.Cli/Commands/GuideCommand.cs b/DiscordChatExporter.Cli/Commands/GuideCommand.cs index c643cb11..4c3a8df0 100644 --- a/DiscordChatExporter.Cli/Commands/GuideCommand.cs +++ b/DiscordChatExporter.Cli/Commands/GuideCommand.cs @@ -34,10 +34,17 @@ public class GuideCommand : ICommand using (console.WithForegroundColor(ConsoleColor.White)) console.Output.WriteLine("To get the token for your bot:"); + console.Output.WriteLine( + " The token is generated during bot creation. If you lost it, generate a new one:" + ); console.Output.WriteLine(" 1. Go to Discord developer portal"); console.Output.WriteLine(" 2. Open your application's settings"); console.Output.WriteLine(" 3. Navigate to the Bot section on the left"); - console.Output.WriteLine(" 4. Under Token click Copy"); + console.Output.WriteLine(" 4. Under Token click Reset Token"); + console.Output.WriteLine(" 5. Click Yes, do it! and authenticate to confirm"); + console.Output.WriteLine( + " * Integrations using the previous token will stop working until updated" + ); console.Output.WriteLine( " * Your bot needs to have the Message Content Intent enabled to read messages" ); diff --git a/DiscordChatExporter.Gui/Views/Components/DashboardView.axaml b/DiscordChatExporter.Gui/Views/Components/DashboardView.axaml index f8f9890b..350f6acf 100644 --- a/DiscordChatExporter.Gui/Views/Components/DashboardView.axaml +++ b/DiscordChatExporter.Gui/Views/Components/DashboardView.axaml @@ -332,6 +332,9 @@ Text="To get the token for your bot:" /> + + + @@ -356,7 +359,18 @@ + Text="Reset Token" /> + + + + + + + + diff --git a/DiscordChatExporter.Gui/Views/MainView.axaml b/DiscordChatExporter.Gui/Views/MainView.axaml index c93a0aee..f68e3dd6 100644 --- a/DiscordChatExporter.Gui/Views/MainView.axaml +++ b/DiscordChatExporter.Gui/Views/MainView.axaml @@ -7,7 +7,7 @@ xmlns:viewModels="clr-namespace:DiscordChatExporter.Gui.ViewModels" Title="{Binding Title}" Width="625" - Height="625" + Height="665" MinWidth="600" MinHeight="400" x:DataType="viewModels:MainViewModel"