Skip to content
This repository has been archived by the owner on Sep 20, 2024. It is now read-only.

Address TypeError seen in Issue 1447 #1453

Open
wants to merge 1 commit into
base: legacy
Choose a base branch
from

Conversation

sprak3000
Copy link

Address Issue #1447 - TypeError when Slack slash command received by bot:

  • Move the former bot.identity assignment into the event_callback payload case
  • Add an else case to catch non-event_callback payloads and set the bot.identity appropriately

* Move the former `bot.identity` assignment into the `event_callback` payload case
* Add an `else` case to catch non-`event_callback` payloads and set the `bot.identity` appropriately
name: team.bot.name
};
} else {
bot.identity = {
Copy link
Author

@sprak3000 sprak3000 Aug 30, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Generated the original issue using a bot attached to a Slack app. Used same bot to create this fix. When sending a slash command to my bot, the team object was in the form { id: 'XXXXXXXXX', name: 'foo', domain: 'foo' }, and there was no payload.type defined.

Based on my understanding of legacy versus Slack app connected bots, I believe this approach should handle both types. Using this patch with my bot restores slash command functionality.

@peterswimm peterswimm requested a review from benbrown September 1, 2018 12:31
@benbrown benbrown changed the base branch from master to legacy May 3, 2019 21:00
@benbrown benbrown added the legacy pertaining to version 0.7 or below label May 4, 2019
@ryansydnor ryansydnor mentioned this pull request Nov 1, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug enhancement legacy pertaining to version 0.7 or below Slack-related
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants