带有 Python 的电报机器人:嵌套对话中无法识别map_to_parent状态



我的子 convo 不会转移到父 convo。似乎map_to_parent的关键没有被识别?它只是在子会议结束后停止。我在这里做错了什么?

我也收到此警告:

UserWarning: Handler returned state methodchoiceend which is unknown to the ConversationHandler.

这是一个mwe:https://pastebin.com/pnve9gke

我在您链接的示例中看到了两个问题:

  1. method_convo_handlercount_convo都用作另一个ConversationHandler中的嵌套对话,并通过dispatch.add_handler直接添加。这势必会干扰。
  2. return METHODCHOICEEND用于done_method,而又用于count_convo.count_convo没有map_to_parent.

顺便说一句,如果您通过相应的参数为您的ConversationHandlers命名,您提到的警告将读取

Handler returned state methodchoiceend which is unknown to the ConversationHandler <name>.

使调试:)更容易一些

>免责声明:我目前是python-telegram-bot的维护者

最新更新