Discord : LucasG#8004
Currently working from Canada.
Share this page:
LinkedIn
Facebook
Twitter
WhatsApp
Email
Telegram
After completing the course-project that involved creating a game server in Rust, I wanted to continue working with the language to familiarize myself with all its concepts. My networking professor always had great advice during class, but it was hard to remember everything at once. That’s why I came up with the idea of creating a bot that would automatically post daily messages at a fixed time, sharing a tip of the day on his community Discord.
The project is fairly short, but my primary goal was to explore new aspects of the Rust language while creating a practical tool. I started by listing the features I wanted the bot to include before diving into development. Here’s a brief list:
Once I identified the requirements, I began looking for resources to guide the project (documentation, videos, libraries, etc.). Ultimately, I drew significant inspiration from the Serenity/example GitHub repository, which taught me how to use Serenity (a Rust framework for interacting with the Discord API) and how to structure projects effectively. I also used Tokio for the asynchronous part and Rusqlite for database management.
The bot relies on application commands that are specific to a server and identified by the source that created them (in this case, the bot itself). I chose these commands because they benefit from Discord’s autocomplete feature, making them much easier for users to handle. Below is an example of a command:
Thanks to Discord’s formatting for these commands, users can easily use them with descriptions and help messages available for each command and parameter! Assuming all the commands are clear, a user could operate the bot without even reading the documentation!
For each command, the bot responds with an embedded message informing the user of the command’s result and any actions to take if needed. Below is an example of a response to the “/scheduler info” command:
With the bot’s main feature implemented, I’m glad to have learned how to work with new aspects of Rust, such as database management and using Tokio with the Serenity framework. I think this project has potential if new features are added, and that’s great because the project architecture was designed with expansion in mind!
Who knows? We could add the ability to manage roles through the bot or even handle course-related questions! Stay tuned 🙂
Currently working from Canada.