Skip to content
All projects

Discord bot

Torphes

A Discord bot that turns a channel into a Java quiz. Pick a difficulty and a category, answer with a button, and every option - right or wrong - explains itself. A broken question is one click away from being reported.

JavaDiscord

An excuse to find out what the Discord API is like, which spent years as a grab bag: today’s unusual holiday, a daily quote, a leaderboard of who had posted most. In October 2026 I cut it down to one command. The holiday did not disappear - it moved to the Discord bot Ferrio has of its own.

/question draws a random question from a pool of 350, written in Polish. Two optional settings narrow it down: the difficulty - basic, medium or expert - and the category - the Java language, general programming, design patterns, the Java ecosystem or Spring. The answers come shuffled, one per button.

It is a channel game, not a private test. Anyone can click, and the first click settles it for everybody: the right answer turns green and a wrong pick turns red. Every click after that still posts the explanation of the answer clicked, so the wrong options teach something too.

The questions live in a JSON file on my server rather than in the bot, so a new or corrected question does not need a release. A question the bot cannot show properly - more than five answers, since Discord fits five buttons in a row, or anything but exactly one correct answer - is skipped. When one is wrong anyway, the Report button sends me its number and whatever the reporter wrote.

The bot still has no database. A question it has posted is held in memory for two hours so its buttons keep working, and is gone after that or after a restart.