From 0e4ba13166dd1ffe5b9b52d2c810f734c782df1b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Ml=C3=A1dek?= Date: Wed, 1 May 2019 10:52:14 +0200 Subject: [PATCH] add a TUMBLR_NOW special hashtag for direct tumblr posting --- delojza.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/delojza.py b/delojza.py index 428750a..43ef9c2 100755 --- a/delojza.py +++ b/delojza.py @@ -14,6 +14,7 @@ import markovify import mutagen.id3 import pytumblr import requests +import telegram import youtube_dl from telegram import MessageEntity from telegram.ext import Updater, CommandHandler, MessageHandler, Filters @@ -185,6 +186,11 @@ class DelojzaBot: message.reply_text('(btw, queueing to tumblr)') for filename in filenames: self.client.create_photo('kunsaxan', state="queue", data=filename) + elif hashtag == 'TUMBLR_NOW' and self.client: + message.reply_text('(btw, ***FIRING TO TUMBLR RIGHT AWAY***)', + parse_mode=telegram.ParseMode.MARKDOWN) + for filename in filenames: + self.client.create_photo('kunsaxan', state="published", data=filename) return filenames except: _, exc_value, __ = sys.exc_info()