From c3fb1d6e5e928ff75bb97fcde3cce29abcdce77b Mon Sep 17 00:00:00 2001 From: Tom Casavant Date: Tue, 16 Apr 2019 20:33:00 -0400 Subject: [PATCH] Fixed error where plugin would check all links containing 'r/' --- maubot.yaml | 2 +- reddit.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/maubot.yaml b/maubot.yaml index 72cd186..179f2a7 100644 --- a/maubot.yaml +++ b/maubot.yaml @@ -9,7 +9,7 @@ maubot: 0.1.0 id: casavant.tom.reddit # A PEP 440 compliant version string. -version: 1.1.0 +version: 1.2.0 # The SPDX license identifier for the plugin. https://spdx.org/licenses/ # Optional, assumes all rights reserved if omitted. diff --git a/reddit.py b/reddit.py index c8992e9..243a741 100644 --- a/reddit.py +++ b/reddit.py @@ -5,7 +5,7 @@ from maubot.handlers import command class RedditPlugin(Plugin): - @command.passive("(r/)([^\s]+)", multiple=True) + @command.passive("(^r\/)([^\s]+)", multiple=True) async def handler(self, evt: MessageEvent, subs: List[Tuple[str, str]]) -> None: await evt.mark_read() subreddits = [] # List of all subreddits given by user