Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 5 additions & 6 deletions bot/exts/info/stats.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,11 @@ async def on_message(self, message: Message) -> None:
# of them for interesting statistics to be drawn out of this.
return

reformatted_name = message.channel.name.replace('-', '_')

if CHANNEL_NAME_OVERRIDES.get(message.channel.id):
reformatted_name = CHANNEL_NAME_OVERRIDES.get(message.channel.id)

reformatted_name = "".join(char for char in reformatted_name if char in ALLOWED_CHARS)
channel = message.channel
if hasattr(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)

stat_name = f"channels.{reformatted_name}"
self.bot.stats.incr(stat_name)
Expand Down