Quark — A Discord Bot That Guesses What You Are Thinking Of
Five Python files, one library doing the real work, and all the difficulty in the Discord-shaped part.
The problem
Akinator's elimination algorithm is a solved problem with a published Python package, so the interesting question was never the guessing. It was how to drive a stateful question-and-answer loop inside a Discord conversation, keep twenty questions legible in a chat feed, and ship a long-lived bot process without a web server anywhere in it.
The solution
Wrap the `akinator.py` package in a `discord.py` cog that owns only the interaction. The library decides when it is confident enough to guess; the bot keeps asking until it does, reading four possible answers — yes, no, probably, and back — from a list membership test. Two cogs load into one client, the game and a much smaller hosted-chatbot command, and the whole thing deploys as a Heroku `worker` because the only way in is the Discord gateway.
Outcomes
- Drives the `akinator.py` elimination library from inside a Discord cog, so the bot's own logic is just the conversation.
- Loops on the library's `progression` rather than a fixed question count, so the game ends when Akinator is confident rather than on a schedule.
- Four-way input handling — yes, no, probably and back — which is what makes `b` (go back a question) possible at all.
+3 more in the write-up
Inside the write-up
- This is a small project, and that is the honest framing
- The whole game is a library call
- Two cogs, one bot
- Deployed as a Heroku worker
- What I would fix first