class_docstr: This hook allows you to post messages to Discord using incoming webhooks.
  
  Takes a Discord connection ID with a default relative webhook endpoint. The
  default endpoint can be overridden using the webhook_endpoint parameter
  (https://discordapp.com/developers/docs/resources/webhook).
  
  Each Discord webhook can be pre-configured to use a specific username and
  avatar_url. You can override these defaults in this hook.
  
  :param http_conn_id: Http connection ID with host as "https://discord.com/api/" and
                       default webhook endpoint in the extra field in the form of
                       {"webhook_endpoint": "webhooks/{webhook.id}/{webhook.token}"}
  :param webhook_endpoint: Discord webhook endpoint in the form of
                           "webhooks/{webhook.id}/{webhook.token}"
  :param message: The message you want to send to your Discord channel
                  (max 2000 characters)
  :param username: Override the default username of the webhook
  :param avatar_url: Override the default avatar of the webhook
  :param tts: Is a text-to-speech message
  :param proxy: Proxy to use to make the Discord webhook call
class_docstr_tok: ["This","hook","allows","you","to","post","messages","to","Discord","using","incoming","webhooks",".","Takes","a","Discord","connection","ID","with","a","default","relative","webhook","endpoint",".","The","default","endpoint","can","be","overridden","using","the","webhook_endpoint","parameter","(","https",":","\/\/discordapp.com\/developers\/docs\/resources\/webhook",")",".","Each","Discord","webhook","can","be","pre-configured","to","use","a","specific","username","and","avatar_url",".","You","can","override","these","defaults","in","this","hook",".",":","param","http_conn_id",":","Http","connection","ID","with","host","as","``","https",":","\/\/discord.com\/api\/","''","and","default","webhook","endpoint","in","the","extra","field","in","the","form","of","{","``","webhook_endpoint","''",":","``","webhooks\/","{","webhook.id","}","\/","{","webhook.token","}","''","}",":","param","webhook_endpoint",":","Discord","webhook","endpoint","in","the","form","of","``","webhooks\/","{","webhook.id","}","\/","{","webhook.token","}","''",":","param","message",":","The","message","you","want","to","send","to","your","Discord","channel","(","max","2000","characters",")",":","param","username",":","Override","the","default","username","of","the","webhook",":","param","avatar_url",":","Override","the","default","avatar","of","the","webhook",":","param","tts",":","Is","a","text-to-speech","message",":","param","proxy",":","Proxy","to","use","to","make","the","Discord","webhook","call"]
docstr: Combine all relevant parameters into a valid Discord JSON payload.
  
  :return: Discord payload (str) to send
docstr_tok: ["Combine","all","relevant","parameters","into","a","valid","Discord","JSON","payload",".",":","return",":","Discord","payload","(","str",")","to","send"]
code: def _build_discord_payload(self) -> str:
      """
      Combine all relevant parameters into a valid Discord JSON payload.
  
      :return: Discord payload (str) to send
      """
      payload: dict[str, Any] = {}
  
      if self.username:
          payload["username"] = self.username
      if self.avatar_url:
          payload["avatar_url"] = self.avatar_url
  
      payload["tts"] = self.tts
  
      if len(self.message) <= 2000:
          payload["content"] = self.message
      else:
          raise AirflowException(
              "Discord message length must be 2000 or fewer characters."
          )
  
      return json.dumps(payload)
  
file_path: airflow/airflow/providers/discord/hooks/discord_webhook.py
imports: from __future__ import annotations
  import json
  import re
  from typing import Any
  from airflow.exceptions import AirflowException
  from airflow.providers.http.hooks.http import HttpHook
label_desc: Use image node_id 4 for calling the DiscordWebhookHook obj's underlying member method code with example usage: obj._build_discord_payload() and returns: json