You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
const{ Botkit }=require('botkit');const{ MemoryStorage }=require('botbuilder');const{ SlackAdapter }=require('botbuilder-adapter-slack');constWatsonMiddleware=require('botkit-middleware-watson').WatsonMiddleware;constmiddleware=newWatsonMiddleware({iam_apikey: process.env.ASSISTANT_IAM_APIKEY,workspace_id: process.env.WORKSPACE_ID,url: process.env.ASSISTANT_URL,version: '2018-07-10'});// Configure your bot.constadapter=newSlackAdapter({clientSigningSecret: process.env.SLACK_CLIENT_SIGNING_SECRET,botToken: process.env.SLACK_TOKEN,});constcontroller=newBotkit({
adapter,storage: newMemoryStorage(),// ...other options});controller.middleware.receive.use(middleware.receive.bind(middleware),);controller.hears(['.*'],['direct_message','direct_mention','mention','message_received'],async(bot,message)=>{console.log('Slack message received');awaitmiddleware.interpret(bot,message);if(message.watsonError){console.log(message.watsonError);awaitbot.reply(message,message.watsonError.description||message.watsonError.error);}elseif(message.watsonData&&'output'inmessage.watsonData){awaitbot.reply(message,message.watsonData.output.text.join('\n'));}else{console.log('Error: received message in unknown format. (Is your connection with Watson Assistant up and running?)');awaitbot.reply(message,'I\'m sorry, but for technical reasons I can\'t respond to your message');}});
Integrated with Slack configuration too. But when i sent a message to Bot. I couldn't catch the message to reply from watson assistant
Thanks.
The text was updated successfully, but these errors were encountered:
I have integrated the bot kit with Slack
Here is my CODE
Integrated with Slack configuration too. But when i sent a message to Bot. I couldn't catch the message to reply from watson assistant
Thanks.
The text was updated successfully, but these errors were encountered: