diff options
author | 2023-03-06 01:10:53 +0200 | |
---|---|---|
committer | 2023-03-05 23:10:53 +0000 | |
commit | 2f813a726fc5e79a043f3d0b94ffb0ce2a1e4497 (patch) | |
tree | f025e26dbf5762d650fe08fb3f3d6dd8c011ea82 | |
parent | Group thread stats under parent channel (#2440) (diff) |
Make sure channel parent isn't None (#2441)
This shouldn't happen, but the type hint says it can so but just in case.
-rw-r--r-- | bot/exts/info/stats.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/bot/exts/info/stats.py b/bot/exts/info/stats.py index 64bff9632..65a4b5b6c 100644 --- a/bot/exts/info/stats.py +++ b/bot/exts/info/stats.py @@ -42,7 +42,7 @@ class Stats(Cog): return channel = message.channel - if hasattr(channel, 'parent'): + if hasattr(channel, 'parent') and channel.parent: channel = channel.parent reformatted_name = CHANNEL_NAME_OVERRIDES.get(channel.id, channel.name) reformatted_name = "".join(char if char in ALLOWED_CHARS else '_' for char in reformatted_name) |