Skip to content

Commit

Permalink
add empty message response
Browse files Browse the repository at this point in the history
  • Loading branch information
aaalexlit committed Feb 10, 2024
1 parent 0a16aaa commit 68b6b33
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions slack_bot/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,13 @@ def handle_message_events(body):

# Extract question from the message text
question = remove_mentions(str(body["event"]["text"]))
if question.strip() == '':
client.chat_postMessage(channel=channel_id,
thread_ts=event_ts,
text=('Ooops! It seems like your question is empty. '
'Please make sure to tag me in your message along with your question.')
)
return
logger.info(question)

# Let the user know that we are busy with the request
Expand Down

0 comments on commit 68b6b33

Please sign in to comment.