From 58e33b1b3dbf623ac4e7796a392dd8446b809744 Mon Sep 17 00:00:00 2001 From: Chris Lovering Date: Sun, 20 Feb 2022 12:20:24 +0000 Subject: Don't call bot.run() if IN_CI env var is set --- bot/__main__.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'bot/__main__.py') diff --git a/bot/__main__.py b/bot/__main__.py index 6889fe2b..0bf7b398 100644 --- a/bot/__main__.py +++ b/bot/__main__.py @@ -12,4 +12,5 @@ bot.add_check(whitelist_check(channels=WHITELISTED_CHANNELS, roles=STAFF_ROLES)) for ext in walk_extensions(): bot.load_extension(ext) -bot.run(Client.token) +if not Client.in_ci: + bot.run(Client.token) -- cgit v1.2.3 From aeb8c6faca0108aa1771bd279b2a7e569ce71bc4 Mon Sep 17 00:00:00 2001 From: Chris Lovering Date: Sun, 28 Aug 2022 16:34:39 +0100 Subject: Add 1<<15 to the raw intents value 1<<15 is the flag for message content intent, so adding this value to the intents value hard codes that to always be enabled. Doing it this way also bypasses the need to patch the flags themselvse in discord.py. This is required until https://github.com/python-discord/sir-lancebot/pull/1092 is merged. --- bot/__main__.py | 3 +++ 1 file changed, 3 insertions(+) (limited to 'bot/__main__.py') diff --git a/bot/__main__.py b/bot/__main__.py index 0bf7b398..bd6c70ee 100644 --- a/bot/__main__.py +++ b/bot/__main__.py @@ -13,4 +13,7 @@ for ext in walk_extensions(): bot.load_extension(ext) if not Client.in_ci: + # Manually enable the message content intent. This is required until the below PR is merged + # https://github.com/python-discord/sir-lancebot/pull/1092 + bot._connection._intents.value += 1 << 15 bot.run(Client.token) -- cgit v1.2.3