aboutsummaryrefslogtreecommitdiffstats
path: root/bot/bot.py
diff options
context:
space:
mode:
authorGravatar Shivansh-007 <[email protected]>2021-03-02 15:51:56 +0530
committerGravatar Shivansh-007 <[email protected]>2021-03-02 15:51:56 +0530
commit167774ea84ec528845a17d41065983e3ef696d12 (patch)
tree7ffe100a56da8665d2b257ca3da0c774cb39b14f /bot/bot.py
parentMerge pull request #482 from WillDaSilva/startup-channel-check (diff)
Fix Channel Check to use channel ids instead of channel objects, and skip channel check if debug is true
Diffstat (limited to 'bot/bot.py')
-rw-r--r--bot/bot.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/bot/bot.py b/bot/bot.py
index 81d59706..176422aa 100644
--- a/bot/bot.py
+++ b/bot/bot.py
@@ -74,11 +74,16 @@ class Bot(commands.Bot):
async def check_channels(self) -> None:
"""Verifies that all channel constants refer to channels which exist."""
await self.wait_until_guild_available()
- all_channels = set(self.get_all_channels())
+
+ if constants.Client.debug:
+ log.info("Skipping Channels Check.")
+ return
+
+ all_channels_ids = [channel.id for channel in set(self.get_all_channels())]
for name, channel_id in vars(constants.Channels).items():
if name.startswith('_'):
continue
- if channel_id not in all_channels:
+ if channel_id not in all_channels_ids:
log.error(f'Channel "{name}" with ID {channel_id} missing')
async def send_log(self, title: str, details: str = None, *, icon: str = None) -> None: