Open vicyankoff opened 7 years ago
As a stop gap please use this in .catch({...})
}).catch(function(error) {
debug('error', error);
// bot.reply(message, 'I experienced an error with a request to Botkit Studio: ' + error);
controller.studio.run(bot, 'fallback', message.user, message.channel);
});
Hi all,
I successfully installed and ran the bot-start-slack example app. The bot communicates with me fine when I talk to it via direct message. Commands such as hello, thanks, uptime etc work in DM.
I found a case that causes Botkit Studio to crash. Here's how to replicate it.
1) Invite the bot to a channel, for example random. 2) Do an empty mention of the bot, for example "@mybot " and hit enter 3) Botkit Studio will send a message to the channel "I experienced an error with a request to Botkit Studio: undefined"
This error message comes from the catch clause on line 142
.catch(function(err) { bot.reply(message, 'I experienced an error with a request to Botkit Studio: ' + err); debug('Botkit Studio: ', err); });
When you do an empty mention of the bot, the message.text is "" and it causes botkit studio to crash. This only happens on a mention, so If I call controller.studio.runTrigger(bot, "", message.user, message.channel) the error is not triggered.