scdlbot.py 文件源码

python
阅读 19 收藏 0 点赞 0 评论 0

项目:scdlbot 作者: gpchelkin 项目源码 文件源码
def help_command_callback(self, bot, update):
        self.init_chat(update.message)
        event_name = "help"
        entities = update.message.parse_entities(types=[MessageEntity.BOT_COMMAND])
        for entity_value in entities.values():
            event_name = entity_value.replace("/", "").replace("@{}".format(self.bot_username), "")
            break
        self.log_and_botan_track(event_name, update.message)
        chat_id = update.message.chat_id
        chat_type = update.message.chat.type
        reply_to_message_id = update.message.message_id
        flood = self.chat_storage[str(chat_id)]["settings"]["flood"]
        if chat_type != Chat.PRIVATE and flood == "no":
            self.rant_and_cleanup(bot, chat_id, self.RANT_TEXT_PUBLIC, reply_to_message_id=reply_to_message_id)
        else:
            bot.send_message(chat_id=chat_id, text=self.HELP_TEXT,
                             parse_mode='Markdown', disable_web_page_preview=True)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号