This repository is an experimental Discord “selfbot” style project that uses LLMs to generate human-like replies (including typing delays) while maintaining simple long-term state (mood/learning/memory) and supporting basic vision (profile-photo/avatars).
“Selfbotting” (running automation on a user account) is a direct violation of Discord’s Terms of Service. Use only for educational purposes on a throwaway/testing account and never on an account you care about.
The bot runs as a logged-in user and attempts to respond when:
- you mention it (direct mention)
- you reply to its message
- it detects relevant group/private chat patterns (with extra analysis)
It also:
- simulates delays (
typing...and short “thinking” wait) - keeps state in
data/*.db(SQLite) for emotions, learning, memory, social closeness, and context - can proactively message on a schedule (see
ProactiveEngine) - supports image/vision when you ask about
profielfoto/pfp/avatar(it loads the referenced avatar and uses the vision model to describe what is visible)
- Python 3.8+
- Dependencies:
pip install -r requirements.txt - Environment variables in
.env(see below)
- Install dependencies:
pip install -r requirements.txt
- Copy env template:
copy .env.example .env
- Fill in
.env:DISCORD_TOKEN: a Discord user token (not a bot token)AI_API_KEY: API key for the configured AI backendAI_MODEL: model name for the configured backend
Optional / advanced (read from code):
AI_BACKEND:groq(default) orollamaOLLAMA_HOST,OLLAMA_MODELwhen usingollamaGOOGLE_MAPS_API_KEY(maps feature; optional)
Main entrypoint:
python src/core/selfbot.pyThe bot also starts a small debug GUI (tkinter) and prints lots of tagged logs like:
[PFP] requested_token=...[AVATAR] Geladen profielfoto van ...[IMAGE THOUGHT] ...[AI RESPONSE] -> '...'
In src/core/selfbot.py there is a hardcoded whitelist:
- an allowed
ALLOWED_GUILD - an allowed
ALLOWED_CHANNEL - a specific
ALLOWED_GROUP_DM
If the bot doesn’t respond, check that you’re messaging in the allowed places (or update those constants in code).
- No responses: verify you’re in the allowed guild/channel or using the mention/reply triggers.
- Vision doesn’t work:
- ensure
AI_API_KEYandAI_BACKENDare set correctly - check logs for
[IMAGE] Vision model:and[IMAGE SCAN]
- ensure
- “weet ik niet / weet niet” answers on pfp questions: the project includes evasiveness guards and retries for avatar questions; watch for
[PFP OVERRIDE]/[PFP RETRY]in the logs.
All memory/state is stored under data/ as SQLite DB files:
data/emotions.dbdata/learning.dbdata/memory.dbdata/social.dbdata/context.dbdata/conversation_analyzer.dbdata/history.db(recent message history)
Do not commit secrets (especially .env) to version control.