Wordlebot
A Discord bot that lets users play Wordle collaboratively in a discord channel, or privately by direct messaging the bot. It was written in C# and utilizes Firebase for persistent data storage.
Objective
To write a Discord implementation of the popular game Wordle! which can keep track of stats, let multiple people guess at the same time, be added to any Discord server and utilize Firebase as the backend.
API’s used
- C# wrapper API DSharpPlusPlus
- Google Firebase NoSQL datastore
Basic Layout
When a new Wordle is started, the bot will send a message with an embed for the guesses, and one for the keyboard. As guesses come in, those messages get edited to reflect the result.
Solving
Wordles can be solved collaboratively or individually - each player's guess is recorded, and the person to guess the correct word gets their avatar framed and their statistics displayed. The scores are stored in a Firestore database on a per-channel basis, allowing different channels to have different word categories to choose from. This was mostly done to allow for flexibility in word lists (such as supporting multiple languages) but also because some word lists might be much harder than others.
Popularity & Usage
The bot is publicly available, and usually has about 20 Wordles active concurrently. The monthly reads and writes are still well below the free tier threshold of a Firebase project, and I've made sure to optimize any reads and writes to the database to only occur where necessary, while still having a reasonably up to date local cache.