Creating a Discord Bot

My hilarious journey at creating a discord bot

It’s actually pretty funny how my (discord bot)[https://github.com/jocadbz/denjibot] ended up in the way it is today. If you are confused, let me explain.

I have a discord bot, and it has a pretty extensive set of features. You can have digital coins, trade them with other people, gamble it all, or invert it on the stock market. (Disclaimer: Not actually the stock market.)

But what I really think it’s funny is how it ended up just like it is today. So, today, grab a chair, and listen to me, the story of my Jack Frost bot.

How the hell it was created?

This all happened last year. I joined a server, made a few friends, and it was all shit and giggles. Keep in mind by this time, I already had major experience with python and discord.py, so I was pretty much a knowledgeable guy. So, one day, I jokingly proposed to create a discord bot to just spell “I WANT BOOBS” when ‘boobs’ was mentioned on the server. So I actually did it. For fun.

Well, turns out it got really popular. I kept adding and adding stuff, until it was as 378 lines long.

So, again, for fun, I decided to implement a money system. But there was a problem.

THE PROBLEM

Well, I don’t know shit aboyt databases, nor I’m willing to learn just for a fun side project. So I wondered: How I am going to save folks’s money without a database?

Plain text.

That’s right, plain fucking text. It’s actually funny as fuck how it all works under the wraps.

I have a root profile, called profiles. Inside this folder, every single person who at least spoke in a server with the bot on gets a folder tied to their discord ID. Inside this folder, there is your XP for every server you are, your bio, and of course, your money.

So yeah, every time we do a transaction regarding user’s money, we actually read how much he has (AKA: the file), sums how much we want to give or take for him, and write that stuff again.

The benefits of this? It’s speedy, and allows me to do fun things, like editing other people’s money balance, and stuff like this.

All of those files are on my personal server at home, and not exposed to the internet in any way… Actually, I should prolly do a backup of those.

Anyways, thanks for reading.

Jocadbz's Website

Developer, gamer, and also a fucking idiot


My hilarious journey at creating a discord bot

By Jocadbz, 2024-07-09