Skip to content

InvitePart

Note

The following classes come from the scurrypy.parts.invite module.


InvitePart dataclass

Bases: DataModel

Represents fields for creating an invite.

max_age: int = 86400 class-attribute instance-attribute

Duration of invite (in seconds) before it expires. 0 for never or up to 604800 (max 7 days). Defaults to 86400 (24 hours).

max_uses: int = 0 class-attribute instance-attribute

Max number of uses for this invite. 0 for unlimited or up to 100. Defaults to 0.

temporary: bool = False class-attribute instance-attribute

Whether this invite grants temporary membership. Defaults to False.

unique: bool = False class-attribute instance-attribute

Whether to reuse similar invite codes. Defaults to False.

role_ids: Optional[list[int]] = field(default_factory=list) class-attribute instance-attribute

Role IDs to be given when the user accept this invite.

Permissions

Requires MANAGE_ROLES and cannot assign roles with higher permissions than the sender.

to_dict

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

Returns:

  • dict

    serialized dataclasss