A discord game bot written in Python.
The end goal is to get as much money as possible. This is mainly done by selling shoes based on a price that fluctuates globally every few hours (by default 12 hours). The change in price is modelled by a normal distribution with a default mean of 0 and standard deviation of 100.
You can get shoes by a "button event" that runs, by default, every 12 hours. Basically a message would appear with a button that would increment the number of shoes owned. Only a limited number of shoes would be available to be given away per server, which can be set by the event admin.
You can also "mine" ores, which every 24 hours would be exchanged for shoes based on the contribution of a player's ores to total ores in the entire server. The total number of shoes available for giving away in a server can be set by the event admin. So, shoes here would be distributed based on the ores mined for the day.
When running event start or event config...
channelis where the button event message would be sent,giveaway_shoesdenotes number of shoes to giveaway every button event,shoes_oresdenotes number of shoes distributed in total, based on ore reward.
In case you decide to run the bot on your own, follow the below steps:
- Make sure you have Python 3 and PostgreSQL installed.
- Create
config.pyfile in the root directory (i.e. same level asmain.py), with the following lines:
connection_uri = # your postgresql connection uri
token = # your bot token- (Optional) Run
python3 -m venv .venvto create a virtual environment, and runsource .venv/bin/activateto activate it. - Run
pip install -r requirements.txtto install all necessary libraries - If you want, edit the
params.pyaccording to your own likings:
first_price = # first shoe price
mu = # mean, for normal distribution
sd = # standard deviation for normal distribution
PRICE_CHANGE_HRS = # how often the shoe price changes, in hours
VIEW_INTERVAL_HRS = # how often a button event is sent, in hours
EMBED_COLOUR = # embed colour for all embeds, in hex- Run the
db_init.pyfile to initialise the tables and values in the database. - Run the
main.pyfile for starting the bot.
Any suggestions are always welcome, and feel free to report any bugs you encounter.