Creating My First Discord Bot
- Cameron Belcher
- Aug 10, 2020
- 2 min read
I had a burst of inspiration recently. I have been playing the video game Temtem and fell in love with it. After some time, I was wanting a more casual way to find information about the temtem rather than going to the wikipedia for the Temtem. Since I use Discord everyday, I decided to take this opportunity to learn other languages (Node.js) as well as learn how to make discord bots in general.
Before I started, I asked around for other users to see what they wanted in a Discord bot. This way the bot could reach a larger base and provide help to people other than myself. I had suggestions like looking up other trainers, a counter for luma encounters, and just an overall temtemdex (what i was already creating). So I gathered up all the requests and started to work.
I first started with the temtem counter because it would be the easiest way to get into Node.js. At the end I separated the three requests into different commands: !temdex, !counter, and !trainers. This way I was able to search what the user wanted to do faster than looking up all the temtem then the trainers then the counter command. I liked to think of it as a tree. This way if I did spread to a lot of servers and got an influx of command request I would be able to do them efficiently.
For the temdex I decided to use a local file system. It was truly a pain to write those files down, but this way I wouldn't have to rely on the webpage to be fully operational to use the bot.
Lastly for the trainers, I also used a text file system. This way a person could create themselves and input their own data from the game. This way I could user their inputs to dynamically create a trainer card instead of having an infinite number of PNG files. This did have some problems though because people could just lie about their information.
In the end, I did have some users that loved the product. But ultimately there wasn't a wide base that was looking for such a bot. I decided to shut the bot down after the bot went under used and my passion for playing the game slowly died down. I loved the whole process of creating the bot til the very end and I'm surely going to make more in the future.
Commentaires