【发布时间】:2020-07-17 08:33:47
【问题描述】:
我正在尝试使用主动消息向频道发送附件, 下面是我的代码。
async function sendToChannelWithImage(message,channelId,img) {
MicrosoftAppCredentials.trustServiceUrl('');
var credentials = new MicrosoftAppCredentials('app-id', 'password');
var client = new ConnectorClient(credentials, { baseUri: 'https://smba.trafficmanager.net/us/' });
var conversationResponse = await client.conversations.createConversation({
bot: {
id: 'app-id',
name: 'test'
},
isGroup: true,
conversationType: "channel",
channelData: {
channel: { id: channelId }
},
activity: {
type: 'message',
text: message,
attachments: [img]
}
});
}
const img = {contentType: 'image/*',contentUrl: "https://theysaidso.com/img/qod/qod-inspire.jpg"};
message = 'test'
channelId = 'testid'
在此我尝试使用机器人框架发送消息, 我试过的:https://docs.microsoft.com/en-us/azure/bot-service/nodejs/bot-builder-nodejs-send-receive-attachments
【问题讨论】:
-
您是要向频道发送附件还是创建对话?
-
你还在做这个吗?
-
@KyleDelaney 是的
-
我正在尝试向频道发送附件
-
你既没有投票也没有接受我的回答,你决定让你的赏金到期而不是奖励给我。我仍然愿意帮助你。你还需要帮助吗?
标签: node.js botframework