jscheffl commented on code in PR #58603:
URL: https://github.com/apache/airflow/pull/58603#discussion_r2652612739
##########
providers/discord/src/airflow/providers/discord/notifications/discord.py:
##########
@@ -39,18 +43,21 @@ class DiscordNotifier(BaseNotifier):
:param username: The username to send the message as. Optional
:param avatar_url: The URL of the avatar to use for the message. Optional
:param tts: Text to speech.
+ :param embed: Discord embed object. See:
+
https://discord.com/developers/docs/resources/message#embed-object-embed-author-structure
"""
# A property that specifies the attributes that can be templated.
- template_fields = ("discord_conn_id", "text", "username", "avatar_url",
"tts")
+ template_fields = ("discord_conn_id", "text", "username", "avatar_url",
"tts", "embed")
def __init__(
self,
discord_conn_id: str = "discord_webhook_default",
- text: str = "This is a default message",
Review Comment:
Is it by API required to have a mandatory text? Can we rather add a
validationor make this property mandatory instead of adding a default? (Or is
the change committed by accident?)
##########
providers/discord/src/airflow/providers/discord/notifications/discord.py:
##########
@@ -39,18 +43,21 @@ class DiscordNotifier(BaseNotifier):
:param username: The username to send the message as. Optional
:param avatar_url: The URL of the avatar to use for the message. Optional
:param tts: Text to speech.
+ :param embed: Discord embed object. See:
+
https://discord.com/developers/docs/resources/message#embed-object-embed-author-structure
"""
# A property that specifies the attributes that can be templated.
- template_fields = ("discord_conn_id", "text", "username", "avatar_url",
"tts")
+ template_fields = ("discord_conn_id", "text", "username", "avatar_url",
"tts", "embed")
Review Comment:
If you make this a tempalted field, can the structure of "TypedDict" be
templated at all? (e.g. read from a JSON?) Or does a customer "fom_json" need
to be supported and implemented in Embed?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]