From 310c9ed759743d8a9b0809edd45bc38555c8f28a Mon Sep 17 00:00:00 2001 From: Benjamyn Love Date: Thu, 9 Mar 2023 13:35:52 +1100 Subject: [PATCH] Changed JSON path --- priceybot2/chatbot.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/priceybot2/chatbot.py b/priceybot2/chatbot.py index b2a2fc7..1a46e41 100644 --- a/priceybot2/chatbot.py +++ b/priceybot2/chatbot.py @@ -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'])