discord, yes the discord we all love.
This is just the web app
Download STAR web
This is just the discord bot
Down STAR bot
This has both the web app and the bot
DOwnload STAR complete
Once you have downloaded the tar.gz extract it into a folder
Your direcory structure will look something like this
We will get back to this
Next step is installing redis
Redis is most probably in your distribution's package manager
If you do not find it in your distribution's package manager you can always get it from it's websitehttp://redis.io
While that is happening lets go to the next step
Make sure you are running python3.x
If you are running some kind of virtual environment now is the time to be in it.
That will install all the requirements.
If you have are planning on using the bot you need to get a api_key from discord for you bot it's pretty simple.
How to make a discord bot. This post explains step by step how to get an api key for your discord bot.
Once you have the api key put it in the.env file
We are one step away from deployment
if you open up the main.py file you will find this
This is where you drop the code you want to run
You can put multiple functions in the file, main can call other functions or files, basically any valid python3.x function will work.
Once you put in the code lets get to the tricky part, say you are writing a monte carlo simulation to calculate the ratio of are under the inside a quarter of the circle and the square
Do not worry if you do not understand the math, this is about the parameters and the functions. Your code will look something like this.
Now we will be using type annotation on our main function's parameters. Which basically means that we will write the type of the parameters in front of the paramter like so.
and we are done, now to deployment
Open up a terminal and go in the folder where the file was extracted and run thedeploy.sh bash script
If everything goes right and you have some luck on your side you will see a stream of text flowing ignore it. In about 10 seconds that will have been deployed.
If you are running the web app it will be hosted athttp://localhost:8000/
If you downloaded the bot as well then open up discord and your server and type inhelp it will guide you through the commands on how to use it.