From dc06ec1d206a071a9b8773b993d5ec141c45ae0b Mon Sep 17 00:00:00 2001 From: lauralani Date: Mon, 1 Jan 2024 19:31:29 +0100 Subject: [PATCH] update documentation --- .../config.example.py | 8 +++- example/discord-bot.service | 13 ++++++ readme.md | 43 +++++++++++++++++++ 3 files changed, 63 insertions(+), 1 deletion(-) rename config.example.py => example/config.example.py (58%) create mode 100644 example/discord-bot.service create mode 100644 readme.md diff --git a/config.example.py b/example/config.example.py similarity index 58% rename from config.example.py rename to example/config.example.py index e445c6b..08f0890 100644 --- a/config.example.py +++ b/example/config.example.py @@ -1,11 +1,14 @@ config = { "bot": { - + # Get the token by doing https://discordpy.readthedocs.io/en/stable/discord.html + # we need (privileged) Message Content Intent and the Send Message Bot permission "token": "aslkjdasjldjsaldjasl", + # Channel-ID of whitelisted Channels "channels": [ 12873281371823821328193, # laura lol, bot-test 21302918421093801832 # LiLa Network Clubhaus, game-control ], + # Username of people that are whitelisted to send commands "whitelist": [ "username" ] @@ -13,8 +16,11 @@ config = { }, "games": [ { + # Display name "displayname": "Minecraft Vanilla Server", + # slug is used in the actual chat commands "slug": "mc-v", + # systemd service name that you would use in 'sytemctl restart xyz' "systemd": "minecraft-vanilla01.service" }, { diff --git a/example/discord-bot.service b/example/discord-bot.service new file mode 100644 index 0000000..1bddc93 --- /dev/null +++ b/example/discord-bot.service @@ -0,0 +1,13 @@ +[Unit] +Description=Game Discord Bot by Adora +After=multi-user.target + +[Service] +Type=simple +Restart=always +WorkingDir=/games/discord-bot +ExecStart=/games/discord-bot/venv/bin/python3 ./app.py + +[Install] +WantedBy=multi-user.target + diff --git a/readme.md b/readme.md new file mode 100644 index 0000000..1cc0bbb --- /dev/null +++ b/readme.md @@ -0,0 +1,43 @@ +# game-bot +This is a Bot by @lauralani to let her friends start, stop and display the status of various game servers. + +## Prerequisites +Get the Discord Bot token by following this guide https://discordpy.readthedocs.io/en/stable/discord.html + +Discord privileges needed: +Privileged Permissions: +- Message Content +Bot Permissions: +- Send Message Bot permission + +## Installation +```bash +# clone this repo +cp example/config.example.py config.py + +# edit and fill config.py +python3 -m venv venv +source venv/bin/activate +pip3 install -r requirements.txt + +python3 app.py +``` + +For setting this bot up as a systemd service, you can take a look at the +systemd service file in the example directory. + +## Features +- modular configuration of services/game servers +- use chat commands in DM and in channels + +## Commands +The bot has the following commands: +- __help__: Get help for the commands +- __info__: List all available games, their status and their _<slug>_ +- __start__ _<slug>_: Start game with slug _<slug>_ +- __stop__ _<slug>_: Stop game with slug _<slug>_ +- __restart__ _<slug>_: Stop game with slug _<slug>_ +- __status__ _<slug>_: Show status for game with slug _<slug>_ + +## License +`discord-bot` is available under the MIT license. See the [LICENSE](LICENSE) file for more info. \ No newline at end of file