Skip to content

Resources


webhook

Webhook dataclass

Bases: BaseResource


              flowchart TD
              scurrypy.resources.webhook.Webhook[Webhook]
              scurrypy.resources.base_resource.BaseResource[BaseResource]

                              scurrypy.resources.base_resource.BaseResource --> scurrypy.resources.webhook.Webhook
                


              click scurrypy.resources.webhook.Webhook href "" "scurrypy.resources.webhook.Webhook"
              click scurrypy.resources.base_resource.BaseResource href "" "scurrypy.resources.base_resource.BaseResource"
            

Represents a webhook resource.

create async

Create a webhook to be sent to a channel.

Permissions

Requires MANAGE_WEBHOOKS

Parameters:

  • channel_id (Snowflake) –

    channel ID to send webhook messages

  • webhook (WebhookPart) –

    the webhook to create

Returns:

fetch_guild async

Fetch webhooks from a guild.

Permissions

Requires MANAGE_WEBHOOKS

Parameters:

  • guild_id (Snowflake) –

    guild ID of the webhook to fetch

Returns:

fetch_webhooks async

Fetch webhooks from a channel.

Permissions

Requires MANAGE_WEBHOOKS

Parameters:

  • channel_id (Snowflake) –

    channel ID of the webhook to fetch

Returns:

fetch async

Fetch a webhook.

Permissions

Requires MANAGE_WEBHOOKS

Parameters:

  • webhook_id (Snowflake) –

    ID of the webhook to fetch

Returns:

edit async

Edit a webhook.

Permissions

Requires MANAGE_WEBHOOKS

Parameters:

  • webhook_id (Snowflake) –

    ID of the webhook to edit

  • options (WebhookParams) –

    fields to edit for the webhook

Returns:

delete async

Delete a webhook.

Permissions

Requires MANAGE_WEBHOOKS

Parameters:

  • webhook_id (Snowflake) –

    ID of the webhook to delete

execute async

Execute a webhook.

Parameters:

  • webhook_id (Snowflake) –

    ID of the webhook to send message

  • token (str) –

    token of the webhook to send message

  • message (WebhookMessagePart | str) –

    webhook message

  • wait (bool, default: False ) –

    whether to return message. Defaults to False.

  • thread_id (Snowflake, default: None ) –

    thread ID to send message

    Note

    Thread will also be unarchived.

  • with_components (bool, default: False ) –

    Whether to respect the components field. Defaults to False.

  • suppress_embeds (bool, default: False ) –

    whether to suppress embeds. Defaults to False.

  • is_components_v2 (bool, default: False ) –

    whether V2 components are in this message. Defaults to False.

  • suppress_notifications (bool, default: False ) –

    whether to suppress notifications. Defaults to False.

Returns:

  • JsonQuery | None –

    webhook message if wait = True else None