From e3603e8f7d6ae1178248673fc1e4af1d8eb61237 Mon Sep 17 00:00:00 2001 From: croumegous Date: Tue, 3 Jan 2023 01:42:37 +0100 Subject: [PATCH] minor: add documentation on discord env variable to set up and fix shell script to run discord bot --- discord-bot/README.md | 5 ++++- scripts/frontend-development/run-bot-local.sh | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/discord-bot/README.md b/discord-bot/README.md index 1ad99a71..000155ae 100644 --- a/discord-bot/README.md +++ b/discord-bot/README.md @@ -48,7 +48,7 @@ Remember to save your changes. below to invite your bot. ``` -https://discord.com/oauth2/authorize?client_id=YOUR_ID_HERE&permissions=8&scope=bot%20applications.commands +https://discord.com/oauth2/authorize?client_id=YOUR_CLIENT_ID_HERE&permissions=8&scope=bot%20applications.commands ``` ### Environment Setup @@ -66,6 +66,9 @@ pip install -e . cp .env.example .env # edit .env and add your bot token and other values +# BOT_TOKEN is given by the discord developer portal when you create a bot +# DECLARE_GLOBAL_COMMANDS is the id of the server where you added the bot (right click on the server icon and copy id) +# OWNER_ID can be leave as an empty list python -V # 3.10 diff --git a/scripts/frontend-development/run-bot-local.sh b/scripts/frontend-development/run-bot-local.sh index 56833b0a..5228e751 100755 --- a/scripts/frontend-development/run-bot-local.sh +++ b/scripts/frontend-development/run-bot-local.sh @@ -4,6 +4,6 @@ parent_path=$( cd "$(dirname "${BASH_SOURCE[0]}")" ; pwd -P ) # switch to bot directory pushd "$parent_path/../../discord-bot" -python3 __main__.py +python3 -m bot popd