Skip to content

User Models

Note

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


UserModel dataclass

Bases: DataModel

Represents the User object.

id: int instance-attribute

ID of the user.

username: str instance-attribute

Username of the user.

discriminator: str instance-attribute

Discriminator of the user (#XXXX)

global_name: str instance-attribute

Global name of the user.

avatar: str instance-attribute

Image hash of the user's avatar.

bot: Optional[bool] instance-attribute

If the user is a bot.

system: Optional[bool] instance-attribute

If the user belongs to an OAuth2 application.

mfa_enabled: Optional[bool] instance-attribute

Whether the user has two factor enabled.

banner: Optional[str] instance-attribute

Image hash of the user's banner.

accent_color: Optional[int] instance-attribute

Color of user's banner represented as an integer.

locale: Optional[str] instance-attribute

Chosen language option of the user.

to_dict

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

Returns:

  • dict

    serialized dataclasss


GuildMemberModel dataclass

Bases: DataModel

Represents a guild member.

roles: list[int] instance-attribute

List of roles registered to the guild member.

user: UserModel instance-attribute

User data associated with the guild member.

nick: str instance-attribute

Server nickname of the guild member.

avatar: str instance-attribute

Server avatar hash of the guild mmeber.

joined_at: str instance-attribute

ISO8601 timestamp of when the guild member joined server.

permissions: Optional[int] instance-attribute

Total permissions of the member in the channel, including overwrites, returned when in the interaction object. [INT_LIMIT]

to_dict

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

Returns:

  • dict

    serialized dataclasss