add /queue command

This commit is contained in:
Tomáš Mládek 2019-10-24 14:07:50 +02:00
parent e51f42a32e
commit ef454338ae

View file

@ -111,6 +111,7 @@ class DelojzaBot:
dp.add_handler(CommandHandler("delete", self.tg_delete))
dp.add_handler(CommandHandler("protect", self.tg_protect))
dp.add_handler(CommandHandler("version", self.tg_version))
dp.add_handler(CommandHandler("queue", self.tg_queue))
dp.add_handler(MessageHandler(None, self.tg_handle))
self.acoustid_key = acoustid_key
@ -703,6 +704,13 @@ class DelojzaBot:
else:
update.message.reply_text((self.markov.make_sentence() if self.markov and random() > .7 else "") + "???")
def tg_queue(self, _, update):
if self.tumblr_client:
blog_info = self.tumblr_client.blog_info(self.tumblr_name)
update.message.reply_text("Currently queued tumblr posts: " + str(blog_info['blog'].get('queue', "???")))
else:
update.message.reply_text((self.markov.make_sentence() if self.markov and random() > .7 else "") + "???")
# noinspection PyMethodMayBeStatic
def tg_version(self, _, update):
self._log_msg(update)