Remove legacy msg.text
This commit is contained in:
parent
a29325cb19
commit
e70a7f4fe0
7 changed files with 38 additions and 17 deletions
|
|
@ -71,8 +71,15 @@ def cmd_subreddit(msg):
|
|||
|
||||
@hook.message()
|
||||
def parselisten(msg):
|
||||
parseresponse(msg)
|
||||
return None
|
||||
global LAST_SUBS
|
||||
|
||||
if hasattr(msg, "message") and msg.message and type(msg.message) == str:
|
||||
urls = re.findall("www.reddit.com(/\w/\w+/?)", msg.message)
|
||||
for url in urls:
|
||||
for recv in msg.to:
|
||||
if recv not in LAST_SUBS:
|
||||
LAST_SUBS[recv] = list()
|
||||
LAST_SUBS[recv].append(url)
|
||||
|
||||
|
||||
@hook.post()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue