From 34e0799c4125c8231e18c8b04dd592004a4c1b12 Mon Sep 17 00:00:00 2001 From: Joseph Montanaro Date: Mon, 28 Dec 2020 20:21:35 -0800 Subject: [PATCH] add readme --- README.md | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..8b4176b --- /dev/null +++ b/README.md @@ -0,0 +1,39 @@ +# Minebot + +Discord bot for controlling a Heavynode minecraft server. + +Currently implemented commands: + +* `!add` - adds a player to the whitelist +* `!remove` - removes a player from the whitelist + +# Developing + +This bot is built on [discord.py](https://discordpy.readthedocs.io/en/latest/), a Python library for Discord bots. +Discord.py makes heavy use of asynchronous Python (via the [asyncio](https://docs.python.org/3/library/asyncio.html) module). +It's worth a look if you've never experimented with that side of Python. + +# Running + +To run the bot, first install its dependencies: + +```sh +pip install discord.py 'python-socketio>=4.0,<5.0' +``` + +It also expects the following environment variables: + +* `DISCORD_TOKEN`: Discord API token +* `DISCORD_SERVER_ID` (Optional, may be excluded if the bot is only joined to one server) +* `HEAVYNODE_TOKEN`: Heavynode API token +* `HEAVYNODE_COOKIE_NAME`: Name of Heavynode `remember_web` cookie +* `HEAVYNODE_COOKIE_VALUE`: Value of Heavynode `remember_web` cookie + +Any of these items may be read from a file instead of the environment, by appending `_FILE` to the environment variable +and setting its value to the path of the file. E.g. `export DISCORD_TOKEN_FILE=/path/to/token/file` + +You can then run the bot directly: + +```sh +python bot.py +```