Fix issue with some non-text messages
This commit is contained in:
parent
08a7701238
commit
1b108428c2
|
@ -79,7 +79,7 @@ def parselisten(msg):
|
|||
def parseresponse(msg):
|
||||
global LAST_SUBS
|
||||
|
||||
if hasattr(msg, "text") and msg.text:
|
||||
if hasattr(msg, "text") and msg.text and type(msg.text) == str:
|
||||
urls = re.findall("www.reddit.com(/\w/\w+/?)", msg.text)
|
||||
for url in urls:
|
||||
for recv in msg.to:
|
||||
|
|
|
@ -82,7 +82,7 @@ def parselisten(msg):
|
|||
@hook.post()
|
||||
def parseresponse(msg):
|
||||
global LAST_URLS
|
||||
if hasattr(msg, "text") and msg.text:
|
||||
if hasattr(msg, "text") and msg.text and type(msg.text) == str:
|
||||
urls = re.findall("([a-zA-Z0-9+.-]+:(?://)?[^ :]+)", msg.text)
|
||||
for url in urls:
|
||||
o = urlparse(_getNormalizedURL(url))
|
||||
|
|
Loading…
Reference in New Issue