__init__.py 文件源码

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

项目:ehForwarderBot 作者: blueset 项目源码 文件源码
def suggested_recipient(self, bot, chat_id, msg_id, param):
        storage_id = "%s.%s" % (chat_id, msg_id)
        if param.startswith("chat "):
            update = telegram.update.Update.de_json(self.msg_storage[storage_id]["update"], bot)
            chat = self.msg_storage[storage_id]['chats'][int(param.split(' ', 1)[1])]
            self.process_telegram_message(bot, update, channel_id=chat['channel_id'], chat_id=chat['chat_uid'])
            bot.edit_message_text("Delivering the message to %s%s %s: %s." % (chat['channel_emoji'],
                                                                              utils.Emojis.get_source_emoji(chat['type']),
                                                                              chat['channel_name'],
                                                                              chat['chat_name'] if not chat['chat_alias'] or chat['chat_alias'] == chat['chat_name'] else "%s (%s)" % (chat['chat_alias'], chat['chat_name'])),
                                  chat_id=chat_id,
                                  message_id=msg_id)
        elif param == Flags.CANCEL_PROCESS:
            bot.edit_message_text("Error: No recipient specified.\n"
                                  "Please reply to a previous message.",
                                  chat_id=chat_id,
                                  message_id=msg_id)
        else:
            bot.edit_message_text("Error: No recipient specified.\n"
                                  "Please reply to a previous message.\n\n"
                                  "Invalid parameter (%s)." % param,
                                  chat_id=chat_id,
                                  message_id=msg_id)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号