Home RotomBot
Post
Cancel

RotomBot

๐Ÿค– RotomBot ๐Ÿ’ฌ

GitHub

June 2020 - Sept 2021

Overview

RotomBot was my first major project written in python, and is one of the most extensive projects I've worked on so far. This project was extremely helpful in learning the differences between C/C++, which I had experience with during college, and python, which I was learning to use for the first time all the way back in the summer of 2020.
Now, that doesn't mean that RotomBot is written poorly, or that it has few features. RotomBot is a Discord bot written specifically to run on a Raspberry Pi Zero W for a server (or guild if you've ever worked on the Discord api) for me and my friends, and serves many different functions, such as a few tools for playing Dungeons and Dragons online, role assignment, and a few admin functions.

Project Purpose

This project's original main purpose was to help familiarize myself with Python, but that project outgrew that goal very quickly. I began working on RotomBot near the beginning of the initial pandemic surge in 2020, so many of its functions came into place due to me and my friends' forced distance from each other.
Although I became extremely confident in writing in Python, this project never truly became busy work as I was challenged to learn new things and processes at every step of the project.
For example, when I first began working on the DDC, essentially a continuous counter that can be incremented or decreased using the bot, I decided it would be best to store the counter in a database. Not only was this just something anyone with a brain would think of, it gave me an opportunity and motivation to learn the intricacies and how to work with databases. Due to this project, I was able to not just become confident in coding in Python, but also with sqLite and database syntax in general.

Pictures of the Project

The Raspberry Pi Zero W that houses RotomBot

RotomBot's On Ready message sent in #general

File Overview

rotombot.py - the main file that runs RotomBot

Completed Objectives

This project has many functions including all of the DnD related commands. For example, there is an initiative tracker, in which any player can add their character and automatically sort them into the initiative based on their roll. Speaking of rolling, RotomBot also has a customizable dice roll command in case you left your dice downstairs and can't find enough energy to unstick yourself from your gamer chair.
RotomBot also has a few admin functions, such as constant checking of a "#pick-roles" channel, where admins can send specific messages, and RotomBot will react to the message. Any user who reacts to the message will recieve the corresponding reaction, and it will be removed when the user removes their reaction.
There are many more functions and specifics, but a more in-depth view of the project's commands can be read in the file overview

Objectives Left Undone

Although I am a firm believer that software is never truly finished, I see RotomBot as a sort of finished project/ living piece of software. This means that although I don't have many remaining plans to continue working on the project, I will not only continue to mainain it and optimize it when necessary, but will continue to work on RotomBot when any new/good ideas come up. One remaining objective would be automatic setup of new database tables on restart, but that's a bridge that I'll worry about crossing later.

Continuing or Running the Project

RotomBot is a relatively easy project to set up, whether to improve on it or just to run it for yourself. Simply make sure you have Python3.9+ installed, download Discord.py v2 from their github, and pip install python-dotenv. Once you do that, put your bot token and guild id into a new `.env` file, set up a new database, and you're all set!
This post is licensed under CC BY 4.0 by the author.