The CloudyAI Discord bot client handles real-time message monitoring, sanction execution, and provides an interactive setup wizard for server configuration.
- Real-Time Moderation: Monitors all messages and applies sanctions
- Interactive Setup: DM-based configuration wizard
- Multi-Language: Supports EN, FR, ES, DE
- Smart Sanctions: Warn, timeout, kick, and ban capabilities
- Staff Immunity: Moderators/admins are exempt from sanctions
- Slash Commands:
/setupand/languagecommands
cd CloudyAI
npm installCreate .env file:
DISCORD_TOKEN=your-discord-bot-token
BOT_API_TOKEN=your-bot-api-token-here
API_BASE_URL=http://localhost:3000
API_WS_URL=http://localhost:3000node src/index.js- Go to https://discord.com/developers/applications
- Click "New Application"
- Name it "CloudyAI" and create
- Go to "Bot" tab
- Click "Add Bot"
- Copy the token to
.envasDISCORD_TOKEN
Enable these Privileged Gateway Intents:
- โ Server Members Intent
- โ Message Content Intent
Required permissions:
- View Channels
- Send Messages
- Manage Messages (delete)
- Kick Members
- Ban Members
- Moderate Members (timeout)
Use this URL (replace CLIENT_ID):
https://discord.com/oauth2/authorize?client_id=CLIENT_ID&permissions=1099780063238&scope=bot%20applications.commands
Starts the interactive configuration wizard in DMs.
Permissions: Administrator or Manage Guild
Usage: /setup
Changes the server's moderation language.
Permissions: Administrator or Manage Guild
Usage: /language (select from dropdown)
When a bot is added to an unconfigured server, the owner receives a DM with a setup wizard:
Step 1: Language
- Choose: English, Franรงais, Espaรฑol, Deutsch
Step 2: Auto-Delete
- Enable/disable automatic deletion of violating messages
Step 3: Escalation
- Enable/disable progressive sanctions
Auto-configured settings:
- Mode: Active (always)
- AI Moderation: Enabled (always)
- Message sent in server
- Bot forwards to CloudyAPI for evaluation
- API returns decision (ALLOW, WARN, TIMEOUT, KICK, BAN)
- Bot executes sanction if needed
WARN
- Sends DM to user
- No server action
TIMEOUT
- Sends DM to user
- Timeout for 1 minute
- Deletes message (if auto-delete enabled)
KICK
- Sends DM to user
- Kicks from server
- Deletes message
BAN
- Sends DM to user
- Bans from server
- Deletes message
Users with these permissions are immune:
- Administrator
- Moderate Members
- Ban Members
- Kick Members
- Manage Messages
Infractions are logged but no action is taken.
The bot supports 4 languages with full translations:
- English (en)
- French (fr)
- Spanish (es)
- German (de)
Language files: src/locales/*.json
CloudyAI/
โโโ src/
โ โโโ commands/
โ โ โโโ language.js # /language command
โ โ โโโ setup.js # /setup command
โ โโโ handlers/
โ โ โโโ interactionHandler.js # Slash commands & buttons
โ โ โโโ messageHandler.js # Message evaluation
โ โ โโโ moderationHandler.js # Sanction execution
โ โโโ utils/
โ โ โโโ configSetup.js # Setup wizard logic
โ โ โโโ dmHelper.js # DM utilities
โ โโโ locales/
โ โ โโโ en.json # English translations
โ โ โโโ fr.json # French translations
โ โ โโโ es.json # Spanish translations
โ โ โโโ de.json # German translations
โ โโโ localization.js # Translation helper
โ โโโ index.js # Main entry point
โโโ .env
| Variable | Description | Required |
|---|---|---|
DISCORD_TOKEN |
Discord bot token | Yes |
BOT_API_TOKEN |
CloudyAPI authentication token | Yes |
API_BASE_URL |
CloudyAPI base URL | Yes |
API_WS_URL |
CloudyAPI WebSocket URL | Yes |
- Check
DISCORD_TOKENis correct - Verify bot has required permissions
- Check Message Content Intent is enabled
- Ensure bot can DM the server owner
- Check owner's privacy settings
- Verify guild is not configured
- Check bot has required permissions
- Verify CloudyAPI is running
- Check
BOT_API_TOKENmatches API
- Run
/languagecommand as admin - Check CloudyAPI connection
- Verify guild configuration exists