diff --git a/delojza.py b/delojza.py index 2e89082..d782886 100755 --- a/delojza.py +++ b/delojza.py @@ -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)