提问人:hamzah jazi 提问时间:11/15/2023 更新时间:11/15/2023 访问量:58
Azure Web 聊天通道不允许用户下载机器人发送的附件
Azure webchat channel doesn't let the user to download the sent attachment by the bot
问:
我有一个使用 python 机器人框架的聊天机器人,用户可以输入文件的名称,机器人会搜索它,然后将其作为附件发送以让用户下载它,当我在本地运行它时,下载按钮在要下载的文件旁边,但在部署它后,我找不到下载按钮来下载附件。
elif cardValue == "Search":
found_files = self.search_for_files(turn_context.activity.value["FileName"])
if found_files:
# Send files with a matching score above 65% as attachments
for found_file, score in found_files:
if score > 65:
file_path = os.path.join(self.folder_path, found_file)
file_attachment = Attachment(
content_type="application/octet-stream",
content_url=file_path,
as_attachment=True,
name=found_file
)
message = MessageFactory.attachment(file_attachment)
await turn_context.send_activity(message)
await turn_context.send_activity("please type menu to show main menu")
请看下面的图片
答: 暂无答案
评论