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)
评论列表
文章目录