Prerequisites
Before installing ChimBot, ensure you have the following:Python 3.8+
ChimBot requires Python 3.8 or higher for async/await support
Discord Bot Token
Create a bot application in the Discord Developer Portal
Groq API Key
Sign up for free API access at Groq Console
Discord Server
A Discord server where you have admin permissions
Installation Methods
- Standard Installation
- Using requirements.txt
1. Download the Source Code
Clone the repository or download the source code:2. Create a Virtual Environment (Recommended)
Create and activate a virtual environment to isolate dependencies:3. Install Required Packages
Install all dependencies:Package Details
Package Details
- discord.py - Discord API wrapper for Python
- python-dotenv - Load environment variables from .env file
- groq - Official Groq API client for AI inference
Discord Bot Setup
Create Discord Application
- Go to Discord Developer Portal
- Click New Application
- Give your bot a name (e.g., “ChimBot”)
- Click Create
Create Bot User
- Navigate to the Bot section in the left sidebar
- Click Add Bot and confirm
- Under Privileged Gateway Intents, enable:
- Presence Intent
- Server Members Intent
- Message Content Intent (required)
Get Bot Token
- In the Bot section, click Reset Token
- Copy the token (you’ll need this for the
.envfile)
Invite Bot to Server
- Go to OAuth2 > URL Generator
- Select scopes: bot and applications.commands
- Select bot permissions:
- Read Messages/View Channels
- Send Messages
- Manage Messages
- Read Message History
- Add Reactions
- Moderate Members (for timeout feature)
- Copy the generated URL and open it in your browser
- Select your server and authorize
Configuration
Environment Variables
Create a.env file in the project root directory:
The
.env file is loaded using python-dotenv in the source code:Channel Configuration
Update channel IDs insource/main.py:
- Enable Developer Mode in Discord (User Settings > Advanced > Developer Mode)
- Right-click on any channel
- Click Copy ID
Bot Settings
Configure core bot behavior insource/main.py:
AI Personality Configuration
ChimBot uses two different personality prompts:The bot automatically switches between personality prompts based on who it’s responding to. Customize these prompts to match your server’s culture.
Groq AI Configuration
ChimBot uses Groq’s LLaMA 3.3 70B model:temperature: 0.7- Balanced creativity and coherencemax_tokens: 256- Keeps responses concisemodel: llama-3.3-70b-versatile- High-quality, fast responses
Running ChimBot
Start the Bot
Run the bot using Python:Expected Output
You should see confirmation that the bot is online:Running as a Background Service
- Linux (systemd)
- Windows (NSSM)
- Screen (Simple)
Create a systemd service file at Enable and start the service:
/etc/systemd/system/chimbot.service:Automated Messaging Setup
Configure the periodic spam system:- Add messages to
mensajes_randomlist - Test with
$testspamcommand - Activate with
$activarspam(admin only)
Verification
Test that everything is working:Troubleshooting
ImportError: No module named 'discord'
ImportError: No module named 'discord'
Install discord.py:
discord.errors.LoginFailure: Improper token
discord.errors.LoginFailure: Improper token
- Verify your
TOKENin.envis correct - Make sure there are no extra spaces or quotes
- Reset your bot token in the Discord Developer Portal if needed
Groq API errors
Groq API errors
- Confirm
GROQ_API_KEYis valid - Check your Groq API quota at console.groq.com
- Ensure you have internet connectivity
Bot can't read messages
Bot can't read messages
Enable the Message Content Intent:
- Go to Discord Developer Portal
- Select your application
- Go to Bot section
- Enable “Message Content Intent” under Privileged Gateway Intents
Timeout/silencing doesn't work
Timeout/silencing doesn't work
The bot needs the “Moderate Members” permission and must have a role higher than the users it’s trying to timeout.
Next Steps
Learn Commands
Explore all available user and admin commands
Configure AI
Customize personality prompts and AI behavior
Spam System
Learn about spam detection and automated messaging
Events Guide
Set up welcome messages and member events