Fixed JSON path again
This commit is contained in:
parent
310c9ed759
commit
4702afe2a8
@ -104,8 +104,9 @@ def format_response(event):
|
||||
text = 'Thanks for adding me to a DM, {}!'.format(sender_name)
|
||||
|
||||
elif event_type == 'MESSAGE':
|
||||
if event['space'].get('slashCommand'):
|
||||
text = f"You used a slash command with ID {event['space']['slashCommand']['commandId']}"
|
||||
slash_command = event['message']['space'].get('slashCommand')
|
||||
if slash_command:
|
||||
text = f"You used a slash command with ID {slash_command['commandId']}"
|
||||
else:
|
||||
text = 'Your message, {}: "{}"'.format(sender_name, event['message']['text'])
|
||||
|
||||
|
||||
Reference in New Issue
Block a user