Skip to content

Commit

Permalink
botserver: Return a valid JSON that is acceptable to outgoing webhooks.
Browse files Browse the repository at this point in the history
In zulip/zulip@b998138, we introduce
a check for responses from outgoing webhooks that require them to be
a dictionary. This commit fixes the return value of the botserver view
function to accommodate with the change from the serverside.
  • Loading branch information
PIG208 authored and timabbott committed May 11, 2021
1 parent 4d482e0 commit 5b32b32
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions zulip_botserver/zulip_botserver/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,11 +195,11 @@ def handle_bot() -> str:
# In that case, the message shall not be handled.
message['content'] = lib.extract_query_without_mention(message=message, client=bot_handler)
if message['content'] is None:
return json.dumps("")
return json.dumps(dict(response_not_required=True))

if is_private_message or is_mentioned:
message_handler.handle_message(message=message, bot_handler=bot_handler)
return json.dumps("")
return json.dumps(dict(response_not_required=True))


def main() -> None:
Expand Down

0 comments on commit 5b32b32

Please sign in to comment.