Skip to content

Discord notify

DiscordNotify

Bases: BaseNotify

Methods:

Name Description
send_notify

avatar_url

avatar_url: str = Field(
    default="https://i.imgur.com/QoOwyXJ.png",
    title="Avatar URL",
    description="The URL of the avatar image.",
    frozen=False,
    deprecated=False,
)

target_image

target_image: Optional[Image | str] = Field(
    default=None,
    title="Image Object",
    description="The image object to send.",
    frozen=False,
    deprecated=False,
)

discord_webhook_url

discord_webhook_url: str = Field(
    ...,
    title="Discord Webhook URL",
    description="The URL of the Discord webhook to send notifications to.",
    frozen=False,
    deprecated=False,
)

title

title: str = Field(
    ...,
    title="Title",
    description="The title of the notification message.",
    frozen=True,
    deprecated=False,
)

content

content: str = Field(
    default="",
    title="Content",
    description="The content of the notification message.",
    frozen=True,
    deprecated=False,
)

description

description: str = Field(
    ...,
    title="Description",
    description="The description of the notification message.",
    frozen=True,
    deprecated=False,
)

send_notify

send_notify() -> None
Source code in src/utils/notifications/base_notify.py
async def send_notify(self) -> None:
    try:
        await self._send_notify()
    except Exception:
        logfire.error("Failed to send Discord notification.")