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

reddit: use new find rule type to get all slash-refs in line #1892

Merged
merged 1 commit into from
Jun 19, 2020
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 sopel/modules/reddit.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import requests

from sopel.formatting import bold, color, colors
from sopel.module import commands, example, NOLIMIT, OP, require_chanmsg, rule, url
from sopel.module import commands, example, find, NOLIMIT, OP, require_chanmsg, url
from sopel.tools import time
from sopel.tools.web import USER_AGENT

Expand Down Expand Up @@ -431,7 +431,7 @@ def get_channel_spoiler_free(bot, trigger):
bot.say('%s is flagged as spoilers-allowed' % channel)


@rule(r'.*(?<!\S)/?(?P<prefix>r|u)/(?P<id>[a-zA-Z0-9-_]+)\b.*')
@find(r'(?<!\S)/?(?P<prefix>r|u)/(?P<id>[a-zA-Z0-9-_]+)\b')
def reddit_slash_info(bot, trigger):
searchtype = trigger.group('prefix').lower()
match = trigger.group('id')
Expand Down