Models

Models are classes that are received from Revolt API and are not meant to be created by the user of the library.

Danger

The classes listed below are not intended to be created by users and are also read-only.

For example, this means that you should not make your own mutiny.models.User instances nor should you modify the mutiny.models.User instance yourself.

If you want to get one of these model classes instances, you should do that by using appropriate methods and attributes on the mutiny.Client, Events, and Models.

User models

User

final class mutiny.models.User[source]

Represents a user.

id

The user ID.

Type

str

username

The username.

Type

str

avatar

The user’s avatar.

Type

Optional[Attachment]

relations

The user’s relations. This is only present for the client user.

Type

Optional[dict[str, Relationship]]

badges

The user’s badges.

Type

Badges

status

The user’s status.

Type

Status

relationship_status

The client user’s relationship status with this user.

Type

Optional[RelationshipStatus]

online

Indicates whether the user is online.

Type

bool

flags

The user flags.

Type

UserFlags

bot

The information about this bot, or None if this user is not a bot.

Type

Optional[BotInfo]

profile

The user’s profile.

Type

Optional[UserProfile]

created_at

The resource’s creation time as an aware UTC datetime object.

Type

datetime.datetime

BotInfo

final class mutiny.models.BotInfo[source]

Represents the information about a bot user.

owner_id

The ID of the bot owner.

Type

str

Relationship

final class mutiny.models.Relationship[source]

Represents the client user’s relationship with other user.

user_id

The ID of the other user in this relation.

Type

str

status

The relationship’s status.

Type

RelationshipStatus

Status

final class mutiny.models.Status[source]

Represents a user’s status.

text

The custom status text.

Type

Optional[str]

presence

The user’s presence.

Type

Presence

UserProfile

final class mutiny.models.UserProfile[source]

Represents a profile of a user.

content

The profile content if provided.

Type

Optional[str]

background

The profile background if provided.

Type

Optional[Attachment]

Channels

Channel

class mutiny.models.Channel[source]

Base class for all channel classes.

id

The channel ID.

Type

str

type

The channel’s type.

Note

Checking using type() or isinstance() should be preferred over using this attribute.

nonce

Nonce value, used to prevent double requests to create.

Type

Optional[str]

created_at: datetime.datetime

The resource’s creation time as an aware UTC datetime object.

Type

datetime.datetime

SavedMessagesChannel

final class mutiny.models.SavedMessagesChannel[source]

Represent the ‘Saved Notes’ channel of a user.

user_id

The ID of a user who created and owns the channel.

Type

str

created_at: datetime.datetime

The resource’s creation time as an aware UTC datetime object.

Type

datetime.datetime

DMChannel

final class mutiny.models.DMChannel[source]

Represents a direct message (DM) channel.

active

Indicates whether this DM is active.

Type

bool

recipient_ids

List of user IDs who are participating in this DM.

Type

list

last_message_id

ID of the last message sent in this channel if any.

Note

This only includes non-system messages.

Type

Optional[str]

created_at: datetime.datetime

The resource’s creation time as an aware UTC datetime object.

Type

datetime.datetime

GroupChannel

final class mutiny.models.GroupChannel[source]

Represents a group channel.

recipient_ids

List of user IDs who are participating in this channel.

Type

list[str]

name

The channel’s name.

Type

str

owner_id

The user ID of the owner of this channel.

Type

str

description

The channel’s description if provided.

Type

Optional[str]

last_message_id

ID of the last message sent in this channel if any.

Note

This only includes non-system messages.

Type

Optional[str]

icon

The channel’s icon if provided.

Type

Optional[Attachment]

permissions

The permissions in this channel.

Type

ChannelPermissions

created_at

The resource’s creation time as an aware UTC datetime object.

Type

datetime.datetime

TextChannel

final class mutiny.models.TextChannel[source]

Represents a server text channel.

server_id

The ID of the server the channel belongs to.

Type

str

name

The channel’s name.

Type

