我正在尝试在sessionUpdate上发送键入指示符,但对我来说 session.sendTyping()仅在对话框中起作用。至少我在Webchat和BotEmulator频道中尝试过,但没有成功。关于如何实现此目标的任何想法?
这是我的尝试:
bot.on('conversationUpdate', async (message) => {
if (message.membersAdded) {
for (let identity of message.membersAdded) {
if (identity.id === message.address.bot.id) {
const replies = getGreetingReplies(message);
cosmosDB.writeOnConvUpdate({ userMessage: message, botMessage: replies[0] }, message.address.conversation.id);
bot.loadSession(message.address, async (err, session) => {
for (let reply of replies) {
//var msg = new builder.Message().address(message.address).text('');
//msg.type = 'Typing';
//bot.send(msg);
await utilities.SendTyping(session, 3000);
bot.send(reply);
}
});
}
}
}});