Integrating with Discord
To enable Discord integration with EnhanceDocs Server, follow these steps:
- Update the
config.jsonfile by adding the following key-value pair within theintegrationsobject:
{
...
"integrations": {
...
"discord": true
}
}
- Provide the
DISCORD_TOKENas an environment variable in thedocker runcommand. To do this, you need to create a Discord developer account, set up a new application, enable message content intent in the bot settings, and install the bot on your server with thebotandadministratorscopes.
Creating a Discord Developer Account and Application
- Go to the Discord Developer Portal and sign in with your Discord account.
- Click on the "New Application" button in the top right corner.
- Enter a name for your application and click "Create".
- In the application settings, navigate to the "Bot" tab and click "Add Bot".
- Enable the "Message Content Intent" option in the bot settings.
Generating the OAuth2 URL and Installing the Bot
- In the application settings, go to the "OAuth2" tab.
- In the "Scopes" section, select the "bot" and "administrator" options.
- Click on the "URL Generator" tab to generate the OAuth2 URL.
- Follow the generated URL to add the bot to your desired Discord server.
Running EnhanceDocs Server with Discord Integration
Once you have completed the steps above, update your docker run command to include the DISCORD_TOKEN environment variable:
docker run -p 8080:8080 \
-v $(pwd)/.enhancedocs/data:/data/enhancedocs \
-v $(pwd)/.enhancedocs/config:/etc/enhancedocs \
--env OPENAI_API_KEY=sk-... \
--env DISCORD_TOKEN=your_discord_token \
enhancedocs/enhancedocs
Replace your_discord_token with the token you obtained from the Discord Developer Portal.
Summary
By following these steps, you can successfully enable Discord integration for EnhanceDocs Server, allowing you to access the AI-powered search engine within your Discord community server.
