From 4a250bd6121c60a6855d648ab3f44c34ce3f763b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sven=20M=C3=A4der?= <maeder@phys.ethz.ch> Date: Tue, 11 Feb 2020 19:44:25 +0100 Subject: [PATCH] Fix ticket number regex --- rt.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/rt.py b/rt.py index f1ba31c..54fb34a 100755 --- a/rt.py +++ b/rt.py @@ -18,8 +18,10 @@ class Config(BaseProxyConfig): class RT(Plugin): prefix: str whitelist: Set[UserID] + api: str + post_data: dict headers = {"User-agent": "maubot-rt"} - regex_number = re.compile(r'[0-9]{6}') + regex_number = re.compile(r'[0-9]+') regex_properties = re.compile(r'([a-zA-z]+): (.+)') regex_history = re.compile(r'([0-9]+): (.+)') regex_entry = re.compile(r'([a-zA-z]+): (.+(?:\n {8}.*)*)', re.MULTILINE) @@ -92,7 +94,7 @@ class RT(Plugin): ticket['Content'] = formatted_content.rstrip() return ticket - @command.passive("((^| )([rR][tT]#?))([0-9]{6})", multiple=True) + @command.passive("((^| )([rR][tT]#?))([0-9]+)", multiple=True) async def handler(self, evt: MessageEvent, subs: List[Tuple[str, str]]) -> None: await evt.mark_read() msg_lines = [] -- GitLab