How tejastice/ai-keisuke works
AI けいすけ is a Discord bot whose main workflow starts with a user reacting to a message or attachment in an activated channel, then returns an AI-generated result in Discord. The README documents six reaction-based capabilities, premium limits, custom prompts, and statistics; the sampled source excerpts show prompt-file loading and portions of the X-post flow. The implementation is concentrated in main.py, so several responsibilities share that path. Other internal dispatch and integration details are not shown in the excerpts.
Main entry points: main.py Bot runtime · user_data User data · activity_logs Activity logs · x_post.txt X prompt
Components 19
Discord interaction
- Discord
- Bot runtime
main.py
AI generation
- X post
main.py - Transcription
main.py - AI explanation
main.py - Praise message
main.py - Obsidian memo
main.py - Structured article
main.py
Plans and statistics
- Plan and usage checks
main.py - Usage statistics
main.py - User data
data/user_data - Activity logs
data/activity_logs
Prompt assets
- X prompt
prompt/x_post.txt - Explanation prompt
prompt/question_explain.txt - Praise prompt
prompt/heart_praise.txt - Memo prompt
prompt/pencil_memo.txt - Article prompt
prompt/article.txt
Other components
- Discord user
- OpenAI API
Connections 23
- Discord user → Discord: reacts
README.md - Discord → Bot runtime: delivers interaction
README.md - Bot runtime → X post: dispatches
README.md - Bot runtime → Transcription: dispatches
README.md - Bot runtime → AI explanation: dispatches
README.md - Bot runtime → Praise message: dispatches
README.md - Bot runtime → Obsidian memo: dispatches
README.md - Bot runtime → Structured article: dispatches
README.md - X post → OpenAI API: generates with
README.md - Transcription → OpenAI API: transcribes with
README.md - AI explanation → OpenAI API: explains with
README.md - Praise message → OpenAI API: generates with
README.md - Obsidian memo → OpenAI API: generates with
README.md - Structured article → OpenAI API: generates with
README.md - X post → X prompt: reads prompt
main.py - AI explanation → Explanation prompt: reads prompt
- Praise message → Praise prompt: reads prompt
- Obsidian memo → Memo prompt: reads prompt
main.py - Structured article → Article prompt: reads prompt
main.py - Bot runtime → Plan and usage checks: enforces limits
README.md - Plan and usage checks → User data: updates usage
README.md - Bot runtime → Usage statistics: collects activity
README.md - Usage statistics → Activity logs: reads and writes
README.md