diff --git a/docs/integrations/communication/discord.md b/docs/integrations/communication/discord.md index d74ccc7..c7bc7a3 100644 --- a/docs/integrations/communication/discord.md +++ b/docs/integrations/communication/discord.md @@ -4,7 +4,7 @@ sidebar_position: 5 # Discord -[Discord](https://discord.com/) is a free voice, video, and text chat app for wide spectre of users. +[Discord](https://discord.com/) is a free voice, video, and text chat app for wide spectre of users. It's a perfect tool for community building and arranging communication with your users. With it, you can build servers that are open for public, or you can create a private, invite-only servers which are intended for smaller, closer groups.
@@ -70,38 +70,38 @@ pip install "discord-adapter[dev]~=5.0" ## How to create a Discord bot TL;DR: you'll need to create a new application, then create a bot, and finally get the bot token. -First you'll have to [register for a Discord account](https://discord.com/register). +First you'll have to [register for a Discord account](https://discord.com/register). When you finish with your registration or if you already have a Discord account, you can begin with following these steps: 1. Visit [Dicord's developers site](https://discord.com/developers/applications) and log in with your Discord account 2. Click to the `New application` button - you need an application to create a bot
- ![image](/img/discord/create-discord-bot1.png) +![image](/img/discord/create-discord-bot1.png)
3. Give your app a name and click `Create`
- ![image](/img/discord/create-discord-bot2.png) +![image](/img/discord/create-discord-bot2.png)
4. This will lead you to the newly created app menu, where you should click to the `Bot` side-option and continue with `Add Bot` and confirm this action
- ![image](/img/discord/create-discord-bot3.png) +![image](/img/discord/create-discord-bot3.png)
5. After creating a bot, you can now specify its name (optionally, you can set an avatar and experiment with other bot options) 6. On the same menu, scroll down and toggle: 'Presence Intent', 'Server Members Intent', 'Message Content Intent'
- ![image](/img/discord/create-discord-bot4.png) +![image](/img/discord/create-discord-bot4.png)
7. You can get your bot token by clicking `View token`
- ![image](/img/discord/create-discord-bot5.png) +![image](/img/discord/create-discord-bot5.png)
:::caution Store the token somewhere safe @@ -115,13 +115,13 @@ Also, make sure to keep your bot token secret, as it can be used to control your 2. Click on the `OAuth2` menu and choose the `Url Generator` sub-menu
- ![image](/img/discord/create-discord-bot6.png) +![image](/img/discord/create-discord-bot6.png)
3. Select `bot` within the `SCOPES` category, go to the `BOT PERMISSIONS` category that poped up and choose what options you want to authorize
- ![image](/img/discord/create-discord-bot7.png) +![image](/img/discord/create-discord-bot7.png)
:::info Picking the right permissions @@ -155,7 +155,7 @@ Same goes for `chatId` and `guildId`, which is the unique identifier of the serv Using more than one bot in your Discord server will simplify keeping track of the communication between users and your agents. This also helps with the separation of concerns, as each bot can be assigned to a specific task they have. -For example, one bot can be used to send messages to the users, while other can be used to receive messages from the users. +For example, one bot can be used to send messages to the users, while other can be used to receive messages from the users. You can also have another bot that will notify a specific persona to take action after some unexpected event. Also, Discord allows you to have a single bot on multiple servers, which is also one way for you to organize your client communication. @@ -172,14 +172,14 @@ For example, a `sendMessage` function in your Agent class could look like this: ```java public void sendMessage(String text){ - SendChannelMessage channelMessage = DiscordAdapterAPI.sendChannelMessage(text, channelId); - String replyMessageId = channelMessage.getId(); - } + SendChannelMessage channelMessage = DiscordAdapterAPI.sendChannelMessage(text, channelId); + String replyMessageId = channelMessage.getId(); + } ``` :::note - The fields `List