Discord Bot Setup
Gateway API bot with slash command support
Overview
The Discord bot enables SingularCore to receive commands and send notifications through Discord servers. It supports slash commands, message intents, and role-based permissions for secure access control.
Difficulty
Easy
Setup Time
5 minutes
Notification Tiers
Normal, High, Urgent
Prerequisites
- Discord account
- Discord server where you have administrator permissions
- Python 3.9+
discord.pylibrary
Step-by-Step Setup
Create Discord Application
- Go to the Discord Developer Portal
- Click "New Application"
- Name your application (e.g., "SingularCore Bot")
- Click "Create"
Create Bot
- In your application, go to the "Bot" tab on the left sidebar
- Click "Add Bot" and confirm
- Under "Privileged Gateway Intents", enable:
- Message Content Intent
- Server Members Intent
- Click "Save Changes"
Get Application ID and Bot Token
- In the "General Information" tab, copy the Application ID
- In the "Bot" tab, click "Reset Token"
- Save the bot token securely - you won't see it again!
Add Bot to Server
- In the "OAuth2" tab, go to "OAuth2 URL Generator"
- Under "Scopes", select
botandapplications.commands - Under "Bot Permissions", select:
- Send Messages
- Read Message History
- Embed Links
- Attach Files
- Use Slash Commands
- Copy the generated URL and open it in your browser
- Select your server and authorize the bot
Get Guild ID
- In Discord, enable Developer Mode:
- User Settings → Advanced → Developer Mode (ON)
- Right-click your server name
- Click "Copy Server ID"
Configure Bot
Edit config/comms.json:
{
"discord": {
"enabled": true,
"bot_token": "your_bot_token_here",
"application_id": "your_application_id_here",
"guild_id": "your_guild_id_here",
"allowed_roles": ["Admin", "Moderator"],
"auto_setup": true,
"command_prefix": "/"
}
}Supported Commands
| Command | Description | Tier |
|---|---|---|
| /status | System health check | 0 |
| /skills | List all skills | 0 |
| /dream | View last dream summary | 0 |
| /approve <id> | Approve pending action | 1+ |
| /reject <id> | Reject pending action | 1+ |
| /stop | Pause heartbeat | 1+ |
| /resume | Resume heartbeat | 1+ |
Troubleshooting
Bot Not Responding
- Verify bot token is correct and not expired
- Check that bot has proper permissions in the server
- Ensure Message Content Intent is enabled in Bot settings
- Check that the bot is online in the server member list
Slash Commands Not Appearing
- Verify
applications.commandsscope was granted - Check that auto_setup is enabled in config
- Wait up to an hour for global command registration, or use guild-specific commands
- Restart the bot after configuration changes
"Missing Access" Error
- Verify bot has been added to the correct server
- Check that your role is in allowed_roles config
- Ensure bot has appropriate channel permissions
Need More Details?
View the complete setup guide with code examples, advanced configuration, and security best practices.
View Full DocumentationDocumentation Menu
Discord Bot Setup
Gateway API bot with slash command support
Overview
The Discord bot enables SingularCore to receive commands and send notifications through Discord servers. It supports slash commands, message intents, and role-based permissions for secure access control.
Difficulty
Easy
Setup Time
5 minutes
Notification Tiers
Normal, High, Urgent
Prerequisites
- Discord account
- Discord server where you have administrator permissions
- Python 3.9+
discord.pylibrary
Step-by-Step Setup
Create Discord Application
- Go to the Discord Developer Portal
- Click "New Application"
- Name your application (e.g., "SingularCore Bot")
- Click "Create"
Create Bot
- In your application, go to the "Bot" tab on the left sidebar
- Click "Add Bot" and confirm
- Under "Privileged Gateway Intents", enable:
- Message Content Intent
- Server Members Intent
- Click "Save Changes"
Get Application ID and Bot Token
- In the "General Information" tab, copy the Application ID
- In the "Bot" tab, click "Reset Token"
- Save the bot token securely - you won't see it again!
Add Bot to Server
- In the "OAuth2" tab, go to "OAuth2 URL Generator"
- Under "Scopes", select
botandapplications.commands - Under "Bot Permissions", select:
- Send Messages
- Read Message History
- Embed Links
- Attach Files
- Use Slash Commands
- Copy the generated URL and open it in your browser
- Select your server and authorize the bot
Get Guild ID
- In Discord, enable Developer Mode:
- User Settings → Advanced → Developer Mode (ON)
- Right-click your server name
- Click "Copy Server ID"
Configure Bot
Edit config/comms.json:
{
"discord": {
"enabled": true,
"bot_token": "your_bot_token_here",
"application_id": "your_application_id_here",
"guild_id": "your_guild_id_here",
"allowed_roles": ["Admin", "Moderator"],
"auto_setup": true,
"command_prefix": "/"
}
}Supported Commands
| Command | Description | Tier |
|---|---|---|
| /status | System health check | 0 |
| /skills | List all skills | 0 |
| /dream | View last dream summary | 0 |
| /approve <id> | Approve pending action | 1+ |
| /reject <id> | Reject pending action | 1+ |
| /stop | Pause heartbeat | 1+ |
| /resume | Resume heartbeat | 1+ |
Troubleshooting
Bot Not Responding
- Verify bot token is correct and not expired
- Check that bot has proper permissions in the server
- Ensure Message Content Intent is enabled in Bot settings
- Check that the bot is online in the server member list
Slash Commands Not Appearing
- Verify
applications.commandsscope was granted - Check that auto_setup is enabled in config
- Wait up to an hour for global command registration, or use guild-specific commands
- Restart the bot after configuration changes
"Missing Access" Error
- Verify bot has been added to the correct server
- Check that your role is in allowed_roles config
- Ensure bot has appropriate channel permissions
Need More Details?
View the complete setup guide with code examples, advanced configuration, and security best practices.
View Full Documentation