A Discord bot that restarts a Docker container via Portainer.
Configure the bot via the variables defined in the .env
file.
DISCORD_TOKEN=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx PORTAINER_USER=username PORTAINER_PASS=password PORTAINER_URL=http://example.com:9000/ CONTAINER_ID=yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy RESTART_TRIGGER=restart the container DISCORD_TEST_TRIGGER=>** discordtest DISCORD_TEST_RESPONSE=Hello, Discord!
python3 ./restarterbot.py
Say the $RESTART_TRIGGER phrase in any channel the bot is in, or via DM, to restart your container.