Skip to content

Objects


webhook

WebhookPart dataclass

Bases: Part


              flowchart TD
              scurrypy.api.webhook.WebhookPart[WebhookPart]
              scurrypy.core.part.Part[Part]

                              scurrypy.core.part.Part --> scurrypy.api.webhook.WebhookPart
                


              click scurrypy.api.webhook.WebhookPart href "" "scurrypy.api.webhook.WebhookPart"
              click scurrypy.core.part.Part href "" "scurrypy.core.part.Part"
            

Represents fields for creating a webhook.

name: RequiredPartField[str] = None class-attribute instance-attribute

Name of the webhook.

avatar: OptionalNullablePartField[ImageDataPart] = None class-attribute instance-attribute

Image for the default webhook avatar.

WebhookMessagePart dataclass

Bases: Part


              flowchart TD
              scurrypy.api.webhook.WebhookMessagePart[WebhookMessagePart]
              scurrypy.core.part.Part[Part]

                              scurrypy.core.part.Part --> scurrypy.api.webhook.WebhookMessagePart
                


              click scurrypy.api.webhook.WebhookMessagePart href "" "scurrypy.api.webhook.WebhookMessagePart"
              click scurrypy.core.part.Part href "" "scurrypy.core.part.Part"
            

Represents fields for creating a webhook message.

Important

Requires at least ONE of content, attachments, embeds, or polls.

content: RequiredPartField[str] = None class-attribute instance-attribute

Message text content.

flags: MessageFlags = field(init=False, default=(MessageFlags.NO_FLAGS)) class-attribute instance-attribute

New flags for the message.

components: OptionalPartField[list[ContainerComponent]] = None class-attribute instance-attribute

Components to be attached to this message.

attachments: OptionalPartField[list[AttachmentPart]] = None class-attribute instance-attribute

Attachments to be attached to this message.

embeds: OptionalPartField[list[EmbedPart]] = None class-attribute instance-attribute

Embeds to be attached to this message.

thread_name: OptionalPartField[str] = None class-attribute instance-attribute

Name of thread to create.

Important

Requires forum or media channel.

applied_tags: OptionalPartField[list[Snowflake]] = None class-attribute instance-attribute

Array of tag IDs to apply to the thread.

Important

Requires forum or media channel.

poll: RequiredPartField[PollPart] = None class-attribute instance-attribute

A poll!

files: list[str] | None property

Gather file paths and from attachments.

Raises:

Returns:

  • list[str] | None –

    list of file paths or None if no attachments were supplied

prepare_attachments