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 lat temu
LICENSE 02473775a6 Initial commit 3 lat temu
README.md 0a1073fd42 added to dos 3 lat temu
bot.py 8fad4fb006 Update 'bot.py' 3 lat temu

README.md

minecraft-server-control

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

  • systemd service
  • cron
  • kde-autostart
  • xinitrc

Key in your server detail

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.

Adjust the command

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.

Dependencies

  • mcstatus
  • discord

TO-DO

  • Make telegram variant
  • Make signal variant
  • Make matrix variant