bottender
Advanced tools
Changelog
1.2.0 / 2020-01-22
[new] Added four NLU packages:
[new] Added context.setIntent()
for intent tracking purpose (#617):
context.intent; // null
context.setIntent('greeting');
context.intent; // 'greeting'
context.setAsHandled()
and context.setAsNotHandled()
for tracking handling status (#624):context.setAsHandled();
context.isHandled; // true
context.setAsNotHandled();
context.isHandled; // false
getSessionStore
helper function to get the session store that configured by bottender.config.js
(#633):const { getSessionStore } = require('bottender');
const sessionStore = getSessionStore();
getClient
helper function to access underlying messaging client configured by bottender.config.js
(#634):const { getClient } = require('bottender');
const messenger = getClient('messenger');
messenger.sendText(USER_ID, 'Hello!', { tag: 'CONFIRMED_EVENT_UPDATE' });
const line = getClient('line');
line.pushText(USER_ID, 'Hello!');
includeBotMessages
option for interacting with bot_message
(#635):// bottender.config.js
module.exports = {
// ...
slack: {
enabled: true,
path: '/webhooks/slack',
accessToken: process.env.SLACK_ACCESS_TOKEN,
verificationToken: process.env.SLACK_VERIFICATION_TOKEN,
includeBotMessages: true, // add this line
},
};
Then you can use context.event.isBotMessage
to determine if the event is a bot message event:
module.exports = function App(context) {
if (context.event.isBotMessage) {
console.log(context.event.rawEvent.botId);
}
};
Changelog
1.1.3 / 2020-01-08
Changelog
1.0.8 / 2020-01-08