str

description

The channel’s description if provided.

Type

Optional[str]

icon

The channel’s icon if provided.

Type

Optional[Attachment]

default_permissions

The default permissions in this channel.

Type

ChannelPermissions

role_permissions

The mapping of role ID to its permissions in this channel.

Type

dict[str, ChannelPermissions]

last_message_id

ID of the last message sent in this channel if any.

Note

This only includes non-system messages.

Type

Optional[str]

created_at

The resource’s creation time as an aware UTC datetime object.

Type

datetime.datetime

VoiceChannel

final class mutiny.models.VoiceChannel[source]

Represents a server voice channel.

server_id

The ID of the server the channel belongs to.

Type

str

name

The channel’s name.

Type

str

description

The channel’s description if provided.

Type

Optional[str]

icon

The channel’s icon if provided.

Type

Optional[Attachment]

default_permissions

The default permissions in this channel.

Type

ChannelPermissions

role_permissions

The mapping of role ID to its permissions in this channel.

Type

dict[str, ChannelPermissions]

created_at

The resource’s creation time as an aware UTC datetime object.

Type

datetime.datetime

Messages

Message

final class mutiny.models.Message[source]

Represents a message.

id

The message ID.

Type

str

nonce

Nonce value, used to prevent double requests to create objects.

Type

Optional[str]

channel_id

The ID of the channel this message was sent in.

Type

str

author_id

The ID of the user that sent this message.

Type

str

content

The contents of the message. This is a (potentially empty) string, or None if this is a system message.

Type

Optional[str]

system_message

The data of a system message. None if this is not a system message.

Type

Optional[SystemMessage]

attachments

The list of attachments the message has.

Type

list[Attachment]

edited_at

An aware UTC datetime object denoting the time the message was edited at, or None if the message was never edited.

Type

Optional[datetime.datetime]

embeds

The list of embeds the message has.

Type

list[Embed]

mention_ids

The list of IDs of the users that were mentioned in this message.

Type

list[str]

reply_ids

The list of message IDs that were replied to with this message.

Type

list[str]

created_at

The resource’s creation time as an aware UTC datetime object.

Type

datetime.datetime

ChannelDescriptionChangedSystemMessage

final class mutiny.models.ChannelDescriptionChangedSystemMessage[source]

Represents a “channel description changed” system message in group channels.

actor_id

The ID of the user who changed the description of the channel.

Type

int

ChannelIconChangedSystemMessage

final class mutiny.models.ChannelIconChangedSystemMessage[source]

Represents a “channel icon changed” system message in group channels.

actor_id

The ID of the user who changed the icon of the channel.

Type

int

ChannelRenamedSystemMessage

final class mutiny.models.ChannelRenamedSystemMessage[source]

Represents a “channel renamed” system message in group channels.

new_name

The new name of the channel.

Type

str

actor_id

The ID of the user who renamed the channel.

Type

int

SystemMessage

class mutiny.models.SystemMessage[source]

Base class for all system message classes.

type

The type of the system message.

Note

Checking using type() or isinstance() should be preferred over using this attribute.

Type

str

TextSystemMessage

final class mutiny.models.TextSystemMessage[source]

Represents a text system message.

content

The contents of the message.

Type

str

UserAddedSystemMessage

final class mutiny.models.UserAddedSystemMessage[source]

Represents a “user added” system message in group channels.

target_id

The ID of the user added to the channel.

Type

int

actor_id

The ID of the user who added the user to the channel.

Type

int

UserBannedSystemMessage

final class mutiny.models.UserBannedSystemMessage[source]

Represents a “user banned” system message in server text channels.

target_id

The ID of the user banned from the server.

Type

str

UserJoinedSystemMessage

final class mutiny.models.UserJoinedSystemMessage[source]

Represents a “user joined” system message in server text channels.

user_id

The ID of the user who joined the server.

Type

str

UserKickedSystemMessage

final class mutiny.models.UserKickedSystemMessage[source]

Represents a “user kicked” system message in server text channels.

target_id

The ID of the user kicked from the server.

Type

str

UserLeftSystemMessage

final class mutiny.models.UserLeftSystemMessage[source]

Represents a “user left” system message in server text channels.

user_id

The ID of the user who left the server.

Type

str

UserRemovedSystemMessage

final class mutiny.models.UserRemovedSystemMessage[source]

Represents a “user removed” system message in group channels.

target_id

The ID of the user removed from the channel.

Type

int

actor_id

The ID of the user who removed the user from the channel.

Type

int

Server models

Server

final class mutiny.models.Server[source]

Represents a server.

id

The server ID.

Type

str

nonce

Nonce value, used to prevent double requests to create objects.

Type

Optional[str]

owner_id

The user ID of the server’s owner.

Type

str

name

The name of the server.

Type

str

description

The description of the server if provided.

Type

Optional[str]

channel_ids

List of the channel IDs in the server.

Type

list[str]

categories

Mapping of the category ID to category in the server.

Type

dict[str, Any]

system_message_channels

The server’s system message channels configuration.

Type

SystemMessageChannels

roles

Mapping of the role ID to role in the server.

Type

dict[str, Any]

default_server_permissions

The default server permissions.

Type

ServerPermissions

default_channel_permissions

The default channel permissions in the server.

Type

ChannelPermissions

icon

The server’s icon if provided.

Type

Optional[Attachment]

banner

The server’s banner if provided.

Type

Optional[Attachment]

created_at

The resource’s creation time as an aware UTC datetime object.

Type

datetime.datetime

Category

final class mutiny.models.Category[source]

Represents a server channel category.

id

The category ID.

Type

str

title

The category title.

Type

str

channel_ids

List of the channel IDs belonging to this category.

Type

list

created_at: datetime.datetime

The resource’s creation time as an aware UTC datetime object.

Type

datetime.datetime

Member

final class mutiny.models.Member[source]

Represents a member in a server.

id

The member ID (equivalent to user ID).

Type

str

server_id

The ID of the member’s server.

Type

str

nickname

The member’s server nickname.

Type

Optional[str]

avatar

The member’s server avatar.

Type

Optional[Attachment]

role_ids

List of the role IDs the member has.

Type

list[str]

created_at

The resource’s creation time as an aware UTC datetime object.

Type

datetime.datetime

Role

final class mutiny.models.Role[source]

Represents a role in a server.

id

The ID of the role.

Type

str

name

The name of the role.

Type

str

server_permissions

The role’s server permissions.

Type

ServerPermissions

channel_permissions

The role’s channel permissions.

Type

ChannelPermissions

colour

The role’s colour.

Type

Optional[str]

hoist

Indicates if the role will be displayed separately on the members list.

Type

bool

rank

The role’s ranking. A role with a smaller number will have permissions over the roles with larger numbers.

Type

int

created_at

The resource’s creation time as an aware UTC datetime object.

Type

datetime.datetime

SystemMessageChannels

final class mutiny.models.SystemMessageChannels[source]

Represents a server’s system message channels configuration.

user_joined_id

The ID of the channel used for “user joined” messages, if any.

Type

Optional[str]

user_left_id

The ID of the channel used for “user left” messages, if any.

Type

Optional[str]

user_kicked_id

The ID of the channel used for “user kicked” messages, if any.

Type

Optional[str]

user_banned_id

The ID of the channel used for “user banned” messages, if any.

Type

Optional[str]

Attachment models

Attachment

final class mutiny.models.Attachment[source]

Represents an attachment.

id

The attachment ID.

Type

str

tag

The attachment tag.

Type

AttachmentTag

size

The file size (in bytes).

Type

int

filename

The file name.

Type

str

metadata

The attachment metadata.

Type

AttachmentMetadata

content_type

The file’s content type.

Type

str

property url: str

The attachment URL.

created_at

The resource’s creation time as an aware UTC datetime object.

Type

datetime.datetime

AttachmentMetadata

class mutiny.models.AttachmentMetadata[source]

Base class for all attachment metadata classes.

type

The type of the attachment.

Note

Checking using type() or isinstance() should be preferred over using this attribute.

Type

str

AudioMetadata

final class mutiny.models.AudioMetadata[source]

Represents the attachment metadata of an audio file.

FileMetadata

final class mutiny.models.FileMetadata[source]

Represents the attachment metadata of a file.

ImageMetadata

final class mutiny.models.ImageMetadata[source]

Represents the attachment metadata of a image file.

width

The image width.

Type

int

height

The image height.

Type

int

TextMetadata

final class mutiny.models.TextMetadata[source]

Represents the attachment metadata of a text file.

VideoMetadata

final class mutiny.models.VideoMetadata[source]

Represents the attachment metadata of a video file.

width

The video width.

Type

int

height

The video height.

Type

int

Message embeds models

Embed

class mutiny.models.Embed[source]

Base class for all embeds.

type

The type of the embed.

Note

Checking using type() or isinstance() should be preferred over using this attribute.

Type

str

NoneEmbed

final class mutiny.models.NoneEmbed[source]

Represents a none embed which is an embed indicating that there is no embed for the first URL in the message content.

WebsiteEmbed

final class mutiny.models.WebsiteEmbed[source]

Represents a website embed.

url

The website URL if provided.

Type

Optional[str]

special

Special information about this website if provided.

Type

Optional[EmbeddedSpecial]

title

The website title if provided.

Type

Optional[str]

description

The website description if provided.

Type

Optional[str]

image

The website’s embedded image if provided.

Type

Optional[EmbeddedImage]

video

The website’s embedded video if provided.

Type

Optional[EmbeddedVideo]

site_name

The website’s site name if provided.

Type

Optional[str]

icon_url

The website’s icon URL if provided.

Type

Optional[str]

colour

The website’s embed colour if provided.

Type

Optional[str]

ImageEmbed

final class mutiny.models.ImageEmbed[source]

Represents an image embed.

url

The image’s URL.

Type

str

width

The image’s width.

Type

int

height

The image’s height.

Type

int

size

The image’s size (in bytes).

Type

ImageSize

EmbeddedSpecial

class mutiny.models.EmbeddedSpecial[source]

Base class for all embed special classes.

type

The type of the embed special.

Note

Checking using type() or isinstance() should be preferred over using this attribute.

Type

str

EmbeddedYouTube

final class mutiny.models.EmbeddedYouTube[source]

Represents a special YouTube embed.

id

The ID of the resource this embed points to.

Type

str

timestamp

The timestamp in the video this embed’s link points to.

Type

Optional[str]

EmbeddedTwitch

final class mutiny.models.EmbeddedTwitch[source]

Represents a special Twitch embed.

id

The ID of the resource this embed points to.

Type

str

content_type

The type of the resource this embed points to.

Type

TwitchType

EmbeddedSpotify

final class mutiny.models.EmbeddedSpotify[source]

Represents a special Spotify embed.

id

The ID of the resource this embed points to.

Type

str

content_type

The type of the resource this embed points to.

Type

str

EmbeddedBandcamp

final class mutiny.models.EmbeddedBandcamp[source]

Represents a special Bandcamp embed.

id

The ID of the resource this embed points to.

Type

str

content_type

The type of the resource this embed points to.

Type

BandcampType

EmbeddedImage

final class mutiny.models.EmbeddedImage[source]

Represents a website embed image.

url

The image’s URL.

Type

str

width

The image’s width.

Type

int

height

The image’s height.

Type

int

size

The image’s size (in bytes).

Type

ImageSize

EmbeddedVideo

final class mutiny.models.EmbeddedVideo[source]

Represents a website embed video.

url

The video’s URL.

Type

str

width

The video’s width.

Type

int

height

The video’s height.

Type

int