Bring any Character.AI persona to life inside Discord — as a real webhook with its name, avatar, and personality.
| 🪝 Webhook Personas | Characters spawn as real Discord webhooks — correct name, avatar, everything. |
| 🔍 Interactive Search | Paginated search UI with image cards directly inside Discord. |
| 🎛️ Follow Modes | Auto (every message) or Reply-only (only when users reply to bot messages). |
| 🔄 Regeneration | Re-roll any tracked bot reply with /regenerate. |
| 💾 Persistent Sessions | Logins and active characters survive bot restarts via session_store.json. |
| 📡 Streaming Replies | Partial message edits show the character "typing" in real time. |
| Command | Description |
|---|---|
/login <email> |
Link your Character.AI account via magic-link email auth |
/logout |
Remove your saved session |
/search <query> |
Search characters, browse results, pick one, choose channel & follow mode |
/spawn <char_id> |
Spawn a character by ID into the current channel |
/chat <message> |
Send a message directly to the active character |
/regenerate [message_id] |
Regenerate the latest tracked reply, or a specific one by message ID |
/despawn |
Remove the active character webhook from this channel |
/delete |
Alias for /despawn |
1. Install dependencies
pip install -r requirements.txt2. Create your environment file
cp .env.example .env3. Add your Discord bot token
DISCORD_TOKEN=your_discord_bot_token_here4. Run the bot
python bot.pyEnable in the Developer Portal:
- ✅ Message Content Intent
Invite scopes:
bot·applications.commands
Required permissions:
Send Messages·Manage Webhooks·Read Message History
The bot tracks a message_id → turn_id mapping for every webhook reply it sends.
/regenerate— targets the most recent tracked reply in the channel/regenerate message_id:<id>— targets a specific tracked webhook reply by Discord message ID
CharacterAI-Discord-Bot/
├── bot.py # Discord slash commands & event loop
├── cai_client.py # Character.AI WebSocket client
├── login.py # Android mobile auth flow
├── recaptcha.py # reCAPTCHA Enterprise solver
├── session_manager.py # Persistent session & channel state
├── webhook_manager.py # Webhook creation, sending, streaming
├── config.py # Environment variable loader
├── requirements.txt
├── .env.example
└── session_store.json # Auto-generated runtime state
Caution
session_store.json contains user auth tokens. Keep it private and out of version control.
- Rotate your Discord bot token immediately if it leaks
- Keep
.envin.gitignore(already included)
Built fully alone by Walter using discord.py · curl_cffi · Character.AI