Changed JSON path

This commit is contained in:
Benjamyn Love 2023-03-09 13:35:52 +11:00
parent 04b4f0ec01
commit 310c9ed759

View File

@ -104,8 +104,8 @@ def format_response(event):
text = 'Thanks for adding me to a DM, {}!'.format(sender_name)
elif event_type == 'MESSAGE':
if event['slashCommand']:
text = f"You used a slash command with ID {event['slashCommand']['commandId']}"
if event['space'].get('slashCommand'):
text = f"You used a slash command with ID {event['space']['slashCommand']['commandId']}"
else:
text = 'Your message, {}: "{}"'.format(sender_name, event['message']['text'])