Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changed re.match to re.search() in _handle_post() and _handle_webhook() #290

Merged
merged 1 commit into from
Feb 27, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions mmpy_bot/event_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ async def _handle_post(self, post):
# the rest.
tasks = []
for matcher, functions in self.message_listeners.items():
match = matcher.match(message.text)
match = matcher.search(message.text)
if match:
groups = list([group for group in match.groups() if group != ""])
for function in functions:
Expand All @@ -108,7 +108,7 @@ async def _handle_webhook(self, event: WebHookEvent):
# handle the rest.
tasks = []
for matcher, functions in self.webhook_listeners.items():
match = matcher.match(event.webhook_id)
match = matcher.search(event.webhook_id)
if match:
for function in functions:
# Create an asyncio task to handle this callback
Expand Down