From dc919a7f7c83bc754e9de338aa54f1e9cd6bcc2c Mon Sep 17 00:00:00 2001 From: Samyak Mishra Date: Mon, 27 May 2024 21:01:29 +0530 Subject: [PATCH] Read bot admin IDs set in .env file --- .env.template | 1 + bot/main.py | 2 ++ 2 files changed, 3 insertions(+) diff --git a/.env.template b/.env.template index 35647c5..f816416 100644 --- a/.env.template +++ b/.env.template @@ -23,6 +23,7 @@ MONGO_URI="mongodb://127.0.0.1:100" # needed by ./bot DISCORD_TOKEN="" +BOT_ADMINS="" # needed by ./portal CAS_LINK="https://cas.my-org.com/login" diff --git a/bot/main.py b/bot/main.py index cefe147..25335c7 100644 --- a/bot/main.py +++ b/bot/main.py @@ -57,6 +57,8 @@ SUBPATH = os.getenv("SUBPATH") BASE_URL = f"{PROTOCOL}://{HOST}{_PORT_AS_SUFFIX}{SUBPATH}" +BOT_ADMINS = {int(id) for id in os.getenv("BOT_ADMINS", "").split(",") if id} + intent = discord.Intents.default() intent.message_content = True bot = commands.Bot(command_prefix=".", intents=intent)