From 1b108428c252fd4a68a5fc5682558737932141be Mon Sep 17 00:00:00 2001 From: nemunaire Date: Thu, 13 Jul 2017 01:21:43 +0200 Subject: [PATCH] Fix issue with some non-text messages --- modules/reddit.py | 2 +- modules/youtube-title.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/reddit.py b/modules/reddit.py index d3f03a1..7d481b7 100644 --- a/modules/reddit.py +++ b/modules/reddit.py @@ -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: diff --git a/modules/youtube-title.py b/modules/youtube-title.py index ebae4b6..fe62cda 100644 --- a/modules/youtube-title.py +++ b/modules/youtube-title.py @@ -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))