如何使用 Bot 将附件从用户共享给代理(人工切换)?

How to share attachments from user to agent (Human handoff) using Bot?

我已经使用 C# 制作了机器人。它具有人性化的特点。我们已经集成了 tompanna 提供的人工切换解决方案,其中代理可以在我们用于人工切换 https://github.com/tompaana/intermediator-bot-sample 的解决方案 time.Here 中与单个用户交谈 link。我们的机器人工作正常,能够借助此解决方案与代理交谈,但当用户想要从用户到代理或从代理到用户共享图像或任何类型的附件时,就会出现主要问题。机器人显示图像已发送但用户无法看到它。更简单的情况发生在代理的情况下。 向用户发送附件时代理的图像。

还有用户的图片,看不到代理发来的图片

您需要编辑库的源代码才能实现您的尝试。

在此MessageRouter file , method RouteMessageIfSenderIsConnectedAsync , you can access message.Attachments , then pass it as a parameter to SendMessageAsync in line 432, then from SendMessageAsync in line 160 , you can pass it to CreateMessageActivity method and then in file ConnectorClientMessageBundle中,您可以访问附件并将其附加到messageActivity。

sample which you are using for Human HandOff has not been updated over a year, so it gets difficult to be able to find solutions for supporting various features pertaining to the same. However, going through the sample issues, there has been a similar issue in which the sample does not support emojis, images or files to the receiving user. If a user sends any of the above mentioned features, the receiver will get a blank message as it supports只有短信。

用户建议 solution 尝试创建一个简单的方法扩展来发送 image/file messages.You 可以继续尝试看看它是否适合您案例.

希望对您有所帮助。