diff --git a/strings.py b/strings.py index f7bd2fa..2c81238 100644 --- a/strings.py +++ b/strings.py @@ -27,6 +27,10 @@ After authentication, you will be able to tweet from your account. Just drop me Additionally, you will be able to use the following commands: +* /like TWEET - Like a tweet. You will need to pass a tweet ID (TWEET) as returned by /timeline. +* /reply TWEET TEXT - Reply TEXT to a tweet. You will need to pass a tweet ID (TWEET) as returned by /timeline. +* /retweet TWEET - Retweet a tweet. You will need to pass a tweet ID (TWEET) as returned by /timeline. +* /timeline - Shows you the latest tweets in your timeline. Returns 10 tweets by default, but you may also use it like /timeline 20, which would return 20 tweets. * /toggletweet - Turn automatic tweeting of messages on/off. Useful in groups. * /tweet TEXT - Explicitly tweet TEXT even if automatic tweeting is off (/toggletweet). * /unauth - Revoke your authenticaton and stop using %s. diff --git a/telegrambot.py b/telegrambot.py index e16d336..5f2d326 100755 --- a/telegrambot.py +++ b/telegrambot.py @@ -1,6 +1,6 @@ #!/usr/bin/env python3 -import ast, dbtools, io, logging, PIL.Image, setuptools, strings, telegram.ext, twitools, urllib.request, tweepy +import ast, dbtools, html, io, logging, PIL.Image, setuptools, strings, telegram.ext, twitools, urllib.request, tweepy logging.basicConfig(format='%(asctime)s - %(name)s - %(levelname)s - %(message)s', level=logging.INFO) logger = logging.getLogger(__name__) @@ -176,7 +176,7 @@ def timeline(bot, update, args = [10]): for status in two.api.home_timeline(count=count): db.executeQuery("INSERT INTO timelines VALUES(%i, %i, %i);" % (update.message.chat_id, i, status.id)) - update.message.reply_text("Tweet %i:\n%s (@%s) at %s:\n%s" % (i, status.author.name, status.author.screen_name, status.created_at, status.text)) + update.message.reply_text("Tweet %i:\n%s (@%s) at %s:\n%s" % (i, status.author.name, status.author.screen_name, status.created_at, html.unescape(status.text))) i += 1 except tweepy.error.TweepError as e: