# Creation and Configuration of the Discord Bot

<span style="white-space: pre-wrap;">In this section, we will guide you step by step through the creation and configuration of a Discord bot designed for the administration and management of </span>****Xelyos**** solutions.

<p class="callout warning">****Xelyos Liability:****<span style="white-space: pre-wrap;"> Xelyos cannot be held responsible for the actions of the bot on the Discord server. The use and configuration of the bot are the sole responsibility of the server administrator.</span></p>

<p class="callout info">****Bot Permissions:****<span style="white-space: pre-wrap;"> The bot does not require any specific permissions to perform actions on the server. Its only required access involves reading the list of users and their roles, as well as sending notifications.</span></p>

<p class="callout info">****Creating a Dedicated Bot:****<span style="white-space: pre-wrap;"> To ensure compatibility and prevent any interference with existing bots, it is essential to create a bot exclusively dedicated to the system, without reusing credentials from a preexisting bot.</span></p>

<u>We will cover the following steps:</u>

- <span style="white-space: pre-wrap;">Creating the bot via the </span>[Discord Developer Portal](https://discord.com/developers/applications).
- Configuring the necessary permissions and settings.
- Inviting the bot to your server!

The goal is to make the process clear and accessible, even for those who are new to managing Discord bots. By following this guide, you will be able to quickly set up your bot.

<span style="white-space: pre-wrap;">Let’s move on to the first step: </span><span style="color: rgb(186, 55, 42);">creating the Discord bot</span>.

---

### Step 1: Creating the Bot

##### 1. Access the Discord Developer Portal

<span style="white-space: pre-wrap;">Go to the official </span>[Discord Developer Portal](https://discord.com/developers/applications)<span style="white-space: pre-wrap;"> website. This is where you will manage your bot and its settings. Make sure you are logged in with your Discord account.</span>

##### 2. Create a New Application

Once on the portal:

- <span style="white-space: pre-wrap;">Click the </span>****"New Application"****<span style="white-space: pre-wrap;"> button at the top right of the screen.</span>
- A pop-up window will appear allowing you to name your application.

[![image.png](https://xelyos-wiki.s3.amazonaws.com/uploads/images/gallery/2025-04/scaled-1680-/r9zimage.png)](https://xelyos-wiki.s3.amazonaws.com/uploads/images/gallery/2025-04/r9zimage.png)

##### 3. Enter the Application Name

- <span style="white-space: pre-wrap;">Give your new application a name. It can be </span>****Dark Chat RP or XelNews****<span style="white-space: pre-wrap;"> or any other name that represents your bot.</span>
- <span style="white-space: pre-wrap;">Click </span>****"Create"****<span style="white-space: pre-wrap;"> to confirm the creation.</span>

[![image.png](https://xelyos-wiki.s3.amazonaws.com/uploads/images/gallery/2025-04/scaled-1680-/4Xximage.png)](https://xelyos-wiki.s3.amazonaws.com/uploads/images/gallery/2025-04/scaled-1680-/4Xximage.png)

##### 4. Add General Information

After creating the application, you will be redirected to the bot management page.

- ****Logo****: Upload an image to represent your bot (e.g., an avatar related to your server’s theme).
- ****Name****: Verify or modify the bot’s name.
- ****Description****: Add an optional description to explain what the bot does or provide details about its role.

[![image.png](https://xelyos-wiki.s3.amazonaws.com/uploads/images/gallery/2025-04/scaled-1680-/dIrimage.png)](https://xelyos-wiki.s3.amazonaws.com/uploads/images/gallery/2025-04/scaled-1680-/dIrimage.png)

---

### Step 2: Inviting the Bot to Your Discord

Although this step is done early in the process, it will allow us to quickly finalize the installation and move on to the next steps without complication. Don’t worry, this initial configuration doesn’t require advanced permissions for the bot, except the ability to send messages to users.

****Instructions for Installing the Bot:****

- ****Go to the "Installation" Section****
    - In the Discord Developer Portal, go to the application you just created.
    - <span style="white-space: pre-wrap;">In the sidebar, click on the </span>****Installation**** tab.

[![image.png](https://xelyos-wiki.s3.amazonaws.com/uploads/images/gallery/2025-04/scaled-1680-/lrBimage.png)](https://xelyos-wiki.s3.amazonaws.com/uploads/images/gallery/2025-04/lrBimage.png)

- ****Set the Parameters****
    - Set the parameters as shown in the image below.

[![image.png](https://xelyos-wiki.s3.amazonaws.com/uploads/images/gallery/2025-04/scaled-1680-/snGimage.png)](https://xelyos-wiki.s3.amazonaws.com/uploads/images/gallery/2025-04/snGimage.png)

- ****Invite the Bot to Your Server****
    - <span style="white-space: pre-wrap;">Copy the generated invite link for the bot from the </span>****Installation****<span style="white-space: pre-wrap;"> section.</span>
    - Paste this link into your browser to invite the bot to the Discord server of your choice.
    - <span style="white-space: pre-wrap;">Select the target server and click </span>****Authorize****.

[![image.png](https://xelyos-wiki.s3.amazonaws.com/uploads/images/gallery/2025-04/scaled-1680-/tvyimage.png)](https://xelyos-wiki.s3.amazonaws.com/uploads/images/gallery/2025-04/scaled-1680-/tvyimage.png)

---

### Step 3: Configuring OAuth2

This step is essential to enable user authentication within the xelyos solutions. We will configure the necessary information for the bot to interact correctly with the website.

##### 1. Retrieve the Client ID and Client Secret

- ****Access the OAuth2 Information****
    - <span style="white-space: pre-wrap;">From the </span>[Discord Developer Portal](https://discord.com/developers/applications), select the application you have created.
    - <span style="white-space: pre-wrap;">Click on the </span>****OAuth2****<span style="white-space: pre-wrap;"> tab in the sidebar.</span>

[![image.png](https://xelyos-wiki.s3.amazonaws.com/uploads/images/gallery/2025-04/scaled-1680-/knRimage.png)](https://xelyos-wiki.s3.amazonaws.com/uploads/images/gallery/2025-04/knRimage.png)

- ****Retrieve the Client ID****
    - <span style="white-space: pre-wrap;">In the </span>****General Information****<span style="white-space: pre-wrap;"> section, locate the </span>****Client ID****<span style="white-space: pre-wrap;"> field.</span>
    - <span style="white-space: pre-wrap;">Click the </span>****Copy****<span style="white-space: pre-wrap;"> button next to it to copy the unique identifier of your application.</span>
- ****Generate and Retrieve the Client Secret****
    - <span style="white-space: pre-wrap;">In the same </span>****General Information****<span style="white-space: pre-wrap;"> section, locate the </span>****Client Secret****<span style="white-space: pre-wrap;"> field.</span>
    - <span style="white-space: pre-wrap;">Click </span>****Reset Secret****<span style="white-space: pre-wrap;"> to generate a new secret.</span>
    - <span style="white-space: pre-wrap;">Once generated, copy the displayed </span>****Client Secret****.
- ****Integrate the Information into the Form****
    - <span style="white-space: pre-wrap;">The </span>****Client ID****<span style="white-space: pre-wrap;"> and </span>****Client Secret****<span style="white-space: pre-wrap;"> values are essential for correctly configuring the bot.</span>
    - <span style="white-space: pre-wrap;">Enter them into the </span>****GForm****<span style="white-space: pre-wrap;"> that was sent to you. </span>

[![image.png](https://xelyos-wiki.s3.amazonaws.com/uploads/images/gallery/2025-04/scaled-1680-/poXimage.png)](https://xelyos-wiki.s3.amazonaws.com/uploads/images/gallery/2025-04/poXimage.png)

- - <span style="white-space: pre-wrap;"> Paste the </span>****Client ID****<span style="white-space: pre-wrap;"> and </span>****Client Secret****<span style="white-space: pre-wrap;"> into the corresponding fields in the form.</span>

[![image.png](https://xelyos-wiki.s3.amazonaws.com/uploads/images/gallery/2025-04/scaled-1680-/Kgwimage.png)](https://xelyos-wiki.s3.amazonaws.com/uploads/images/gallery/2025-04/Kgwimage.png)

##### 2. Configuring the Redirect URL

To finalize the OAuth2 configuration, we need to define a redirect URL. This URL is used to verify and process the user information after authentication via Discord.

- ****Access the Redirect Settings****
    - <span style="white-space: pre-wrap;">Still in the </span>****OAuth2****<span style="white-space: pre-wrap;"> section of the Discord Developer Portal, locate the </span>****Redirects****<span style="white-space: pre-wrap;"> or </span>****Redirect URL****<span style="white-space: pre-wrap;"> section.</span>

[![image.png](https://xelyos-wiki.s3.amazonaws.com/uploads/images/gallery/2025-04/scaled-1680-/qxaimage.png)](https://xelyos-wiki.s3.amazonaws.com/uploads/images/gallery/2025-04/qxaimage.png)

- ****Compose the Redirect URL****
    - <span style="white-space: pre-wrap;">Take the domain name associated with your </span>****Dark Chat RP****<span style="white-space: pre-wrap;"> system.</span>
    - <span style="white-space: pre-wrap;">Add the prefix </span>`<span class="editor-theme-code">http://</span>`<span style="white-space: pre-wrap;"> in front of the domain name.</span>
    - <span style="white-space: pre-wrap;">Then add </span>`<span class="editor-theme-code">/connect-discord/check</span>`<span style="white-space: pre-wrap;"> at the end of the URL.</span>

****Example:****

<span style="white-space: pre-wrap;">If your domain is </span>`<span class="editor-theme-code">darkchatrp.xelyos.fr</span>`, your redirect URL will be:

[![image.png](https://xelyos-wiki.s3.amazonaws.com/uploads/images/gallery/2025-04/scaled-1680-/1ezimage.png)](https://xelyos-wiki.s3.amazonaws.com/uploads/images/gallery/2025-04/1ezimage.png)

---

### Step 4: Configuring the Bot Settings

##### 1. Set the Bot’s Name, Avatar, and Banner

[![image.png](https://xelyos-wiki.s3.amazonaws.com/uploads/images/gallery/2025-04/scaled-1680-/Juzimage.png)](https://xelyos-wiki.s3.amazonaws.com/uploads/images/gallery/2025-04/Juzimage.png)

##### 2. Retrieve the Bot Token

- ****Token****<span style="white-space: pre-wrap;">: In the </span>****Bot****<span style="white-space: pre-wrap;"> tab, copy the token of your bot.</span>
- ****Integration****<span style="white-space: pre-wrap;">: Paste this token into the </span>****GForm****<span style="white-space: pre-wrap;"> that was sent to you.</span>

[![image.png](https://xelyos-wiki.s3.amazonaws.com/uploads/images/gallery/2025-04/scaled-1680-/R7Rimage.png)](https://xelyos-wiki.s3.amazonaws.com/uploads/images/gallery/2025-04/R7Rimage.png)

[![image.png](https://xelyos-wiki.s3.amazonaws.com/uploads/images/gallery/2025-04/scaled-1680-/h03image.png)](https://xelyos-wiki.s3.amazonaws.com/uploads/images/gallery/2025-04/h03image.png)

<p class="callout warning">****Warning:****<span style="white-space: pre-wrap;"> The token is confidential, do not share it anywhere else!</span></p>

---

### Step 5: My Bot Stays with Me

This step ensures that your bot is not public and can only be available on your Discord server.

##### 1. Modify the Installation Link

- <span style="white-space: pre-wrap;">Go to the </span>****Installation****<span style="white-space: pre-wrap;"> tab in the Discord Developer Portal.</span>
- <span style="white-space: pre-wrap;">In the </span>****Install Link****<span style="white-space: pre-wrap;"> section, set it to </span>****none****<span style="white-space: pre-wrap;"> to prevent the bot from being added to other servers.</span>

[![image.png](https://xelyos-wiki.s3.amazonaws.com/uploads/images/gallery/2025-04/scaled-1680-/485image.png)](https://xelyos-wiki.s3.amazonaws.com/uploads/images/gallery/2025-04/485image.png)

##### 2. Disable the Public Bot Option

- <span style="white-space: pre-wrap;">Next, go to the </span>****Bot****<span style="white-space: pre-wrap;"> tab.</span>
- <span style="white-space: pre-wrap;">Uncheck the </span>****Public Bot****<span style="white-space: pre-wrap;"> option.</span>
- This will prevent your bot from being publicly visible and thus added to other servers.

[![image.png](https://xelyos-wiki.s3.amazonaws.com/uploads/images/gallery/2025-04/scaled-1680-/H4vimage.png)](https://xelyos-wiki.s3.amazonaws.com/uploads/images/gallery/2025-04/H4vimage.png)