This is a simple python discord bot that I wrote that allows my friends and I to turn on and off a minecraft server. It works by executing a shell command to launch the server. It can also be used for other servers and applications but I have not tested.
ayyzee 8fad4fb006 Update 'bot.py' | 3 年之前 | |
---|---|---|
LICENSE | 3 年之前 | |
README.md | 3 年之前 | |
bot.py | 3 年之前 |
This is a simple python discord bot that I wrote that allows my friends and I to turn on and off a minecraft server. It works by executing a shell command to launch the server. It can also be used for other servers and applications but I have not tested.
The bot should be autoran at startup on your server. You can use any method
you will need to put your server url or ip where it says "YOURSERVER.COM" And your discord bot API key at the very bottom.
You will need to adjust the command that you want to run when you send the .server_start
command.
the default command is:
cd /home/$USER/ && nohup java -Xmx2048M -Xms2048M -jar server.jar nogui &
you can change the -Xmx and xmx to lower values if your server is low-spec.