aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar MarkKoz <[email protected]>2020-08-25 11:13:56 -0700
committerGravatar MarkKoz <[email protected]>2020-08-25 11:20:35 -0700
commitd53b48b3b370bd87c0c6103cc54fef7a79c24625 (patch)
treeb57b6854bb897662273a8f09c035d1d27ef813ca
parentUse category_id attribute in is_in_category (diff)
Stats: use the is_in_category util function
-rw-r--r--bot/cogs/stats.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/bot/cogs/stats.py b/bot/cogs/stats.py
index d42f55466..7b7470d8d 100644
--- a/bot/cogs/stats.py
+++ b/bot/cogs/stats.py
@@ -7,6 +7,7 @@ from discord.ext.tasks import loop
from bot.bot import Bot
from bot.constants import Categories, Channels, Guild, Stats as StatConf
+from bot.utils.channel import is_in_category
CHANNEL_NAME_OVERRIDES = {
@@ -36,8 +37,7 @@ class Stats(Cog):
if message.guild.id != Guild.id:
return
- cat = getattr(message.channel, "category", None)
- if cat is not None and cat.id == Categories.modmail:
+ if is_in_category(message.channel, Categories.modmail):
if message.channel.id != Channels.incidents:
# Do not report modmail channels to stats, there are too many
# of them for interesting statistics to be drawn out of this.