mirror of
https://github.com/zulip/zulip.git
synced 2025-11-06 23:13:25 +00:00
minor: Use explicit params in build_bot_request.
I also tweaked the block comment to mention gravatars.
This commit is contained in:
@@ -28,12 +28,21 @@ class OutgoingWebhookServiceInterface:
|
|||||||
class GenericOutgoingWebhookService(OutgoingWebhookServiceInterface):
|
class GenericOutgoingWebhookService(OutgoingWebhookServiceInterface):
|
||||||
|
|
||||||
def build_bot_request(self, event: Dict[str, Any]) -> Optional[Any]:
|
def build_bot_request(self, event: Dict[str, Any]) -> Optional[Any]:
|
||||||
# Because we don't have a place for the recipient of an
|
'''
|
||||||
# outgoing webhook to indicate whether it wants the raw
|
We send a simple version of the message to outgoing
|
||||||
# Markdown or the rendered HTML, we leave both the content and
|
webhooks, since most of them really only need
|
||||||
# rendered_content fields in the message payload.
|
`content` and a few other fields. We may eventually
|
||||||
MessageDict.finalize_payload(event['message'], False, False,
|
allow certain bots to get more information, but
|
||||||
keep_rendered_content=True)
|
that's not a high priority. We do send the gravatar
|
||||||
|
info to the clients (so they don't have to compute
|
||||||
|
it themselves).
|
||||||
|
'''
|
||||||
|
MessageDict.finalize_payload(
|
||||||
|
event['message'],
|
||||||
|
apply_markdown=False,
|
||||||
|
client_gravatar=False,
|
||||||
|
keep_rendered_content=True
|
||||||
|
)
|
||||||
|
|
||||||
request_data = {"data": event['command'],
|
request_data = {"data": event['command'],
|
||||||
"message": event['message'],
|
"message": event['message'],
|
||||||
|
|||||||
Reference in New Issue
Block a user