ElHijo-Public contains the scripts for my multifunctional discord bot El Hijo (Code is mostly in spanish, but I'll try to explain everything here as best as I can). I designed El Hijo for my friend's discord server as a fun way to add some administration and entertainment elements to the server. The project that once started as a short 100 lines script that answered you if you typed 'Hi' slowly became a 2000 lines beast with functions like:
- Administration tools for specific server roles
- Personal El Hijo accounts to save bot-person related data
- An investing simulator with fictional stocks to win bot's credits (stored in your account)
- A casino with games to spend bot's credits
- And lots of other commands to enhance the bot's overall capabilities
Sadly, the bot doesn't work anymore due to discord.py library not being supported and the latest discord API changes which, basically, break the traditional system most discord.py bots were using. Despite the bad news, I thought I could upload it here to show how it used to work as someone may find it useful.
El Hijo V7.8.2 was the last update I made. The last patch included all of the following files:
- bot.py (Main file)
- logclass.py (A class with console logging methods)
- mercado.py (Script running in the background to control the investing simulator prices)
- niveles.py (Series of useful functions to edit and check specific values of a personal account)
- database.py (Tool to navigate through my extremely embarrassing txt files based database)
Everything that had to do with the bot's resources or the database wasn't uploaded to the repository
El Hijo used the following modules:
- discord https://pypi.org/project/discord.py/
- subprocess (Default python)
- itertools (Default python)
- colorama https://pypi.org/project/colorama/
- random (Default python)
- time (Default python)
- math (Default python)
- os (Default python)
- io (Default python)
- re (Default python)
Execute the following command in your terminal inside the ElHijo-Public folder:
python3 bot.py
You may also use python2 or simply python depending on your version
Once the bot was on, members of the server could type commands after the prefix '.' such as '.auxilio', which sent a discord embed with a detailed list of all the bot's commands. Other commands like '.admin' or '.mod' granted access to moderation tools for administrators of the server, and those who weren't could use '.perfil' or '.ficha' to check their personal accounts. These accounts stored data such as points, credits or even information about their misdeeds! Administrators could send warnings to these accounts when someone was doing something that they shouldn't. And lastly, the commands '.banco' and '.casino' allowed you to play different games, where you spent the credits won by investing in the simulator to win prizes!
I'm sure I won't be uploading the bot anymore as it would mean to redo most of the code, but at least I will have it here as a piece of educational content for anyone trying to learn python.