Skip to content

Message Models

Note

The following classes come from the scurrypy.models.nessage module.


MessageModel dataclass

Bases: DataModel

Represents a Discord message.

id: int instance-attribute

ID of the message.

channel_id: int instance-attribute

Channel ID of the message.

author: UserModel instance-attribute

User data of author of the message.

content: str instance-attribute

Content of the message.

pinned: bool instance-attribute

If the message is pinned.

type: int instance-attribute

Type of message.

webhook_id: Optional[int] instance-attribute

ID of the webhook if the message is a webhook.

timestamp: Optional[str] instance-attribute

Timestamp of when the message was sent.

to_dict

Recursively turns the dataclass into a dictionary and drops empty fields.

Returns:

  • dict

    serialized dataclasss


PinnedMessageModel dataclass

Bases: DataModel

Represents a pinned message.

message: MessageModel instance-attribute

Message resource of the pinned message.

pinned_at: Optional[str] instance-attribute

ISO8601 timestamp of when the message was pinned.

to_dict

Recursively turns the dataclass into a dictionary and drops empty fields.

Returns:

  • dict

    serialized dataclasss