Skip to content
This repository was archived by the owner on Jun 17, 2024. It is now read-only.
This repository was archived by the owner on Jun 17, 2024. It is now read-only.

Botkit Studio error when the bot is mentioned in a channel with and empty mention #19

@vicyankoff

Description

@vicyankoff

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions