Using $BOG oracles to show live price in a discord bot
- Install python3.8 (or higher) and pip
- Determine your discord server's Guild ID and add to
.envasGUILD_ID=YOURID - For each token you want to track in a bot:
- Create an app on discord: https://discord.com/developers/applications
- Add a bot to the app
- Copy the bot token and add
MY_BOT_TOKEN=YOURTOKENHEREto.envaccording to thediscord_token_keyyou have set in your config.yml - DO NOT COMMIT .env! This would allow anyone to hijack your bots!
- (optional) make a virtualenv:
virtualenv .venv && source .venv/bin/activate - If you are on a cloud provider, you may need:
apt install python3.8-dev build-essential pip install -r requirements.txt
python bot.py
(note: on a cloud provider you may want to use nohup to ensure the bot continues running
after you have disconnected, but a future release here will include upstart documentation)
The discordbot can also be installed as an auto-restarting service in systemd:
sudo cp ~/path/to/existing/BOGOracle-Examples-DiscordBot /opt/BOGOracle-Examples-DiscordBotsudo chown youruser:youruser /opt/BOGOracle-Examples-DiscordBotsudo cp /opt/BOGOracle-Examples-DiscordBot/systemd/bog-discord-bot.service /etc/systemd/system/bog-discord-bot.servicesudo systemctl start bog-discord-bot- Confirm it is running:
sudo systemctl status bog-discord-bot