Skip to content

Commit

Permalink
reddit: use new find rule type to get all slash-refs in line
Browse files Browse the repository at this point in the history
  • Loading branch information
dgw committed Jun 16, 2020
1 parent b5a5268 commit a9a9299
Showing 1 changed file with 2 additions and 2 deletions.
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

0 comments on commit a9a9299

Please sign in to comment.