From 236cb1d8154d0208b676232a4f3d03a0bfbbb2a9 Mon Sep 17 00:00:00 2001 From: SeaswimmerTheFsh Date: Thu, 29 Feb 2024 20:43:11 -0500 Subject: [PATCH] fix(pterodactyl): adding debug strings to check_if_chat_message --- pterodactyl/pterodactyl.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/pterodactyl/pterodactyl.py b/pterodactyl/pterodactyl.py index 4112bce..aab394d 100644 --- a/pterodactyl/pterodactyl.py +++ b/pterodactyl/pterodactyl.py @@ -90,6 +90,7 @@ class Pterodactyl(commands.Cog): content = pagify(content, delims=[" ", "\n"]) for page in content: await channel.send(content=page) + chat_message = await self.check_if_chat_message(content) if chat_message: info = await self.get_info(chat_message['username']) @@ -117,12 +118,19 @@ class Pterodactyl(commands.Cog): async def check_if_chat_message(self, text: str) -> Union[bool, dict]: self.logger.debug("Checking if message is a chat message") regex = await self.config.chat_regex() + self.logger.debug('1') match: Optional[re.Match[str]] = re.match(regex, text) + self.logger.debug('2') if match: + self.logger.debug('3') dict = {"time": match.group(1), "username": match.group(2), "message": match.group(3)} + self.logger.debug('4') self.logger.debug("Message is a chat message\n%s", json.dumps(dict)) + self.logger.debug('5') return dict + self.logger.debug('6') self.logger.debug("Message is not a chat message") + self.logger.debug('7') return False async def get_info(self, username: str) -> Optional[dict]: