提问人:ML Ops 提问时间:11/2/2023 更新时间:11/2/2023 访问量:19
Bot framework 继续对话不起作用
Bot framework continue conversation doesn't work
问:
我正在尝试让机器人通过单独的功能回复现有对话。 我的代码如下所示。
class TestClass():
def callback(self, message):
async def async_callback(turn_context):
await turn_context.send_activity(message)
return async_callback
async def testReply(self, message):
conversation_reference = shared_storage[self.user_id]
adapter = MyBotAdapter()
await adapter.continue_conversation(conversation_reference, self.callback(message))
print("OUTTTTTTTTTTTTTTT")
class TestBot(ActivityHandler):
async def on_message_activity(self, turn_context: TurnContext):
conversation_reference = TurnContext.get_conversation_reference(turn_context.activity)
self.user_id = turn_context.activity.from_property.id
shared_storage[self.user_id] = conversation_reference
other_class = TestClass(self.user_id)
await other_class.testReply(turn_context.activity.text)
没有错误,但 testReply 根本没有回复。知道是什么原因造成的吗?
答: 暂无答案
评论