# Discord

<details>

<summary><mark style="color:blue;">Step 1:</mark> Create a Discord Application</summary>

To start, create a **Discord bot**. \
This is done through this link: <https://discord.com/developers/applications>

<img src="https://3139465325-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGRDiw4P8uVibYkc3wqxQ%2Fuploads%2FfyhWWYVzHZasqYbxTjgn%2F1-done.jpg?alt=media&#x26;token=fb8a7c04-89b6-4552-ab89-4d24ab77d24c" alt="" data-size="original">

Give your discord-bot a appropriate name & and add a logo.

Follow <mark style="color:blue;">**Step 2**</mark> - for adding a correct **url-redirict** link for your application.&#x20;

</details>

<details>

<summary><mark style="color:blue;">Step 2:</mark> Add an url-redirect for your application</summary>

The next step is to add a **url link** to the bot a user goes to after they have **logged in.** \
This is a necessary step for your **Discord bot** to work.

<img src="https://3139465325-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGRDiw4P8uVibYkc3wqxQ%2Fuploads%2FVyiq4z1QL49Xxbus2iZl%2F2-done.png?alt=media&#x26;token=87a846bf-48de-4428-a194-c9784ce08e66" alt="" data-size="original">

Click <mark style="background-color:blue;">**"Add redirect"**</mark> under the category <mark style="background-color:blue;">**"OAuth2"**</mark>

### What link should be inserted?

Here you need to **insert** the following link:\
`https://<yoururl>.centox.io/api/auth/login/discord/callback`

Be sure to click <mark style="background-color:red;">**"Save Changes"**</mark> at the bottom.

### An example where the name of your forum is "<mark style="color:blue;">demo</mark>"

If the link to your forum is <mark style="color:orange;">**demo.centox.io**</mark>, insert the following link:\
`https://demo.centox.io/api/auth/login/discord/callback`

Follow <mark style="color:blue;">**Step 3**</mark> - on how to insert your Discord bot information into Centox.

</details>

<details>

<summary><mark style="color:blue;">Step 3:</mark> Insert the Discord bot credentials into your Centox project</summary>

The next **step** is to copy information from your **Discord bot** into your project on <mark style="color:blue;">Centox.</mark>

Copy the **"Client ID"** & **"Client Secret"** into your project on Centox. Both of these pieces of information can be found under the "OAuth2" category of your discord bot.

<img src="https://3139465325-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGRDiw4P8uVibYkc3wqxQ%2Fuploads%2FolBLLCglor8dIpl04O6m%2F4-done.png?alt=media&#x26;token=c2fa1a1f-bff5-485e-a989-bc388bc3836b" alt="" data-size="original"><br>

To copy them into your Centox project, you need to access the admin page for your project. \
And go to **Settings** -> **General** -> **Enable Provider**

<img src="https://files.gitbook.com/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGRDiw4P8uVibYkc3wqxQ%2Fuploads%2FxecpYYM07aVAJzb6ukRE%2F5-done.jpg?alt=media&#x26;token=569a392a-baae-4fc8-a7de-ad3367049f93" alt="" data-size="original">

**Once you have successfully copied them in, make sure to click "Enable Provider"**\
\
Follow <mark style="color:blue;">**Step 4**</mark> - on how to check if your bot **works** when users try to **log in**.

</details>

<details>

<summary><mark style="color:blue;">Step 4:</mark> Check if you can log in via Discord on your forum</summary>

</details>
