Teunis WoordSoftware Developer

Project 02 · Personal

Ledger
Discord Bot

A Discord bot with quotes, timezones, daily posts and a few games. Each server keeps its own data in SQLite.

Year
2024
Type
Discord bot
Status
Personal project
Interface
Slash commands
Screenshot of the Ledger Discord Bot
Ledger running in a Discord server.

01 Context

Ledger is a Discord bot I wrote in Python with discord.py. Everything works through slash commands, so you can see what it can do just by typing a /. Each server gets its own data in a SQLite database: saved quotes, its timezone, and how far everyone got in today's games. Every feature is a separate module, so I can add something new without breaking the rest.

02 What it does

  • Quotes: save, find, list and delete quotes from the server.
  • Timezones: set a timezone for the server and see the time in other places. Daylight saving is handled for you.
  • Daily posts: a quote every day, with an optional countdown to a date.
  • Word games: Wordle and Linkle inside Discord. Your progress for the day is saved.
  • Small stuff: ping, uptime, server info, dice, a coin flip and an 8-ball.

03 Command reference

Quotes
CommandDescription
/quote_add [quote]Saves a new quote to the server database.
/quote_randomReturns a random stored quote.
/quote_listDisplays the most recently added quotes.
/quote_search [text]Searches quotes containing specific keywords.
/quote_delete [id]Deletes a quote by its ID.
Timezone
CommandDescription
/timezone_set [tz]Sets the server's primary timezone, with autocomplete and common abbreviations (CET, UTC).
/timezoneShows the server time next to a list of other timezones.
Daily posts
CommandDescription
/gandhi_startStarts daily quote posts in the current channel at 14:00 UTC.
/gandhi_stopStops daily quote posts for the server.
/countdown start [reason] [date]Adds a daily countdown to a date alongside the post.
/countdown stopStops the active countdown.
Games
CommandDescription
/wordlePlay today's Wordle: six tries, state persists per user per day.
/wordle_resetResets your Wordle progress for today.
/linklePlay today's Linkle: find the hidden word from compound-word clues.
Utility & fun
CommandDescription
/pingChecks the bot's current latency.
/uptimeDisplays how long the bot has been running.
/serverinfoShows basic information about the server.
/userinfo [user]Displays account and server information about a user.
/roll [NdM]Rolls dice using NdM notation (e.g. 2d6, 1d20).
/coinflipFlips a virtual coin.
/choose [options]Chooses randomly from multiple options.
/rate [thing]Rates something on a scale from 1 to 10.
/8ball [question]Gives a random Magic 8-Ball answer.

04 Stack

Python discord.py SQLite python-dotenv ZoneInfo
Back to index