This repository was archived by the owner on Sep 20, 2024. It is now read-only.
Address TypeError seen in Issue 1447#1453
Open
sprak3000 wants to merge 1 commit intohowdyai:legacyfrom
Open
Conversation
* 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
sprak3000
commented
Aug 30, 2018
| name: team.bot.name | ||
| }; | ||
| } else { | ||
| bot.identity = { |
Author
There was a problem hiding this comment.
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.
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Address Issue #1447 - TypeError when Slack slash command received by bot:
bot.identityassignment into theevent_callbackpayload caseelsecase to catch non-event_callbackpayloads and set thebot.identityappropriately