diff --git a/misc/requirements.txt b/misc/requirements.txt index 400b509..79f5b99 100644 --- a/misc/requirements.txt +++ b/misc/requirements.txt @@ -1,4 +1,5 @@ python-telegram-bot telegram requests -praw \ No newline at end of file +praw +python-twitter \ No newline at end of file diff --git a/schneiderbot_twitter.py b/schneiderbot_twitter.py index 6f81008..723347d 100644 --- a/schneiderbot_twitter.py +++ b/schneiderbot_twitter.py @@ -34,7 +34,7 @@ def check_pepito_and_post_auto(bot, update): api = get_twitter_instance() current_status = api.GetUserTimeline(pepito_id)[0] global last_status - if last_status == None or last_status.AsDict()['id'] != current_status.AsDict()['id']: + if last_status is None or last_status.AsDict()['id'] != current_status.AsDict()['id']: for group_id in pepito_groups: bot.send_message(chat_id=group_id, text=current_status.AsDict()['text']) last_status = current_status diff --git a/web_requests.py b/web_requests.py index 46a44ac..0a80cbf 100644 --- a/web_requests.py +++ b/web_requests.py @@ -26,11 +26,11 @@ def send_coding_love_gif(bot, update): bot.send_animation(chat_id=update.message.chat_id, animation=gif_url, caption=caption) else: - update.message.reply_text("Error fetching image: %s ¯\_(ツ)_/¯" % random_url) + update.message.reply_text("Error fetching image: {} ¯\_(ツ)_/¯".format(random_url)) def send_wiki_how_article(bot, update): random_howto = requests.get(urls["wikihow"]) howto_title = re.search('(.*)', random_howto.text).group(1) - howto_url = re.search('', random_howto.text).group(1) + howto_url = re.search('', random_howto.text).group(1) update.message.reply_text(howto_title + "\n" + howto_url)