Skip to content
Snippets Groups Projects
Commit 4a250bd6 authored by Sven Mäder's avatar Sven Mäder :speech_balloon:
Browse files

Fix ticket number regex

parent 6f49101e
No related branches found
No related tags found
No related merge requests found
...@@ -18,8 +18,10 @@ class Config(BaseProxyConfig): ...@@ -18,8 +18,10 @@ class Config(BaseProxyConfig):
class RT(Plugin): class RT(Plugin):
prefix: str prefix: str
whitelist: Set[UserID] whitelist: Set[UserID]
api: str
post_data: dict
headers = {"User-agent": "maubot-rt"} 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_properties = re.compile(r'([a-zA-z]+): (.+)')
regex_history = re.compile(r'([0-9]+): (.+)') regex_history = re.compile(r'([0-9]+): (.+)')
regex_entry = re.compile(r'([a-zA-z]+): (.+(?:\n {8}.*)*)', re.MULTILINE) regex_entry = re.compile(r'([a-zA-z]+): (.+(?:\n {8}.*)*)', re.MULTILINE)
...@@ -92,7 +94,7 @@ class RT(Plugin): ...@@ -92,7 +94,7 @@ class RT(Plugin):
ticket['Content'] = formatted_content.rstrip() ticket['Content'] = formatted_content.rstrip()
return ticket 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: async def handler(self, evt: MessageEvent, subs: List[Tuple[str, str]]) -> None:
await evt.mark_read() await evt.mark_read()
msg_lines = [] msg_lines = []
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment