diff --git a/telegrambot.py b/telegrambot.py index a89f0b4..8b0f69b 100755 --- a/telegrambot.py +++ b/telegrambot.py @@ -116,7 +116,7 @@ def explicitTweet(bot, update, args, reply = None): two = getTwo(update.message) if update.message.photo or update.message.document or update.message.video or update.message.sticker: - fid = update.message.document.file_id if update.message.document.file_id else update.message.sticker.file_id if update.message.sticker else update.message.video.file_id if update.message.video else update.message.photo[-1].file_id + fid = update.message.document.file_id if update.message.document else update.message.sticker.file_id if update.message.sticker else update.message.video.file_id if update.message.video else update.message.photo[-1].file_id path = bot.getFile(fid).file_path media = urllib.request.urlopen(path) mobj = io.BytesIO(media.read()) @@ -238,7 +238,7 @@ if __name__ == "__main__": updater.dispatcher.add_handler(telegram.ext.CommandHandler("retweet", retweet, pass_args=True)) updater.dispatcher.add_handler(telegram.ext.CommandHandler("start", start)) updater.dispatcher.add_handler(telegram.ext.CommandHandler("test", test, pass_args=True)) - updater.dispatcher.add_handler(telegram.ext.CommandHandler("timeline", timeline)) + updater.dispatcher.add_handler(telegram.ext.CommandHandler("timeline", timeline, pass_args=True)) updater.dispatcher.add_handler(telegram.ext.CommandHandler("toggletweet", toggleTweet)) updater.dispatcher.add_handler(telegram.ext.CommandHandler("tweet", explicitTweet, pass_args=True)) updater.dispatcher.add_handler(telegram.ext.CommandHandler("unauth", unauth))