如何在 botframework v4 node sdk 中触发 ActiveHandler class 的事件
How can I trigger events of ActiveHandler class in botframework v4 node sdk
我已经阅读了 Bot v4 文档,并且通过查看 ActivityHandler 的事件感到非常惊讶和高兴 class。但是我无法通过 Facebook 频道在我的机器人中触发其中一些。
我在我的 class 中尝试了下面的代码,它扩展了 ActivityHandler class。下面提到的事件无法触发。事实上,我不知道如何触发这些事件。
onEvent
onMembersRemoved
添加反应
onReactionsRemoved
onMessageReaction
onTokenResponse事件
onUnrecognizedActivityType
下面是代码片段。
class DialogBot extends ActivityHandler {
constructor(conversationState, userState, dialog, logger,conversationReferences) {
super();
}
this.onEvent(async (context, next) => {
console.log('=========== from onEvent funcion from class=====');
await next();
});
this.onMembersRemoved(async (context, next) => {
console.log('----dialog bot.js ----onMembersRemoved---- ');
await next();
});
this.onMessageReaction(async (context, next) => {
console.log('----dialog bot.js ----onMessageReaction---- ');
await next();
});
this.onReactionsAdded(async (context, next) => {
console.log('----dialog bot.js ----onReactionsAdded---- ');
await next();
});
this.onReactionsRemoved(async (context, next) => {
console.log('----dialog bot.js ----onReactionsRemoved---- ');
await next();
});
this.onTokenResponseEvent(async (context, next) => {
console.log('----dialog bot.js ----onTokenResponseEvent---- ');
await next();
}) ;
this.onUnrecognizedActivityType(async (context, next) => {
console.log('----dialog bot.js ----onUnrecognizedActivityType---- ');
await next();
});
}
请建议在 bot framework v4 node sdk 中通过 facebook 频道利用这些强大事件的方法。
期待您的回复。谢谢。
并非所有频道都支持所有活动。
onMembersRemoved -> Facebook 不支持
onMessageReaction -> Facebook 不支持
onReactionsAdded -> Facebook 不支持
onReactionsRemoved -> Facebook 不支持
onTokenResponseEvent -> 哪个令牌?
This是一个参考图表,显示哪个通道支持哪个事件activity。
我已经阅读了 Bot v4 文档,并且通过查看 ActivityHandler 的事件感到非常惊讶和高兴 class。但是我无法通过 Facebook 频道在我的机器人中触发其中一些。
我在我的 class 中尝试了下面的代码,它扩展了 ActivityHandler class。下面提到的事件无法触发。事实上,我不知道如何触发这些事件。
onEvent onMembersRemoved 添加反应 onReactionsRemoved onMessageReaction onTokenResponse事件 onUnrecognizedActivityType
下面是代码片段。
class DialogBot extends ActivityHandler {
constructor(conversationState, userState, dialog, logger,conversationReferences) {
super();
}
this.onEvent(async (context, next) => {
console.log('=========== from onEvent funcion from class=====');
await next();
});
this.onMembersRemoved(async (context, next) => {
console.log('----dialog bot.js ----onMembersRemoved---- ');
await next();
});
this.onMessageReaction(async (context, next) => {
console.log('----dialog bot.js ----onMessageReaction---- ');
await next();
});
this.onReactionsAdded(async (context, next) => {
console.log('----dialog bot.js ----onReactionsAdded---- ');
await next();
});
this.onReactionsRemoved(async (context, next) => {
console.log('----dialog bot.js ----onReactionsRemoved---- ');
await next();
});
this.onTokenResponseEvent(async (context, next) => {
console.log('----dialog bot.js ----onTokenResponseEvent---- ');
await next();
}) ;
this.onUnrecognizedActivityType(async (context, next) => {
console.log('----dialog bot.js ----onUnrecognizedActivityType---- ');
await next();
});
}
请建议在 bot framework v4 node sdk 中通过 facebook 频道利用这些强大事件的方法。
期待您的回复。谢谢。
并非所有频道都支持所有活动。
onMembersRemoved -> Facebook 不支持
onMessageReaction -> Facebook 不支持
onReactionsAdded -> Facebook 不支持
onReactionsRemoved -> Facebook 不支持
onTokenResponseEvent -> 哪个令牌?
This是一个参考图表,显示哪个通道支持哪个事件activity。