1
0
Fork 0

Fix issue with some non-text messages

This commit is contained in:
nemunaire 2017-07-13 01:21:43 +02:00
parent 08a7701238
commit 1b108428c2
2 changed files with 2 additions and 2 deletions

View File

@ -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:

View File

@ -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))