Jack Reggin

Gameplay Programmer

Jack Reggin

Gameplay Programmer

Dungeon Master - Discord Bot
Language(s) Javascript (NodeJS)
Libraries discord.js, Cloud Firestore
Language(s) Javascript (NodeJS)
Libraries discord.js, Cloud Firestore
This was just a fun little project that I did in my spare time. It was done for a server that I'm an admin in where we had this one voice channel called "HALL OF SHAME" where we'd put people in when they were misbehaving. However, there was no good way to keep people in that channel. So this bot, the Dungeon Master, will control a "dungeon" and keep people there for a certain period of time. You can find the entire source code on my GitLab profile.

Made with NodeJS

I made this app in NodeJS since there was a very easy to use library called discord.js and they had an npm package. I had some previous experience working with NodeJS and figured this was an easy way to go about it (but C# was my second option). This takes use of Node's built in timers, allowing for a callback to be made after a certain duration of time has passed. One drawback of doing it this way is that the code isn't the easiest thing to follow since it goes all over the place with callbacks. If I was do redo this project, I would probably try and structure things more into objects instead of keeping everything in one big file, but it was a good experiment to try it this way.

Using Firebase for Cloud Firestore

Firebase is made by Google for deploying apps within the cloud. It contains a lot of functionality (storage, monitoring, automation, etc.) but I only used it for the database functions within Cloud Firestore. This was extremely easy to setup since there was also an npm package for this so hooking it up was very fast. And the results were instantaneous and reflected in the cloud so I could see them using the web UI. I would like to experiment with this platform further, using it to it's full potentional (since there is also a Unity SDK!).

Deployed on DigitalOcean

I have purchased a server instance on DigitalOcean (known as a droplet). I have installed Ubuntu 16.04 LTS (server) on the instance and am running the bot via a system service. I'm very new to system services and have gotten help from the discord.js community on how to set it up since my initial configuration wasn't working very well. But now it functions and only crashes sometimes!