Skip to content

Commit 5b32b32

Browse files
PIG208timabbott
authored andcommitted
botserver: Return a valid JSON that is acceptable to outgoing webhooks.
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.
1 parent 4d482e0 commit 5b32b32

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

zulip_botserver/zulip_botserver/server.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -195,11 +195,11 @@ def handle_bot() -> str:
195195
# In that case, the message shall not be handled.
196196
message['content'] = lib.extract_query_without_mention(message=message, client=bot_handler)
197197
if message['content'] is None:
198-
return json.dumps("")
198+
return json.dumps(dict(response_not_required=True))
199199

200200
if is_private_message or is_mentioned:
201201
message_handler.handle_message(message=message, bot_handler=bot_handler)
202-
return json.dumps("")
202+
return json.dumps(dict(response_not_required=True))
203203

204204

205205
def main() -> None:

0 commit comments

Comments
 (0)