Add Pterodactyl cog #19
1 changed files with 3 additions and 3 deletions
|
@ -89,7 +89,7 @@ class Pterodactyl(commands.Cog):
|
|||
if content.startswith('['):
|
||||
await channel.send(content=content)
|
||||
#TODO - Add pagification for long messages to prevent Discord API errors
|
||||
chat_message = self.check_if_chat_message(content)
|
||||
chat_message = await self.check_if_chat_message(content)
|
||||
if chat_message:
|
||||
info = await self.get_info(chat_message['username'])
|
||||
if info is not None:
|
||||
|
@ -110,9 +110,9 @@ class Pterodactyl(commands.Cog):
|
|||
#NOTE - https://chat.openai.com/share/d92f9acf-d776-4fd6-a53f-b14ac15dd540
|
||||
return ansi_escape.sub('', text)
|
||||
|
||||
def check_if_chat_message(self, text: str) -> Union[bool, dict]:
|
||||
async def check_if_chat_message(self, text: str) -> Union[bool, dict]:
|
||||
self.logger.debug("Checking if message is a chat message")
|
||||
regex = self.config.chat_regex()
|
||||
regex = await self.config.chat_regex()
|
||||
match: Optional[re.Match[str]] = re.match(regex, text)
|
||||
if match:
|
||||
self.logger.debug("Message is a chat message")
|
||||
|
|
Loading…
Reference in a new issue