NobGit
public imalexnord read

Discord-Hetzner-Bot

No description yet

Languages

Repository composition by tracked source files.

Python
Python 100%
Create file Wiki Documentation
Clone
https://nobgit.com/user/imalexnord/discord-hetzner-bot.git
ssh://[email protected]:2222/user/imalexnord/discord-hetzner-bot.git
main default branch main protected 14 commits 25636c1 Refactor game and Discord bot logic, remove samples

README

Looks like the code is currently broken, I haven't found the time yet to fix it

Discord-Hetzner-Bot

A discord bot to start a hetzner cloud server from a snapshot with the data on a separate volume

Requirements

  • python library hcloud-python
    • instal via pip install hcloud
  • python library discord
    • install via pip install discord

Usage

  • get a API token for the hetzner cloud project
  • get a discord app and create a bot
    • get the bot token
  • create a snapshot with the app data on a separate volume
  • modify the tokens.py and settings.py for your needs

Notes

I recommend the usage of a systemd service unit for the bot itself, because currently the bot tends to stop while waiting for the server creation.
Also I recommend to make sure that the running application/game saves all data before exiting for example with an additional ExecStop line in the service unit which simply executes a sleep command.
The basic idea was a discord bot to start a gameserver when needed.