diff --git a/extensions/pcp.py b/extensions/pcp.py index d239fee..4a3b1b8 100644 --- a/extensions/pcp.py +++ b/extensions/pcp.py @@ -9,7 +9,7 @@ from administrator.logger import logger extension_name = "PCP" logger = logger.getChild(extension_name) -group_re = re.compile(r"(G[0-9]S[0-9]|ASPE|LP DEVOPS2?|LP ESSIR|LP SID)") +group_re = re.compile(r"(G[0-9]S[0-9]|ASPE|LP DEVOPS|LP ESSIR|LP SID)") msg_url_re = re.compile(r"https://.*discord.*\.com/channels/[0-9]+/([0-9+]+)/([0-9]+)") role_mention_re = re.compile(r"<@&[0-9]+>") user_mention_re = re.compile(r"<@![0-9]+>") diff --git a/extensions/utils.py b/extensions/utils.py index cfe2af7..1a6365b 100644 --- a/extensions/utils.py +++ b/extensions/utils.py @@ -39,9 +39,15 @@ class Utils(commands.Cog): command = ctx.message.content[start+3:end] try: exec("async def __ex(self, ctx):\n" + command.replace("\n", "\n ")) - await ctx.send(await locals()["__ex"](self, ctx)) + out = str(await locals()["__ex"](self, ctx)) + if len(out) > 1994: + while out: + await ctx.send(f"```{out[:1994]}```") + out = out[1994:] + else: + await ctx.send(f"```{out}```") except Exception as e: - await ctx.send(f"{e.__class__.__name__}: {e}") + await ctx.send(f"```{e.__class__.__name__}: {e}```") @commands.group("ping", pass_context=True) async def ping(self, ctx: commands.Context):