> For the complete documentation index, see [llms.txt](https://docs.din.lol/reiki/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.din.lol/reiki/how-to-start/bot-lab/bot-management/deployment-service/discord.md).

# Discord

## Onboard your bot to Discord server

💁🏼 If you encounter any issues while using it, please join our Discord community to ask for assistance.

&#x20;📌 When renaming the bot, please follow [Discord's naming rules](https://discord.com/developers/docs/resources/user).

### **Prerequisites**

* Obtain an API key from the API Intergation section.

<figure><img src="https://2234394147-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwPMhcNZiJeX8RfkpnmYy%2Fuploads%2FldwSgK6P0FloC9qaPyNu%2F1695699056139.png?alt=media&amp;token=6aab0b86-a96f-493f-8bb8-c4ddda28a0d1" alt=""><figcaption></figcaption></figure>

### **Configuration**

1. Switch to the Integration tab and locate "Deploy to Discord". Next, click on "Deploy to a new server".

<figure><img src="https://2234394147-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwPMhcNZiJeX8RfkpnmYy%2Fuploads%2FRJVu7xhWc8Am39bJi8bh%2F1700533544035.png?alt=media&amp;token=6b789795-b9a6-4388-8dfb-ab8be9cfe7e5" alt=""><figcaption></figcaption></figure>

2. Select the server you want to add.

<figure><img src="https://2234394147-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwPMhcNZiJeX8RfkpnmYy%2Fuploads%2F4gS5AkdRIlHMjLb4k3SA%2Fimage.png?alt=media&amp;token=ae370716-eb14-4617-8a11-614c4c5c131a" alt=""><figcaption></figcaption></figure>

3. After adding the bot to your discord server, you should be able to find the command `set_api_key` by typing slash key `/`.

<figure><img src="https://2234394147-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwPMhcNZiJeX8RfkpnmYy%2Fuploads%2FagnWsdb3t4PnN93mk9Ae%2F1695699085721(1).png?alt=media&amp;token=b6105ce4-fe0b-43bc-bfcb-f1e50ca3fad5" alt=""><figcaption></figcaption></figure>

4. Press `enter` key and paste your API key in the prompted input box. The bot should respond with `discord bot api key updated` .

<figure><img src="https://2234394147-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwPMhcNZiJeX8RfkpnmYy%2Fuploads%2F5ohBqkRd61pVOiTVaJkw%2F1695699204406.png?alt=media&amp;token=7130c782-f8f6-4182-9606-eee72fb4cd69" alt=""><figcaption></figcaption></figure>

5. Add channel list where the bot can be active. typing slash key `/` again and find the command `add_allowed_channel`

![](https://2234394147-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwPMhcNZiJeX8RfkpnmYy%2Fuploads%2FRpemh8ZTC7ha3EC4WkEK%2F1695699167661.png?alt=media\&token=473756bf-c011-4bbd-bbbf-cd5b66014012)

6. Click on `target_channel` to select the channel you want to add, if no channel was selected, this command will add the current channel you are using to allowed channel list.

<figure><img src="https://2234394147-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwPMhcNZiJeX8RfkpnmYy%2Fuploads%2FWtj80u3W9Js9zZrJSY2I%2F1695699243318.png?alt=media&amp;token=eda1ebb9-4ec2-471d-864e-8a5a8fe0d885" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
&#x20;**IMPORTANT:** Ensure that the Discord administrator grants the Bot sufficient permissions, enabling it to speak in the appropriate channel. This step is crucial for the Bot to function effectively.
{% endhint %}

### Test Permission

Use `ping` command in a channel to test if bot can respond with `pong`, if not, the bot will raise an error like, then you should check the bot’s permission again.

<figure><img src="https://2234394147-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwPMhcNZiJeX8RfkpnmYy%2Fuploads%2FiFcS7tVq9FNkyV1Dp0V9%2F1695699371191.png?alt=media&amp;token=64acca28-02f2-45f1-af6f-02bfdf07e177" alt=""><figcaption></figcaption></figure>

**Talking to Bot**

Simply use `@` to mention the bot along with your message in previously added channel, then the bot will create a thread and respond to your questions. You can also reply to the bot in the same thread to keep the conversation going.

![](https://2234394147-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwPMhcNZiJeX8RfkpnmYy%2Fuploads%2FrSKcU90aion7bom0Bk6U%2F1695699326791.png?alt=media\&token=b6b11ae2-262c-4488-a0e6-c162043a7c87)

###

### **Command Explaination**

There are other commands you can use to configure the bot

* `set_name` change the nick name of bot in your server
* `ping` the bot should respond with “pong”, can be used to test if bot have message permission in this channel, if not, the bot would respond with an error message
* `add_admin_user` by default only members with `manage server` permission in your server (this includes server owner, admins and those who were explicitly granted this permission) can manage the bot you’ve added. You can add additional members using this command.
* `remove_admin_user` the opposite of `add_admin_user`
* `remove_allowed_channel` the opposite of `add_allowed_channel`
* `refresh_commands` bot may support additional commands in the future, to make sure you have the latest commands in your server, you can use this command to fetch the latest list of commands available.
