From 04b4f0ec01cae08aca46694eac931a58f227478e Mon Sep 17 00:00:00 2001 From: Benjamyn Love Date: Thu, 9 Mar 2023 13:32:33 +1100 Subject: [PATCH] Added test slash command --- priceybot2/chatbot.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/priceybot2/chatbot.py b/priceybot2/chatbot.py index 4a115a1..b2a2fc7 100644 --- a/priceybot2/chatbot.py +++ b/priceybot2/chatbot.py @@ -104,7 +104,10 @@ def format_response(event): text = 'Thanks for adding me to a DM, {}!'.format(sender_name) elif event_type == 'MESSAGE': - text = 'Your message, {}: "{}"'.format(sender_name, event['message']['text']) + if event['slashCommand']: + text = f"You used a slash command with ID {event['slashCommand']['commandId']}" + else: + text = 'Your message, {}: "{}"'.format(sender_name, event['message']['text']) response = {'text': text}