aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar MarkKoz <[email protected]>2020-06-03 12:26:27 -0700
committerGravatar MarkKoz <[email protected]>2020-06-14 13:11:32 -0700
commite98100fed8b3c62e337a1c0abeeaee30bc08befa (patch)
tree80ea3a19eb036c38251769c82ae8dba52e8089cf
parentCode block: simplify retrieval of channel ID from payload (diff)
Code block: add stats
* Increment `codeblock_corrections` when instructions are sent * Import our Bot subclass instead of discord.py's
-rw-r--r--bot/cogs/codeblock/cog.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/bot/cogs/codeblock/cog.py b/bot/cogs/codeblock/cog.py
index 20b86eb24..6032e911c 100644
--- a/bot/cogs/codeblock/cog.py
+++ b/bot/cogs/codeblock/cog.py
@@ -4,9 +4,10 @@ from typing import Optional
import discord
from discord import Message, RawMessageUpdateEvent
-from discord.ext.commands import Bot, Cog
+from discord.ext.commands import Cog
from bot import constants
+from bot.bot import Bot
from bot.cogs.token_remover import TokenRemover
from bot.utils import has_lines
from bot.utils.channel import is_help_channel
@@ -114,6 +115,9 @@ class CodeBlockCog(Cog, name="Code Block"):
wait_for_deletion(bot_message, user_ids=(message.author.id,), client=self.bot)
)
+ # Increase amount of codeblock correction in stats
+ self.bot.stats.incr("codeblock_corrections")
+
def should_parse(self, message: discord.Message) -> bool:
"""
Return True if `message` should be parsed.