gaato/discord/model does not have a README file

    ApplicationId

    type ApplicationId = Id[ApplicationMarker]

    The ID of an application.

    AttachmentId

    type AttachmentId = Id[AttachmentMarker]

    The ID of an attachment.

    AuditLogEntryId

    type AuditLogEntryId = Id[AuditLogEntryMarker]

    The ID of an audit log entry.

    AutoModerationRuleId

    type AutoModerationRuleId = Id[AutoModerationRuleMarker]

    The ID of an auto moderation rule.

    ChannelId

    type ChannelId = Id[ChannelMarker]

    The ID of a channel.

    CommandId

    type CommandId = Id[CommandMarker]

    The ID of a command.

    CommandVersionId

    type CommandVersionId = Id[CommandVersionMarker]

    The ID of a command version.

    EmojiId

    type EmojiId = Id[EmojiMarker]

    The ID of an emoji.

    EntitlementId

    type EntitlementId = Id[EntitlementMarker]

    The ID of an entitlement.

    GenericId

    type GenericId = Id[GenericMarker]

    The ID of a resource whose kind is not tracked in the type.

    GuildId

    type GuildId = Id[GuildMarker]

    The ID of a guild.

    IntegrationId

    type IntegrationId = Id[IntegrationMarker]

    The ID of an integration.

    InteractionId

    type InteractionId = Id[InteractionMarker]

    The ID of an interaction.

    MessageId

    type MessageId = Id[MessageMarker]

    The ID of a message.

    RoleId

    type RoleId = Id[RoleMarker]

    The ID of a role.

    ScheduledEventId

    type ScheduledEventId = Id[ScheduledEventMarker]

    The ID of a scheduled event.

    SkuId

    type SkuId = Id[SkuMarker]

    The ID of a SKU.

    SoundboardSoundId

    type SoundboardSoundId = Id[SoundboardSoundMarker]

    The ID of a soundboard sound.

    StageInstanceId

    type StageInstanceId = Id[StageInstanceMarker]

    The ID of a stage instance.

    StickerId

    type StickerId = Id[StickerMarker]

    The ID of a sticker.

    StickerPackId

    type StickerPackId = Id[StickerPackMarker]

    The ID of a sticker pack.

    SubscriptionId

    type SubscriptionId = Id[SubscriptionMarker]

    The ID of a subscription.

    TeamId

    type TeamId = Id[TeamMarker]

    The ID of a team.

    UserId

    type UserId = Id[UserMarker]

    The ID of a user.

    WebhookId

    type WebhookId = Id[WebhookMarker]

    The ID of a webhook.

    AllowedMentionsError

    pub(all) suberror AllowedMentionsError {
    ParseAndExplicit(typ~ : AllowedMentionType)
    TooManyRoles(count~ : Int)
    TooManyUsers(count~ : Int)
    } derive(Eq,
    Debug
    )

    An invalid allowed-mentions configuration rejected during construction.

    GatewayCommandError

    pub(all) suberror GatewayCommandError {
    InvalidCommand(LimitViolation)
    } derive(
    Debug
    )

    An invalid outgoing Gateway command, with the offending field and reason.

    TimestampError

    pub suberror TimestampError {
    InvalidTimestamp(String)
    } derive(
    Debug
    )

    Raised when a string is not a valid ISO 8601 timestamp.

    ActionMetadata

    pub(all) struct ActionMetadata {
    channel_id : Id[ChannelMarker]?
    duration_seconds : Int?
    custom_message : Nullable[String]?
    } derive(
    Debug
    ,
    FromJson
    ,
    ToJson
    )

    Optional execution settings for an auto-moderation action.

    custom_message is nullable on the wire: Some(Null) is a rule that explicitly has no custom message, and sending it clears one.

    ActionRow

    A layout row containing nested interactive components.

    ActionRow::to_json

    ActiveGuildThreads

    Active thread channels in a guild and their membership records.

    Activity

    pub(all) struct Activity {
    name : String
    typ : ActivityType
    url : Nullable[String]?
    created_at : Int64
    timestamps : ActivityTimestamps?
    application_id : Id[ApplicationMarker]?
    status_display_type : Nullable[Int]?
    details : Nullable[String]?
    details_url : Nullable[String]?
    state : Nullable[String]?
    state_url : Nullable[String]?
    emoji : Nullable[ActivityEmoji]?
    party : ActivityParty?
    assets : ActivityAssets?
    secrets : ActivitySecrets?
    instance : Bool?
    flags : ActivityFlags?
    buttons : Array[ActivityButton]?
    } derive(
    Debug
    ,
    ToJson
    )

    A Discord presence activity, including the documented Rich Presence fields.

    Activity::to_json

    ActivityAssets

    pub(all) struct ActivityAssets {
    large_image : String?
    large_text : String?
    large_url : String?
    small_image : String?
    small_text : String?
    small_url : String?
    invite_cover_image : String?
    } derive(
    Debug
    ,
    FromJson
    ,
    ToJson
    )

    Rich-presence artwork references and their hover texts.

    ActivityButton

    pub(all) struct ActivityButton {
    label : String
    url : String
    } derive(
    Debug
    ,
    FromJson
    ,
    ToJson
    )

    A custom label/url button shown on a rich presence.

    ActivityEmoji

    pub(all) struct ActivityEmoji {
    name : String
    id : Id[EmojiMarker]?
    animated : Bool?
    } derive(
    Debug
    ,
    FromJson
    ,
    ToJson
    )

    The custom or unicode emoji attached to a custom status.

    ActivityFlags

    pub(all) struct ActivityFlags(UInt64) derive(Eq)

    Bit set describing which rich-presence interactions an activity supports.

    ActivityFlags::bits

    fn ActivityFlags::bits(self : ActivityFlags) -> UInt64

    The raw bit field.

    ActivityFlags::embedded

    fn ActivityFlags::embedded() -> ActivityFlags

    The activity is embedded.

    ActivityFlags::from_bits

    fn ActivityFlags::from_bits(bits : UInt64) -> ActivityFlags

    Flags from a raw bit field; unknown bits are kept.

    ActivityFlags::instance

    fn ActivityFlags::instance() -> ActivityFlags

    The activity is an instanced game session.

    ActivityFlags::join

    The activity supports joining.

    ActivityFlags::join_request

    fn ActivityFlags::join_request() -> ActivityFlags

    The activity supports join requests.

    ActivityFlags::party_privacy_friends

    fn ActivityFlags::party_privacy_friends() -> ActivityFlags

    The activity party is available to friends.

    ActivityFlags::party_privacy_voice_channel

    fn ActivityFlags::party_privacy_voice_channel() -> ActivityFlags

    The activity party is available to the voice channel.

    ActivityFlags::play

    The activity supports playing.

    ActivityFlags::spectate

    fn ActivityFlags::spectate() -> ActivityFlags

    The activity supports spectating.

    ActivityFlags::sync

    The activity supports synchronization.

    ActivityFlags::to_json

    ActivityInstance

    pub(all) struct ActivityInstance {
    application_id : Id[ApplicationMarker]
    instance_id : String
    launch_id : Id[GenericMarker]
    location : ActivityLocation
    users : Array[Id[UserMarker]]
    } derive(
    Debug
    ,
    FromJson
    ,
    ToJson
    )

    A live instance of an application activity.

    ActivityLocation

    The Discord location hosting an application activity instance.

    ActivityLocationKind

    pub(all) enum ActivityLocationKind {
    GuildChannel
    PrivateChannel
    Unknown(String)
    } derive(Eq,
    Debug
    )

    The channel context hosting an application activity instance.

    ActivityLocationKind::from_string

    fn ActivityLocationKind::from_string(value : String) -> ActivityLocationKind

    The ActivityLocationKind for its Discord string value; unknown values become Unknown(s).

    ActivityLocationKind::to_json

    ActivityLocationKind::to_string

    fn ActivityLocationKind::to_string(self : ActivityLocationKind) -> String

    The Discord string value of this ActivityLocationKind.

    ActivityParty

    The rich-presence party, with size as [current, max] when present.

    ActivitySecrets

    pub(all) struct ActivitySecrets {
    join : String?
    spectate : String?
    match_ : String?
    } derive(
    Debug
    ,
    FromJson
    ,
    ToJson
    )

    Secrets for joining or spectating a rich-presence session.

    ActivityTimestamps

    pub(all) struct ActivityTimestamps {
    start : Int64?
    end : Int64?
    } derive(
    Debug
    )

    Unix millisecond start and end times of an activity.

    ActivityTimestamps::to_json

    ActivityTimestampsWire

    type ActivityTimestampsWire derive(
    FromJson
    )

    ActivityType

    pub(all) enum ActivityType {
    Playing
    Streaming
    Listening
    Watching
    Custom
    Competing
    Unknown(Int)
    } derive(Eq,
    Debug
    )

    An activity category reported in a presence update.

    ActivityType::from_int

    fn ActivityType::from_int(value : Int) -> ActivityType

    The ActivityType for its Discord integer value; unknown values become Unknown(n).

    ActivityType::to_int

    fn ActivityType::to_int(self : ActivityType) -> Int

    The Discord integer value of this ActivityType.

    ActivityType::to_json

    ActivityWire

    type ActivityWire derive(
    FromJson
    )

    AllowedMentionType

    pub(all) enum AllowedMentionType {
    Roles
    Users
    Everyone
    } derive(Eq,
    Debug
    )

    A mention category Discord may derive directly from message content.

    AllowedMentionType::to_json

    AllowedMentions

    pub struct AllowedMentions {
    // private fields
    } derive(
    Debug
    )

    Controls which mentions Discord resolves and notifies for an outgoing message.

    Use AllowedMentions(...) so parse categories and explicit ID lists cannot conflict. The stored arrays are copied during construction to preserve that invariant if callers later mutate their input arrays.

    AllowedMentions::AllowedMentions

    fn AllowedMentions::AllowedMentions(parse? : Array[AllowedMentionType], roles? : Array[Id[RoleMarker]], users? : Array[Id[UserMarker]], replied_user? : Bool) -> AllowedMentions raise AllowedMentionsError

    Construct a validated allowed-mentions object.

    test "allow selected users without parsing every user mention" {
    let user_id : @model.UserId = Id(42UL)
    let mentions = @model.AllowedMentions(
    parse=[Roles],
    users=[user_id],
    replied_user=false,
    )
    json_inspect(mentions, content={
    "parse": ["roles"],
    "users": ["42"],
    "replied_user": false,
    })
    }

    AllowedMentions::none

    Suppress every mention parsed from message content.

    AllowedMentions::safe_default

    fn AllowedMentions::safe_default() -> AllowedMentions

    Allow user and role mentions while suppressing @everyone and @here. This is the HTTP client's default for ordinary channel messages.

    AllowedMentions::to_json

    Application

    pub(all) struct Application {
    id : Id[ApplicationMarker]
    name : String
    icon : Nullable[ImageHash]
    description : String
    bot : User?
    owner : User?
    flags : ApplicationFlags?
    flags_new : ApplicationFlags?
    approximate_guild_count : Int?
    approximate_user_install_count : Int?
    rpc_origins : Array[String]?
    bot_public : Bool?
    bot_require_code_grant : Bool?
    terms_of_service_url : String?
    privacy_policy_url : String?
    verify_key : String?
    team : Nullable[Team]?
    guild_id : Id[GuildMarker]?
    guild : PartialGuild?
    primary_sku_id : Id[SkuMarker]?
    slug : String?
    cover_image : ImageHash?
    approximate_user_authorization_count : Int?
    redirect_uris : Array[String]?
    interactions_endpoint_url : Nullable[String]?
    role_connections_verification_url : Nullable[String]?
    event_webhooks_url : Nullable[String]?
    event_webhooks_status : ApplicationEventWebhookStatus?
    event_webhooks_types : Array[String]?
    tags : Array[String]?
    install_params : InstallParams?
    integration_types_config : Map[String, ApplicationIntegrationTypeConfiguration]?
    custom_install_url : String?
    } derive(
    Debug
    ,
    FromJson
    ,
    ToJson
    )

    A Discord application record. Fields that are absent from partial application payloads remain optional on receipt.

    Application::effective_flags

    fn Application::effective_flags(self : Application) -> ApplicationFlags?

    Return Discord's full response bitfield when present, falling back to the legacy numeric flags field for older payloads.

    ApplicationAuthorizedEvent

    pub(all) struct ApplicationAuthorizedEvent {
    integration_type : ApplicationIntegrationType?
    user : User
    scopes : Array[String]
    guild : Guild?
    } derive(
    Debug
    ,
    FromJson
    ,
    ToJson
    )

    Data sent when a user authorizes an application.

    ApplicationCommand

    pub(all) struct ApplicationCommand {
    id : Id[CommandMarker]
    typ : ApplicationCommandType?
    application_id : Id[ApplicationMarker]
    guild_id : Id[GuildMarker]?
    name : String
    name_localizations : Nullable[Map[String, String]]?
    description : String
    description_localizations : Nullable[Map[String, String]]?
    options : Array[CommandOption]?
    default_member_permissions : Nullable[Permissions]
    dm_permission : Bool?
    nsfw : Bool?
    integration_types : Array[ApplicationIntegrationType]?
    contexts : Nullable[Array[InteractionContextType]]?
    version : Id[CommandVersionMarker]
    handler : EntryPointCommandHandlerType?
    name_localized : String?
    description_localized : String?
    } derive(
    Debug
    ,
    FromJson
    ,
    ToJson
    )

    A registered Discord application command.

    ApplicationCommandPermission

    One role, user, or channel permission override for an application command.

    ApplicationCommandPermissionType

    pub(all) enum ApplicationCommandPermissionType {
    Role
    User
    Channel
    Unknown(Int)
    } derive(Eq,
    Debug
    )

    The target kind of an application-command permission override.

    ApplicationCommandPermissionType::from_int

    The ApplicationCommandPermissionType for its Discord integer value; unknown values become Unknown(n).

    ApplicationCommandPermissionType::to_int

    The Discord integer value of this ApplicationCommandPermissionType.

    ApplicationCommandType

    pub(all) enum ApplicationCommandType {
    ChatInput
    User
    Message
    PrimaryEntryPoint
    Unknown(Int)
    } derive(Eq,
    Debug
    )

    The invocation category of an application command.

    ApplicationCommandType::from_int

    fn ApplicationCommandType::from_int(value : Int) -> ApplicationCommandType

    The ApplicationCommandType for its Discord integer value; unknown values become Unknown(n).

    ApplicationCommandType::to_int

    The Discord integer value of this ApplicationCommandType.

    ApplicationCommandType::to_json

    ApplicationDeauthorizedEvent

    Data sent when a user deauthorizes an application.

    ApplicationEventWebhookStatus

    pub(all) enum ApplicationEventWebhookStatus {
    Disabled
    Enabled
    DisabledByDiscord
    Unknown(Int)
    } derive(Eq,
    Debug
    )

    Whether Discord delivers event webhooks to the application; DisabledByDiscord means delivery was deactivated for inactivity.

    ApplicationEventWebhookStatus::from_int

    The ApplicationEventWebhookStatus for its Discord integer value; unknown values become Unknown(n).

    ApplicationEventWebhookStatus::to_int

    The Discord integer value of this ApplicationEventWebhookStatus.

    ApplicationEventWebhookStatus::to_json

    ApplicationFlags

    pub(all) struct ApplicationFlags(UInt64) derive(Eq)

    Bit flags describing capabilities and privileged access for an application.

    ApplicationFlags::application_auto_moderation_rule_create_badge

    fn ApplicationFlags::application_auto_moderation_rule_create_badge() -> ApplicationFlags

    App uses the Auto Moderation API.

    ApplicationFlags::application_command_badge

    fn ApplicationFlags::application_command_badge() -> ApplicationFlags

    App has registered global application commands.

    ApplicationFlags::bits

    fn ApplicationFlags::bits(self : ApplicationFlags) -> UInt64

    The raw bit field.

    ApplicationFlags::contains

    fn ApplicationFlags::contains(self : ApplicationFlags, other : ApplicationFlags) -> Bool

    Whether every flag in other is set.

    ApplicationFlags::embedded

    App is embedded within the Discord client.

    ApplicationFlags::embedded_first_party

    fn ApplicationFlags::embedded_first_party() -> ApplicationFlags

    Bit 1 << 20, which Discord sets but does not document.

    ApplicationFlags::embedded_iap

    fn ApplicationFlags::embedded_iap() -> ApplicationFlags

    Bit 1 << 3, which Discord sets but does not document.

    ApplicationFlags::embedded_released

    fn ApplicationFlags::embedded_released() -> ApplicationFlags

    Bit 1 << 1, which Discord sets but does not document.

    ApplicationFlags::from_bits

    fn ApplicationFlags::from_bits(bits : UInt64) -> ApplicationFlags

    Flags from a raw bit field; unknown bits are kept.

    ApplicationFlags::gateway_guild_members

    fn ApplicationFlags::gateway_guild_members() -> ApplicationFlags

    Server members intent for bots in 100 or more servers.

    ApplicationFlags::gateway_guild_members_limited

    fn ApplicationFlags::gateway_guild_members_limited() -> ApplicationFlags

    Server members intent for bots in fewer than 100 servers.

    ApplicationFlags::gateway_message_content

    fn ApplicationFlags::gateway_message_content() -> ApplicationFlags

    Message content intent for bots in 100 or more servers.

    ApplicationFlags::gateway_message_content_limited

    fn ApplicationFlags::gateway_message_content_limited() -> ApplicationFlags

    Message content intent for bots in fewer than 100 servers.

    ApplicationFlags::gateway_presence

    fn ApplicationFlags::gateway_presence() -> ApplicationFlags

    Presence intent for bots in 100 or more servers.

    ApplicationFlags::gateway_presence_limited

    fn ApplicationFlags::gateway_presence_limited() -> ApplicationFlags

    Presence intent for bots in fewer than 100 servers.

    ApplicationFlags::group_dm_create

    fn ApplicationFlags::group_dm_create() -> ApplicationFlags

    Bit 1 << 4, which Discord sets but does not document.

    ApplicationFlags::managed_emoji

    fn ApplicationFlags::managed_emoji() -> ApplicationFlags

    Bit 1 << 2, which Discord sets but does not document.

    ApplicationFlags::none

    No flags set.

    ApplicationFlags::rpc_has_connected

    fn ApplicationFlags::rpc_has_connected() -> ApplicationFlags

    Bit 1 << 11, which Discord sets but does not document.

    ApplicationFlags::to_json

    ApplicationFlags::verification_pending_guild_limit

    fn ApplicationFlags::verification_pending_guild_limit() -> ApplicationFlags

    Unusual growth of the app is preventing verification.

    ApplicationIdentity

    pub(all) struct ApplicationIdentity {
    user_id : Id[UserMarker]?
    provider_type : String
    provider_id : String?
    provider_issued_user_id : String
    } derive(
    Debug
    ,
    FromJson
    ,
    ToJson
    )

    An external account identity associated with a Discord user and application.

    ApplicationIdentityDynamicField

    A custom game statistic dispatched by its numeric wire discriminator. Unknown variants retain their complete JSON object for forward-compatible round trips.

    ApplicationIdentityDynamicField::to_json

    ApplicationIdentityDynamicMediaField

    A media-valued custom game statistic.

    ApplicationIdentityDynamicNumberField

    pub(all) struct ApplicationIdentityDynamicNumberField {
    name : String
    value : Double
    } derive(
    Debug
    ,
    FromJson
    ,
    ToJson
    )

    A number-valued custom game statistic.

    ApplicationIdentityDynamicStringField

    pub(all) struct ApplicationIdentityDynamicStringField {
    name : String
    value : String
    } derive(Eq,
    Debug
    ,
    FromJson
    ,
    ToJson
    )

    A text-valued custom game statistic.

    ApplicationIdentityPrimaryProfileData

    pub(all) struct ApplicationIdentityPrimaryProfileData {
    season : String?
    rank_name : String?
    rank_image : ApplicationIdentityProfileMedia?
    highest_rank : String?
    highest_rank_image : ApplicationIdentityProfileMedia?
    featured_played_character : String?
    featured_played_character_image : ApplicationIdentityProfileMedia?
    playtime_hours : Double?
    total_wins : Int?
    current_period_wins : Int?
    total_games : Int?
    current_period_games : Int?
    total_kills : Int?
    current_period_kills : Int?
    total_assists : Int?
    current_period_assists : Int?
    total_deaths : Int?
    current_period_deaths : Int?
    } derive(
    Debug
    ,
    FromJson
    ,
    ToJson
    )

    Pre-configured game statistics in an application identity profile.

    ApplicationIdentityProfile

    Profile data attached to a user's application identity.

    ApplicationIdentityProfileData

    Game statistics stored in an application identity profile.

    ApplicationIdentityProfileMedia

    pub(all) struct ApplicationIdentityProfileMedia {
    url : String
    } derive(Eq,
    Debug
    ,
    FromJson
    ,
    ToJson
    )

    A media value stored in an application identity profile.

    ApplicationIntegrationType

    pub(all) enum ApplicationIntegrationType {
    GuildInstall
    UserInstall
    Unknown(Int)
    } derive(Eq,
    Debug
    )

    Where an application command is installed.

    ApplicationIntegrationType::from_int

    The ApplicationIntegrationType for its Discord integer value; unknown values become Unknown(n).

    ApplicationIntegrationType::to_int

    The Discord integer value of this ApplicationIntegrationType.

    ApplicationIntegrationType::to_json

    ApplicationIntegrationTypeConfiguration

    pub(all) struct ApplicationIntegrationTypeConfiguration {
    oauth2_install_params : InstallParams?
    } derive(
    Debug
    ,
    FromJson
    ,
    ToJson
    )

    Installation settings for one application integration context.

    ApplicationMarker

    pub enum ApplicationMarker {
    }

    Phantom marker types for Id[M]. These are empty enums: they have no values and exist only at the type level.

    ApplicationRoleConnection

    pub(all) struct ApplicationRoleConnection {
    platform_name : Nullable[String]?
    platform_username : Nullable[String]?
    metadata :
    Json
    ?
    } derive(
    Debug
    ,
    FromJson
    ,
    ToJson
    )

    Metadata attached to a user's application role connection. Discord may omit any field, for example on a connection the application never set.

    ApplicationRoleConnectionMetadata

    pub(all) struct ApplicationRoleConnectionMetadata {
    typ : ApplicationRoleConnectionMetadataType
    key : String
    name : String
    name_localizations : Nullable[Map[String, String]]?
    description : String
    description_localizations : Nullable[Map[String, String]]?
    } derive(
    Debug
    ,
    FromJson
    ,
    ToJson
    )

    One application role connection metadata record.

    ApplicationRoleConnectionMetadataType

    pub(all) enum ApplicationRoleConnectionMetadataType {
    IntegerLessThanOrEqual
    IntegerGreaterThanOrEqual
    IntegerEqual
    IntegerNotEqual
    DatetimeLessThanOrEqual
    DatetimeGreaterThanOrEqual
    BooleanEqual
    BooleanNotEqual
    Unknown(Int)
    } derive(Eq,
    Debug
    )

    The comparison used for an application role connection metadata record.

    ApplicationRoleConnectionMetadataType::from_int

    The ApplicationRoleConnectionMetadataType for its Discord integer value; unknown values become Unknown(n).

    ApplicationRoleConnectionMetadataType::to_int

    The Discord integer value of this ApplicationRoleConnectionMetadataType.

    ArchivedThreads

    Archived thread channels and their membership records.

    Attachment

    pub(all) struct Attachment {
    id : Id[AttachmentMarker]
    filename : String
    title : String?
    description : String?
    content_type : String?
    size : Int
    url : String
    proxy_url : String
    height : Nullable[Int]?
    width : Nullable[Int]?
    ephemeral : Bool?
    duration_secs : Double?
    waveform : String?
    flags : AttachmentFlags?
    placeholder : String?
    placeholder_version : Int?
    clip_participants : Array[User]?
    clip_created_at : Timestamp?
    application : Nullable[Application]?
    } derive(
    Debug
    ,
    FromJson
    ,
    ToJson
    )

    A file attached to a Discord message.

    proxy_url serves images and videos (which carry width and height) and passes audio through unmodified; for any other file Discord's media proxy answers 415 Unsupported Media Type, so fetch url instead.

    Attachment::to_json

    AttachmentFlags

    pub(all) struct AttachmentFlags(UInt64) derive(Eq)

    Bit flags describing special properties of an attachment.

    AttachmentFlags::bits

    fn AttachmentFlags::bits(self : AttachmentFlags) -> UInt64

    The raw bit field.

    AttachmentFlags::contains

    fn AttachmentFlags::contains(self : AttachmentFlags, other : AttachmentFlags) -> Bool

    Whether every flag in other is set.

    AttachmentFlags::contains_explicit_content

    fn AttachmentFlags::contains_explicit_content() -> AttachmentFlags

    The attachment was flagged as explicit content. Discord's content scanning sets it, possibly after the message is sent: check the message you send and any later Message Update.

    AttachmentFlags::contains_gore_content

    fn AttachmentFlags::contains_gore_content() -> AttachmentFlags

    The attachment was flagged as gore. Discord's content scanning sets it, possibly after the message is sent: check the message you send and any later Message Update.

    AttachmentFlags::contains_self_harm_content

    fn AttachmentFlags::contains_self_harm_content() -> AttachmentFlags

    The attachment was flagged as self-harm content. Discord's content scanning sets it, possibly after the message is sent: check the message you send and any later Message Update.

    AttachmentFlags::from_bits

    fn AttachmentFlags::from_bits(bits : UInt64) -> AttachmentFlags

    Flags from a raw bit field; unknown bits are kept.

    AttachmentFlags::is_animated

    fn AttachmentFlags::is_animated() -> AttachmentFlags

    The attachment is an animated image.

    AttachmentFlags::is_clip

    The attachment is a clip from a stream.

    AttachmentFlags::is_remix

    The attachment has been edited with the remix feature.

    AttachmentFlags::is_spoiler

    fn AttachmentFlags::is_spoiler() -> AttachmentFlags

    The attachment is marked as a spoiler.

    AttachmentFlags::is_thumbnail

    fn AttachmentFlags::is_thumbnail() -> AttachmentFlags

    The attachment is the thumbnail of a clip.

    AttachmentFlags::none

    No flags set.

    AttachmentFlags::to_json

    AttachmentMarker

    pub enum AttachmentMarker {
    }

    Marker for IDs of an attachment.

    AttachmentRequest

    pub(all) struct AttachmentRequest {
    id : Id[AttachmentMarker]
    filename : String?
    title : String?
    description : String?
    duration_secs : Double?
    waveform : String?
    is_spoiler : Bool?
    } derive(
    Debug
    )

    An existing attachment to retain when editing a message, per the documented attachment-request structure. description and is_spoiler may be updated in place; absent fields are omitted from the wire, leaving them unchanged. New uploads are announced by the typed wrappers from their files parameter instead.

    AttachmentRequest::to_json

    AuditLog

    pub(all) struct AuditLog {
    audit_log_entries : Array[AuditLogEntry]
    users : Array[User]
    webhooks : Array[Webhook]
    integrations : Array[Integration]
    application_commands : Array[ApplicationCommand]
    auto_moderation_rules : Array[AutoModerationRule]
    threads : Array[Channel]
    guild_scheduled_events : Array[GuildScheduledEvent]
    } derive(
    Debug
    ,
    FromJson
    ,
    ToJson
    )

    A guild audit log with referenced domain objects.

    AuditLog::to_json

    AuditLogChange

    A raw before-and-after field change recorded in an audit entry.

    AuditLogEntry

    pub(all) struct AuditLogEntry {
    target_id : Nullable[String]
    changes : Array[AuditLogChange]?
    user_id : Nullable[Id[UserMarker]]
    id : Id[AuditLogEntryMarker]
    action_type : AuditLogEvent
    options :
    Json
    ?
    reason : String?
    } derive(
    Debug
    ,
    FromJson
    ,
    ToJson
    )

    One actor action recorded in a guild audit log.

    AuditLogEntryMarker

    pub enum AuditLogEntryMarker {
    }

    Marker for IDs of an audit log entry.

    AuditLogEvent

    pub(all) enum AuditLogEvent {
    GuildUpdate
    ChannelCreate
    ChannelUpdate
    ChannelDelete
    ChannelOverwriteCreate
    ChannelOverwriteUpdate
    ChannelOverwriteDelete
    ChannelPositionUpdate
    MemberKick
    MemberPrune
    MemberBanAdd
    MemberBanRemove
    MemberUpdate
    MemberRoleUpdate
    MemberMove
    MemberDisconnect
    BotAdd
    RoleCreate
    RoleUpdate
    RoleDelete
    RolePositionUpdate
    InviteCreate
    InviteUpdate
    InviteDelete
    WebhookCreate
    WebhookUpdate
    WebhookDelete
    EmojiCreate
    EmojiUpdate
    EmojiDelete
    MessageDelete
    MessageBulkDelete
    MessagePin
    MessageUnpin
    IntegrationCreate
    IntegrationUpdate
    IntegrationDelete
    StageInstanceCreate
    StageInstanceUpdate
    StageInstanceDelete
    StickerCreate
    StickerUpdate
    StickerDelete
    GuildScheduledEventCreate
    GuildScheduledEventUpdate
    GuildScheduledEventDelete
    ThreadCreate
    ThreadUpdate
    ThreadDelete
    ApplicationCommandPermissionUpdate
    SoundboardSoundCreate
    SoundboardSoundUpdate
    SoundboardSoundDelete
    AutoModerationRuleCreate
    AutoModerationRuleUpdate
    AutoModerationRuleDelete
    AutoModerationBlockMessage
    AutoModerationFlagToChannel
    AutoModerationUserCommunicationDisabled
    AutoModerationQuarantineUser
    CreatorMonetizationRequestCreated
    CreatorMonetizationTermsAccepted
    OnboardingPromptCreate
    OnboardingPromptUpdate
    OnboardingPromptDelete
    OnboardingCreate
    OnboardingUpdate
    HomeSettingsCreate
    HomeSettingsUpdate
    VoiceChannelStatusCreate
    VoiceChannelStatusDelete
    Unknown(Int)
    } derive(Eq,
    Debug
    )

    The action category recorded by a guild audit log.

    AuditLogEvent::from_int

    fn AuditLogEvent::from_int(value : Int) -> AuditLogEvent

    The AuditLogEvent for its Discord integer value; unknown values become Unknown(n).

    AuditLogEvent::to_int

    fn AuditLogEvent::to_int(self : AuditLogEvent) -> Int

    The Discord integer value of this AuditLogEvent.

    AuditLogEvent::to_json

    AuthorizationInformation

    pub(all) struct AuthorizationInformation {
    application : Application
    scopes : Array[String]
    expires : Timestamp
    user : User?
    } derive(
    Debug
    ,
    FromJson
    ,
    ToJson
    )

    Details about the OAuth2 authorization represented by an access token.

    Discord returns a partial application object here. Application is safe for that payload because it requires only the guaranteed id, name, icon, and description fields; all other application fields are optional.

    AutoModerationAction

    An action executed when an auto-moderation rule matches.

    AutoModerationActionExecutionEvent

    pub(all) struct AutoModerationActionExecutionEvent {
    guild_id : Id[GuildMarker]
    action : AutoModerationAction
    rule_id : Id[AutoModerationRuleMarker]
    rule_trigger_type : AutoModerationTriggerType
    user_id : Id[UserMarker]
    channel_id : Id[ChannelMarker]?
    message_id : Id[MessageMarker]?
    alert_system_message_id : Id[MessageMarker]?
    content : String
    matched_keyword : Nullable[String]
    matched_content : Nullable[String]
    } derive(
    Debug
    ,
    FromJson
    ,
    ToJson
    )

    An auto-moderation action was executed against user content.

    AutoModerationActionType

    pub(all) enum AutoModerationActionType {
    BlockMessage
    SendAlertMessage
    Timeout
    BlockMemberInteraction
    Unknown(Int)
    } derive(Eq,
    Debug
    )

    The operation performed by auto moderation.

    AutoModerationActionType::from_int

    The AutoModerationActionType for its Discord integer value; unknown values become Unknown(n).

    AutoModerationActionType::to_int

    The Discord integer value of this AutoModerationActionType.

    AutoModerationActionType::to_json

    AutoModerationEventType

    pub(all) enum AutoModerationEventType {
    MessageSend
    MemberUpdate
    Unknown(Int)
    } derive(Eq,
    Debug
    )

    The guild event evaluated by an auto-moderation rule.

    AutoModerationEventType::from_int

    The AutoModerationEventType for its Discord integer value; unknown values become Unknown(n).

    AutoModerationEventType::to_int

    The Discord integer value of this AutoModerationEventType.

    AutoModerationEventType::to_json

    AutoModerationKeywordPresetType

    pub(all) enum AutoModerationKeywordPresetType {
    Profanity
    SexualContent
    Slurs
    Unknown(Int)
    } derive(Eq,
    Debug
    )

    A built-in keyword set used by auto moderation.

    AutoModerationKeywordPresetType::from_int

    The AutoModerationKeywordPresetType for its Discord integer value; unknown values become Unknown(n).

    AutoModerationKeywordPresetType::to_int

    The Discord integer value of this AutoModerationKeywordPresetType.

    AutoModerationKeywordPresetType::to_json

    AutoModerationRule

    pub(all) struct AutoModerationRule {
    id : Id[AutoModerationRuleMarker]
    guild_id : Id[GuildMarker]
    name : String
    creator_id : Id[UserMarker]
    event_type : AutoModerationEventType
    trigger_type : AutoModerationTriggerType
    trigger_metadata : TriggerMetadata
    actions : Array[AutoModerationAction]
    enabled : Bool
    exempt_roles : Array[Id[RoleMarker]]
    exempt_channels : Array[Id[ChannelMarker]]
    } derive(
    Debug
    ,
    FromJson
    ,
    ToJson
    )

    A guild auto-moderation rule and its configured actions.

    AutoModerationRuleMarker

    pub enum AutoModerationRuleMarker {
    }

    Marker for IDs of an auto moderation rule.

    AutoModerationTriggerType

    pub(all) enum AutoModerationTriggerType {
    Keyword
    Spam
    KeywordPreset
    MentionSpam
    MemberProfile
    Unknown(Int)
    } derive(Eq,
    Debug
    )

    The condition category that activates an auto-moderation rule.

    AutoModerationTriggerType::from_int

    The AutoModerationTriggerType for its Discord integer value; unknown values become Unknown(n).

    AutoModerationTriggerType::to_int

    The Discord integer value of this AutoModerationTriggerType.

    AutoModerationTriggerType::to_json

    AvailableGuildCreateEvent

    pub(all) struct AvailableGuildCreateEvent {
    guild : Guild
    joined_at : Timestamp
    large : Bool
    unavailable : Bool?
    member_count : Int
    voice_states : Array[VoiceState]
    members : Array[GuildMember]
    channels : Array[Channel]
    threads : Array[Channel]
    presences : Array[PresenceUpdateEvent]
    stage_instances : Array[StageInstance]
    guild_scheduled_events : Array[GuildScheduledEvent]
    soundboard_sounds : Array[SoundboardSound]
    } derive(
    Debug
    )

    The complete guild and gateway-only collections sent when it becomes available to the client.

    AvatarDecorationData

    Metadata identifying the decoration displayed over a user's avatar.

    BaseTheme

    pub(all) enum BaseTheme {
    Unset
    Dark
    Light
    Darker
    Midnight
    Unknown(Int)
    } derive(Eq,
    Debug
    )

    The base client theme a SharedClientTheme gradient is mixed against.
    impl ToJson for BaseTheme

    BaseTheme::from_int

    fn BaseTheme::from_int(value : Int) -> BaseTheme

    The BaseTheme for its Discord integer value; unknown values become Unknown(n).

    BaseTheme::to_int

    fn BaseTheme::to_int(self : BaseTheme) -> Int

    The Discord integer value of this BaseTheme.

    BaseTheme::to_json

    BotActivity

    pub(all) struct BotActivity {
    name : String
    type_ : ActivityType
    state : String?
    url : String?
    } derive(
    Debug
    ,
    ToJson
    )

    The activity fields bot users may send, separate from received activities.

    BotActivity::competing

    fn BotActivity::competing(name : String) -> BotActivity

    Show a competing activity.

    BotActivity::custom

    fn BotActivity::custom(state : String) -> BotActivity

    Show custom status text using the conventional name Custom Status.

    BotActivity::listening

    fn BotActivity::listening(name : String) -> BotActivity

    Show a listening activity.

    BotActivity::playing

    fn BotActivity::playing(name : String) -> BotActivity

    Show a playing activity.

    BotActivity::streaming

    fn BotActivity::streaming(name : String, url : String) -> BotActivity

    Show a streaming activity with a Twitch or YouTube URL.

    BotActivity::watching

    fn BotActivity::watching(name : String) -> BotActivity

    Show a watching activity.

    BulkBanResponse

    The result of banning several users in one request.

    Button

    pub(all) struct Button {
    id : Int?
    style : ButtonStyle
    label : String?
    emoji : Emoji?
    custom_id : String?
    sku_id : Id[SkuMarker]?
    url : String?
    disabled : Bool?
    } derive(
    Debug
    ,
    FromJson
    ,
    ToJson
    )

    A clickable button component.

    Button::to_json

    ButtonStyle

    pub(all) enum ButtonStyle {
    Primary
    Secondary
    Success
    Danger
    Link
    Premium
    Unknown(Int)
    } derive(Eq,
    Debug
    )

    The visual and behavioral style of a button.

    ButtonStyle::from_int

    fn ButtonStyle::from_int(value : Int) -> ButtonStyle

    The ButtonStyle for its Discord integer value; unknown values become Unknown(n).

    ButtonStyle::to_int

    fn ButtonStyle::to_int(self : ButtonStyle) -> Int

    The Discord integer value of this ButtonStyle.

    ButtonStyle::to_json

    Channel

    pub(all) struct Channel {
    id : Id[ChannelMarker]
    typ : ChannelType
    guild_id : Id[GuildMarker]?
    position : Int?
    permission_overwrites : Array[Overwrite]?
    name : Nullable[String]?
    topic : Nullable[String]?
    nsfw : Bool?
    last_message_id : Nullable[Id[MessageMarker]]?
    bitrate : Int?
    user_limit : Int?
    rate_limit_per_user : Int?
    recipients : Array[User]?
    icon : Nullable[ImageHash]?
    owner_id : Id[UserMarker]?
    application_id : Nullable[Id[ApplicationMarker]]?
    managed : Bool?
    parent_id : Nullable[Id[ChannelMarker]]?
    last_pin_timestamp : Nullable[Timestamp]?
    rtc_region : Nullable[String]?
    video_quality_mode : VideoQualityMode?
    message_count : Int?
    member_count : Int?
    thread_metadata : ThreadMetadata?
    thread_member : ThreadMember?
    default_auto_archive_duration : ThreadAutoArchiveDuration?
    permissions : Permissions?
    app_permissions : Permissions?
    flags : ChannelFlags?
    total_message_sent : Int?
    available_tags : Array[ForumTag]?
    applied_tags : Array[Id[GenericMarker]]?
    default_reaction_emoji : Nullable[DefaultReaction]?
    default_thread_rate_limit_per_user : Int?
    default_sort_order : Nullable[SortOrderType]?
    default_forum_layout : ForumLayoutType?
    } derive(
    Debug
    ,
    FromJson
    ,
    ToJson
    )

    A flat channel model covering every Discord channel variant.

    Channel::is_obfuscated

    fn Channel::is_obfuscated(self : Channel) -> Bool

    Whether Discord obfuscated this channel's metadata because the bot cannot view it (CHANNEL_OBFUSCATED flag). Only id, typ, position and parent_id are reliable on an obfuscated channel; a CHANNEL_UPDATE with the full data follows once the bot gains access.

    Channel::to_json

    ChannelFlags

    pub(all) struct ChannelFlags(UInt64) derive(Eq)

    Bit flags describing special behavior assigned to a channel.

    ChannelFlags::active_channels_removed

    fn ChannelFlags::active_channels_removed() -> ChannelFlags

    Bit 1 << 2, which Discord sets but does not document.

    ChannelFlags::bits

    fn ChannelFlags::bits(self : ChannelFlags) -> UInt64

    The raw bit field.

    ChannelFlags::channel_obfuscated

    fn ChannelFlags::channel_obfuscated() -> ChannelFlags

    Set on channels received over the gateway whose metadata Discord has obfuscated because the bot cannot view them. Only id, type, position and parent_id are reliable on such a channel; the HTTP API omits these channels instead of setting this flag.

    ChannelFlags::clyde_ai

    fn ChannelFlags::clyde_ai() -> ChannelFlags

    Bit 1 << 8, which Discord sets but does not document.

    ChannelFlags::contains

    fn ChannelFlags::contains(self : ChannelFlags, other : ChannelFlags) -> Bool

    Whether every flag in other is set.

    ChannelFlags::from_bits

    fn ChannelFlags::from_bits(bits : UInt64) -> ChannelFlags

    Flags from a raw bit field; unknown bits are kept.

    ChannelFlags::guild_feed_removed

    fn ChannelFlags::guild_feed_removed() -> ChannelFlags

    Bit 1 << 0, which Discord sets but does not document.

    ChannelFlags::hide_media_download_options

    fn ChannelFlags::hide_media_download_options() -> ChannelFlags

    Hides the media download options; only available in media channels.

    ChannelFlags::is_guild_resource_channel

    fn ChannelFlags::is_guild_resource_channel() -> ChannelFlags

    Bit 1 << 7, which Discord sets but does not document.

    ChannelFlags::is_scheduled_for_deletion

    fn ChannelFlags::is_scheduled_for_deletion() -> ChannelFlags

    Bit 1 << 9, which Discord sets but does not document.

    ChannelFlags::is_spam

    fn ChannelFlags::is_spam() -> ChannelFlags

    Bit 1 << 5, which Discord sets but does not document.

    ChannelFlags::is_spoiler_channel

    fn ChannelFlags::is_spoiler_channel() -> ChannelFlags

    A Spoiler Channel: users must opt in to view its contents.

    ChannelFlags::none

    No flags set.

    ChannelFlags::pinned

    fn ChannelFlags::pinned() -> ChannelFlags

    The thread is pinned to the top of its parent forum or media channel.

    ChannelFlags::require_tag

    fn ChannelFlags::require_tag() -> ChannelFlags

    A tag must be applied when creating a post in a forum or media channel.

    ChannelFlags::to_json

    ChannelInfo

    pub(all) struct ChannelInfo {
    id : Id[ChannelMarker]
    status : Nullable[String]?
    voice_start_time : Nullable[Int64]?
    } derive(
    Debug
    ,
    FromJson
    ,
    ToJson
    )

    Ephemeral status and voice-session data for one channel.

    ChannelInfoEvent

    Ephemeral voice-channel information returned for a guild.

    ChannelInfoField

    pub(all) enum ChannelInfoField {
    Status
    VoiceStartTime
    Other(String)
    } derive(Eq,
    Debug
    )

    An ephemeral channel field; Other preserves future field names.

    ChannelInfoField::to_json

    ChannelMarker

    pub enum ChannelMarker {
    }

    Marker for IDs of a channel.

    ChannelMention

    A channel referenced directly in message content.

    ChannelPins

    One page from GET /channels/{channel.id}/messages/pins.

    ChannelPinsUpdateEvent

    pub(all) struct ChannelPinsUpdateEvent {
    guild_id : Id[GuildMarker]?
    channel_id : Id[ChannelMarker]
    last_pin_timestamp : Nullable[Timestamp]?
    } derive(
    Debug
    ,
    FromJson
    ,
    ToJson
    )

    The most recent pin timestamp changed for a channel.

    ChannelType

    pub(all) enum ChannelType {
    GuildText
    Dm
    GuildVoice
    GroupDm
    GuildCategory
    GuildAnnouncement
    AnnouncementThread
    PublicThread
    PrivateThread
    GuildStageVoice
    GuildDirectory
    GuildForum
    GuildMedia
    Unknown(Int)
    } derive(Eq,
    Debug
    )

    The type of a channel.

    This is the reference implementation of the wire-enum pattern used across the whole model layer: an Unknown(raw) catch-all so decoding never fails on values Discord adds later, plus total to_int/from_int conversions and hand-written JSON impls (the derived enum representation is not Discord's scalar encoding).

    ChannelType::from_int

    fn ChannelType::from_int(value : Int) -> ChannelType

    The ChannelType for its Discord integer value; unknown values become Unknown(n).

    ChannelType::to_int

    fn ChannelType::to_int(self : ChannelType) -> Int

    The Discord integer value of this ChannelType.

    ChannelType::to_json

    Checkbox

    pub(all) struct Checkbox {
    id : Int?
    custom_id : String
    default : Bool?
    value : Bool?
    } derive(
    Debug
    ,
    FromJson
    ,
    ToJson
    )

    A single modal checkbox.

    Checkbox::to_json

    CheckboxGroup

    pub(all) struct CheckboxGroup {
    id : Int?
    custom_id : String
    options : Array[RadioOption]
    min_values : Int?
    max_values : Int?
    required : Bool?
    values : Array[String]?
    } derive(
    Debug
    ,
    FromJson
    ,
    ToJson
    )

    A modal checkbox group accepting zero or more options.

    ClientStatus

    The Discord client families on which a user is active.

    Collectibles

    Collectible profile cosmetics owned by a user or guild member.

    CommandData

    Application-command data carried by command and autocomplete interactions.

    CommandDataOption

    A submitted command option with its raw scalar or nested option value.

    CommandMarker

    pub enum CommandMarker {
    }

    Marker for IDs of a command.

    CommandOption

    pub(all) struct CommandOption {
    typ : CommandOptionType
    name : String
    name_localizations : Nullable[Map[String, String]]?
    description : String
    description_localizations : Nullable[Map[String, String]]?
    required : Bool?
    choices : Array[CommandOptionChoice]?
    options : Array[CommandOption]?
    channel_types : Array[ChannelType]?
    min_value :
    Json
    ?
    max_value :
    Json
    ?
    min_length : Int?
    max_length : Int?
    autocomplete : Bool?
    file_types : Array[FileTypeFilter]?
    } derive(
    Debug
    ,
    FromJson
    ,
    ToJson
    )

    A flat command option supporting every current slash-command option shape.

    CommandOptionChoice

    pub(all) struct CommandOptionChoice {
    name : String
    name_localizations : Nullable[Map[String, String]]?
    value :
    Json

    } derive(
    Debug
    ,
    FromJson
    ,
    ToJson
    )

    A named value offered as a predefined command option choice.

    CommandOptionType

    pub(all) enum CommandOptionType {
    SubCommand
    SubCommandGroup
    String
    Integer
    Boolean
    User
    Channel
    Role
    Mentionable
    Number
    Attachment
    Unknown(Int)
    } derive(Eq,
    Debug
    )

    The value category accepted by a command option.

    CommandOptionType::from_int

    fn CommandOptionType::from_int(value : Int) -> CommandOptionType

    The CommandOptionType for its Discord integer value; unknown values become Unknown(n).

    CommandOptionType::to_int

    fn CommandOptionType::to_int(self : CommandOptionType) -> Int

    The Discord integer value of this CommandOptionType.

    CommandOptionType::to_json

    CommandVersionMarker

    pub enum CommandVersionMarker {
    }

    Marker for IDs of a command version.

    Component

    pub(all) enum Component {
    ActionRow(ActionRow)
    Button(Button)
    StringSelect(SelectMenu)
    TextInput(TextInput)
    UserSelect(SelectMenu)
    RoleSelect(SelectMenu)
    MentionableSelect(SelectMenu)
    ChannelSelect(SelectMenu)
    Section(Section)
    TextDisplay(TextDisplay)
    Thumbnail(Thumbnail)
    MediaGallery(MediaGallery)
    File(FileComponent)
    Separator(Separator)
    Container(Container)
    Label(Label)
    FileUpload(FileUpload)
    RadioGroup(RadioGroup)
    CheckboxGroup(CheckboxGroup)
    Checkbox(Checkbox)
    Unknown(
    Json
    )
    } derive(
    Debug
    )

    A Discord message component dispatched by its numeric wire discriminator.
    impl ToJson for Component

    Component::to_json

    ComponentData

    pub(all) struct ComponentData {
    custom_id : String
    component_type : Int
    values : Array[String]?
    resolved : ResolvedData?
    } derive(
    Debug
    ,
    FromJson
    ,
    ToJson
    )

    Component-specific data carried by a message component interaction.

    Connection

    pub(all) struct Connection {
    id : String
    name : String
    typ : ConnectionService
    revoked : Bool?
    integrations : Array[Integration]?
    verified : Bool
    friend_sync : Bool
    show_activity : Bool
    two_way_link : Bool
    visibility : Int
    } derive(
    Debug
    ,
    FromJson
    ,
    ToJson
    )

    A user's linked external service account.

    Connection::to_json

    ConnectionService

    pub(all) enum ConnectionService {
    AmazonMusic
    BattleNet
    Bluesky
    BungieNet
    Crunchyroll
    Domain
    Ebay
    EpicGames
    Facebook
    Github
    Instagram
    LeagueOfLegends
    Mastodon
    Paypal
    PlaystationNetwork
    Reddit
    RiotGames
    Roblox
    Spotify
    Skype
    Steam
    Tiktok
    Twitch
    X
    Xbox
    Youtube
    Unknown(String)
    } derive(Eq,
    Debug
    )

    An external service linked to a Discord user account.

    ConnectionService::from_string

    fn ConnectionService::from_string(value : String) -> ConnectionService

    The ConnectionService for its Discord string value; unknown values become Unknown(s).

    ConnectionService::to_json

    ConnectionService::to_string

    fn ConnectionService::to_string(self : ConnectionService) -> String

    The Discord string value of this ConnectionService.

    Container

    pub(all) struct Container {
    id : Int?
    components : Array[Component]
    accent_color : Nullable[Int]?
    spoiler : Bool?
    } derive(
    Debug
    ,
    FromJson
    ,
    ToJson
    )

    A Components v2 container with an optional accent color.

    Container::to_json

    ContentScanFlags

    pub(all) struct ContentScanFlags(UInt64) derive(Eq)

    Bit flags recording what Discord's content scanning found in a media item.

    ContentScanFlags::bits

    fn ContentScanFlags::bits(self : ContentScanFlags) -> UInt64

    The raw bit field.

    ContentScanFlags::contains

    fn ContentScanFlags::contains(self : ContentScanFlags, other : ContentScanFlags) -> Bool

    Whether every flag in other is set.

    ContentScanFlags::from_bits

    fn ContentScanFlags::from_bits(bits : UInt64) -> ContentScanFlags

    Flags from a raw bit field; unknown bits are kept.

    ContentScanFlags::is_explicit_content

    fn ContentScanFlags::is_explicit_content() -> ContentScanFlags

    The media was flagged as explicit content.

    ContentScanFlags::is_gore_content

    fn ContentScanFlags::is_gore_content() -> ContentScanFlags

    The media was flagged as gore.

    ContentScanFlags::is_self_harm_content

    fn ContentScanFlags::is_self_harm_content() -> ContentScanFlags

    The media was flagged as self-harm content.

    ContentScanFlags::none

    No flags set.

    ContentScanFlags::to_json

    ContentScanMetadata

    The result of Discord's content scanning for an unfurled media item.

    CurrentUserGuild

    pub(all) struct CurrentUserGuild {
    id : Id[GuildMarker]
    name : String
    icon : Nullable[ImageHash]
    banner : Nullable[ImageHash]
    owner : Bool
    permissions : Permissions
    features : Array[GuildFeature]
    approximate_member_count : Int?
    approximate_presence_count : Int?
    } derive(
    Debug
    ,
    FromJson
    ,
    ToJson
    )

    The partial guild representation returned for the current user's guilds.

    DefaultMessageNotifications

    pub(all) enum DefaultMessageNotifications {
    AllMessages
    OnlyMentions
    Unknown(Int)
    } derive(Eq,
    Debug
    )

    Discord's default message notification level.

    DefaultMessageNotifications::from_int

    The DefaultMessageNotifications for its Discord integer value; unknown values become Unknown(n).

    DefaultMessageNotifications::to_int

    The Discord integer value of this DefaultMessageNotifications.

    DefaultMessageNotifications::to_json

    DefaultReaction

    The default custom or Unicode reaction for a forum or media channel.

    Embed

    pub(all) struct Embed {
    title : String?
    typ : EmbedType?
    url : String?
    description : String?
    timestamp : Timestamp?
    color : Int?
    footer : EmbedFooter?
    image : EmbedImage?
    thumbnail : EmbedThumbnail?
    video : EmbedVideo?
    provider : EmbedProvider?
    author : EmbedAuthor?
    fields : Array[EmbedField]?
    components : Array[Component]?
    flags : EmbedFlags?
    } derive(
    Debug
    ,
    FromJson
    ,
    ToJson
    )

    Rich content embedded in a Discord message.

    Use Embed(...) to construct outgoing embeds from fields Discord accepts when sending. Embed models remain public records so received metadata can be inspected. Pass outgoing values to Client::create_message(embeds=[...]), CommandReply::message(embeds=[...]), ctx.respond, or a followup method. Discord applies its documented embed count and text-length limits.

    test "construct an outgoing embed" {
    let embed = @model.Embed(
    title="Build complete",
    description="All checks passed.",
    timestamp=Timestamp("2026-07-15T00:00:00Z"),
    color=0x57F287,
    footer=EmbedFooter("build 42"),
    fields=[
    EmbedField("Target", "native", inline=true),
    EmbedField("Tests", "325 passed", inline=true),
    ],
    )
    json_inspect(embed, content={
    "title": "Build complete",
    "description": "All checks passed.",
    "timestamp": "2026-07-15T00:00:00Z",
    "color": 5763719,
    "footer": { "text": "build 42" },
    "fields": [
    { "name": "Target", "value": "native", "inline": true },
    { "name": "Tests", "value": "325 passed", "inline": true },
    ],
    })
    }

    Embed::Embed

    fn Embed::Embed(title? : String, description? : String, url? : String, timestamp? : Timestamp, color? : Int, footer? : EmbedFooter, image? : EmbedImage, thumbnail? : EmbedThumbnail, author? : EmbedAuthor, fields? : Array[EmbedField]) -> Embed

    Construct an embed containing only fields accepted in outgoing payloads. Receive-only fields are left unset. The fields array is copied so later mutations of the caller's array do not affect the embed.

    Embed::to_json

    EmbedAuthor

    pub(all) struct EmbedAuthor {
    name : String
    url : String?
    icon_url : String?
    proxy_icon_url : String?
    } derive(
    Debug
    ,
    FromJson
    ,
    ToJson
    )

    Author information displayed at the top of an embed.

    EmbedAuthor::EmbedAuthor

    fn EmbedAuthor::EmbedAuthor(name : String, url? : String, icon_url? : String) -> EmbedAuthor

    Construct author information for an outgoing embed.

    EmbedField

    pub(all) struct EmbedField {
    name : String
    value : String
    inline : Bool?
    } derive(
    Debug
    ,
    FromJson
    ,
    ToJson
    )

    A named value displayed in an embed's field grid.

    EmbedField::EmbedField

    fn EmbedField::EmbedField(name : String, value : String, inline? : Bool) -> EmbedField

    Construct a field for an outgoing embed.

    EmbedField::to_json

    EmbedFlags

    pub(all) struct EmbedFlags(UInt64) derive(Eq)

    Bit flags describing special rendering behavior of an embed.
    impl Debug for EmbedFlags

    EmbedFlags::bits

    fn EmbedFlags::bits(self : EmbedFlags) -> UInt64

    The raw bit field.

    EmbedFlags::contains_explicit_content

    fn EmbedFlags::contains_explicit_content() -> EmbedFlags

    The embed's media was flagged as explicit content. Discord's content scanning sets it, possibly after the message is sent: check the message you send and any later Message Update.

    EmbedFlags::contains_gore_content

    fn EmbedFlags::contains_gore_content() -> EmbedFlags

    The embed's media was flagged as gore. Discord's content scanning sets it, possibly after the message is sent: check the message you send and any later Message Update.

    EmbedFlags::contains_self_harm_content

    fn EmbedFlags::contains_self_harm_content() -> EmbedFlags

    The embed's media was flagged as self-harm content. Discord's content scanning sets it, possibly after the message is sent: check the message you send and any later Message Update.

    EmbedFlags::from_bits

    fn EmbedFlags::from_bits(bits : UInt64) -> EmbedFlags

    Flags from a raw bit field; unknown bits are kept.

    EmbedFlags::is_content_inventory_entry

    fn EmbedFlags::is_content_inventory_entry() -> EmbedFlags

    The embed is a fallback for a reply to an activity card.

    EmbedFlags::to_json

    EmbedFooter

    pub(all) struct EmbedFooter {
    text : String
    icon_url : String?
    proxy_icon_url : String?
    } derive(
    Debug
    ,
    FromJson
    ,
    ToJson
    )

    Footer text and optional icon URLs for an embed.

    EmbedFooter::EmbedFooter

    fn EmbedFooter::EmbedFooter(text : String, icon_url? : String) -> EmbedFooter

    Construct footer content for an outgoing embed.

    EmbedImage

    pub(all) struct EmbedImage {
    url : String
    proxy_url : String?
    height : Int?
    width : Int?
    content_type : String?
    placeholder : String?
    placeholder_version : Int?
    description : String?
    flags : Int?
    } derive(
    Debug
    ,
    FromJson
    ,
    ToJson
    )

    Image media displayed within an embed.

    EmbedImage::EmbedImage

    fn EmbedImage::EmbedImage(url : String) -> EmbedImage

    Construct image media for an outgoing embed.

    EmbedImage::to_json

    EmbedProvider

    pub(all) struct EmbedProvider {
    name : String?
    url : String?
    } derive(
    Debug
    ,
    FromJson
    ,
    ToJson
    )

    Attribution information for the provider of an embed.

    EmbedThumbnail

    pub(all) struct EmbedThumbnail {
    url : String
    proxy_url : String?
    height : Int?
    width : Int?
    } derive(
    Debug
    ,
    FromJson
    ,
    ToJson
    )

    Thumbnail media displayed beside an embed.

    EmbedThumbnail::EmbedThumbnail

    fn EmbedThumbnail::EmbedThumbnail(url : String) -> EmbedThumbnail

    Construct thumbnail media for an outgoing embed.

    EmbedType

    pub(all) enum EmbedType {
    Rich
    Image
    Video
    Gifv
    Article
    Link
    AutoModerationMessage
    PollResult
    Components
    Unknown(String)
    } derive(Eq,
    Debug
    )

    The string discriminator describing an embed's rendering category.
    impl ToJson for EmbedType

    EmbedType::from_string

    fn EmbedType::from_string(value : String) -> EmbedType

    The EmbedType for its Discord string value; unknown values become Unknown(s).

    EmbedType::to_json

    EmbedType::to_string

    fn EmbedType::to_string(self : EmbedType) -> String

    The Discord string value of this EmbedType.

    EmbedVideo

    pub(all) struct EmbedVideo {
    url : String?
    proxy_url : String?
    height : Int?
    width : Int?
    content_type : String?
    placeholder : String?
    placeholder_version : Int?
    description : String?
    flags : Int?
    } derive(
    Debug
    ,
    FromJson
    ,
    ToJson
    )

    Video media attached to an embed.

    EmbedVideo::to_json

    Emoji

    pub(all) struct Emoji {
    id : Nullable[Id[EmojiMarker]]?
    name : Nullable[String]
    animated : Bool?
    roles : Array[Id[RoleMarker]]?
    user : User?
    require_colons : Bool?
    managed : Bool?
    available : Bool?
    } derive(
    Debug
    ,
    FromJson
    ,
    ToJson
    )

    A Discord custom or reaction emoji.

    Emoji::to_json

    EmojiMarker

    pub enum EmojiMarker {
    }

    Marker for IDs of an emoji.

    Entitlement

    pub(all) struct Entitlement {
    id : Id[EntitlementMarker]
    sku_id : Id[SkuMarker]
    application_id : Id[ApplicationMarker]
    user_id : Id[UserMarker]?
    typ : EntitlementType
    deleted : Bool
    starts_at : Nullable[Timestamp]?
    ends_at : Nullable[Timestamp]?
    guild_id : Id[GuildMarker]?
    consumed : Bool?
    } derive(
    Debug
    ,
    FromJson
    ,
    ToJson
    )

    A grant of access to a Discord application SKU.

    EntitlementMarker

    pub enum EntitlementMarker {
    }

    Marker for IDs of an entitlement.

    EntitlementOwnerType

    pub(all) enum EntitlementOwnerType {
    Guild
    User
    Unknown(Int)
    } derive(Eq,
    Debug
    )

    The owner scope used when creating a test entitlement.

    EntitlementOwnerType::from_int

    fn EntitlementOwnerType::from_int(value : Int) -> EntitlementOwnerType

    The EntitlementOwnerType for its Discord integer value; unknown values become Unknown(n).

    EntitlementOwnerType::to_int

    fn EntitlementOwnerType::to_int(self : EntitlementOwnerType) -> Int

    The Discord integer value of this EntitlementOwnerType.

    EntitlementOwnerType::to_json

    EntitlementType

    pub(all) enum EntitlementType {
    Purchase
    PremiumSubscription
    DeveloperGift
    TestModePurchase
    FreePurchase
    UserGift
    PremiumPurchase
    ApplicationSubscription
    Unknown(Int)
    } derive(Eq,
    Debug
    )

    The origin of an application entitlement.

    EntitlementType::from_int

    fn EntitlementType::from_int(value : Int) -> EntitlementType

    The EntitlementType for its Discord integer value; unknown values become Unknown(n).

    EntitlementType::to_int

    fn EntitlementType::to_int(self : EntitlementType) -> Int

    The Discord integer value of this EntitlementType.

    EntitlementType::to_json

    EntityMetadata

    Optional metadata describing a scheduled event's external entity.

    EntryPointCommandHandlerType

    pub(all) enum EntryPointCommandHandlerType {
    AppHandler
    DiscordLaunchActivity
    Unknown(Int)
    } derive(Eq,
    Debug
    )

    The handler used for a primary entry-point command.

    EntryPointCommandHandlerType::from_int

    The EntryPointCommandHandlerType for its Discord integer value; unknown values become Unknown(n).

    EntryPointCommandHandlerType::to_int

    The Discord integer value of this EntryPointCommandHandlerType.

    EntryPointCommandHandlerType::to_json

    Event

    pub(all) enum Event {
    ApplicationCommandPermissionsUpdate(GuildApplicationCommandPermissions)
    AutoModerationActionExecution(AutoModerationActionExecutionEvent)
    AutoModerationRuleCreate(AutoModerationRule)
    AutoModerationRuleDelete(AutoModerationRule)
    AutoModerationRuleUpdate(AutoModerationRule)
    ChannelCreate(Channel)
    ChannelDelete(Channel)
    ChannelInfo(ChannelInfoEvent)
    ChannelPinsUpdate(ChannelPinsUpdateEvent)
    ChannelUpdate(Channel)
    EntitlementCreate(Entitlement)
    EntitlementDelete(Entitlement)
    EntitlementUpdate(Entitlement)
    GuildAuditLogEntryCreate(GuildAuditLogEntryCreateEvent)
    GuildBanAdd(GuildBanEvent)
    GuildBanRemove(GuildBanEvent)
    GuildCreate(GuildCreateEvent)
    GuildDelete(UnavailableGuild)
    GuildEmojisUpdate(GuildEmojisUpdateEvent)
    GuildIntegrationsUpdate(GuildIntegrationsUpdateEvent)
    GuildMemberAdd(GuildMemberAddEvent)
    GuildMemberRemove(GuildMemberRemoveEvent)
    GuildMembersChunk(GuildMembersChunkEvent)
    GuildMemberUpdate(GuildMemberUpdateEvent)
    GuildRoleCreate(GuildRoleEvent)
    GuildRoleDelete(GuildRoleDeleteEvent)
    GuildRoleUpdate(GuildRoleEvent)
    GuildScheduledEventCreate(GuildScheduledEvent)
    GuildScheduledEventDelete(GuildScheduledEvent)
    GuildScheduledEventUpdate(GuildScheduledEvent)
    GuildScheduledEventUserAdd(GuildScheduledEventUserEvent)
    GuildScheduledEventUserRemove(GuildScheduledEventUserEvent)
    GuildSoundboardSoundCreate(SoundboardSound)
    GuildSoundboardSoundDelete(GuildSoundboardSoundDeleteEvent)
    GuildSoundboardSoundsUpdate(SoundboardSoundsEvent)
    GuildSoundboardSoundUpdate(SoundboardSound)
    SoundboardSounds(SoundboardSoundsEvent)
    GuildStickersUpdate(GuildStickersUpdateEvent)
    GuildUpdate(Guild)
    IntegrationCreate(IntegrationEvent)
    IntegrationDelete(IntegrationDeleteEvent)
    IntegrationUpdate(IntegrationEvent)
    InteractionCreate(Interaction)
    InviteCreate(InviteCreateEvent)
    InviteDelete(InviteDeleteEvent)
    MessageCreate(MessageCreateEvent)
    MessageDelete(MessageDeleteEvent)
    MessageDeleteBulk(MessageDeleteBulkEvent)
    MessagePollVoteAdd(MessagePollVoteEvent)
    MessagePollVoteRemove(MessagePollVoteEvent)
    MessageReactionAdd(MessageReactionAddEvent)
    MessageReactionRemove(MessageReactionRemoveEvent)
    MessageReactionRemoveAll(MessageReactionRemoveAllEvent)
    MessageReactionRemoveEmoji(MessageReactionRemoveEmojiEvent)
    MessageUpdate(MessageUpdateEvent)
    PresenceUpdate(PresenceUpdateEvent)
    RateLimited(GatewayRateLimitedEvent)
    Ready(Ready)
    Resumed
    StageInstanceCreate(StageInstance)
    StageInstanceDelete(StageInstance)
    StageInstanceUpdate(StageInstance)
    SubscriptionCreate(Subscription)
    SubscriptionDelete(Subscription)
    SubscriptionUpdate(Subscription)
    ThreadCreate(ThreadCreateEvent)
    ThreadDelete(ThreadDeleteEvent)
    ThreadListSync(ThreadListSyncEvent)
    ThreadMembersUpdate(ThreadMembersUpdateEvent)
    ThreadMemberUpdate(ThreadMemberUpdateEvent)
    ThreadUpdate(Channel)
    TypingStart(TypingStartEvent)
    UserUpdate(User)
    VoiceChannelEffectSend(VoiceChannelEffectSendEvent)
    VoiceChannelStartTimeUpdate(VoiceChannelStartTimeUpdateEvent)
    VoiceChannelStatusUpdate(VoiceChannelStatusUpdateEvent)
    VoiceServerUpdate(VoiceServerUpdateEvent)
    VoiceStateUpdate(VoiceState)
    WebhooksUpdate(WebhooksUpdateEvent)
    Unknown(t~ : String, d~ :
    Json
    )
    } derive(
    Debug
    )

    A gateway dispatch event decoded by its wire event name.

    Unknown event names retain both the name and payload for forward compatibility.

    EventKind

    pub(all) enum EventKind {
    KApplicationCommandPermissionsUpdate
    KAutoModerationActionExecution
    KAutoModerationRuleCreate
    KAutoModerationRuleDelete
    KAutoModerationRuleUpdate
    KChannelCreate
    KChannelDelete
    KChannelInfo
    KChannelPinsUpdate
    KChannelUpdate
    KEntitlementCreate
    KEntitlementDelete
    KEntitlementUpdate
    KGuildAuditLogEntryCreate
    KGuildBanAdd
    KGuildBanRemove
    KGuildCreate
    KGuildDelete
    KGuildEmojisUpdate
    KGuildIntegrationsUpdate
    KGuildMemberAdd
    KGuildMemberRemove
    KGuildMembersChunk
    KGuildMemberUpdate
    KGuildRoleCreate
    KGuildRoleDelete
    KGuildRoleUpdate
    KGuildScheduledEventCreate
    KGuildScheduledEventDelete
    KGuildScheduledEventUpdate
    KGuildScheduledEventUserAdd
    KGuildScheduledEventUserRemove
    KGuildSoundboardSoundCreate
    KGuildSoundboardSoundDelete
    KGuildSoundboardSoundsUpdate
    KGuildSoundboardSoundUpdate
    KSoundboardSounds
    KGuildStickersUpdate
    KGuildUpdate
    KIntegrationCreate
    KIntegrationDelete
    KIntegrationUpdate
    KInteractionCreate
    KInviteCreate
    KInviteDelete
    KMessageCreate
    KMessageDelete
    KMessageDeleteBulk
    KMessagePollVoteAdd
    KMessagePollVoteRemove
    KMessageReactionAdd
    KMessageReactionRemove
    KMessageReactionRemoveAll
    KMessageReactionRemoveEmoji
    KMessageUpdate
    KPresenceUpdate
    KRateLimited
    KReady
    KResumed
    KStageInstanceCreate
    KStageInstanceDelete
    KStageInstanceUpdate
    KSubscriptionCreate
    KSubscriptionDelete
    KSubscriptionUpdate
    KThreadCreate
    KThreadDelete
    KThreadListSync
    KThreadMembersUpdate
    KThreadMemberUpdate
    KThreadUpdate
    KTypingStart
    KUserUpdate
    KVoiceChannelEffectSend
    KVoiceChannelStartTimeUpdate
    KVoiceChannelStatusUpdate
    KVoiceServerUpdate
    KVoiceStateUpdate
    KWebhooksUpdate
    KUnknown
    } derive(Eq,
    Debug
    )

    A dispatch event category without its payload.

    EventKind::of_name

    fn EventKind::of_name(t : String) -> EventKind

    Map a gateway dispatch name (e.g. "MESSAGE_CREATE") to its kind; unrecognized names map to KUnknown.

    EventKind::required_intents

    fn EventKind::required_intents(self : EventKind) -> Intents

    Gateway intents that can cause this dispatch event to be delivered.

    Events shared by guild and direct-message contexts return the union of both intents. MESSAGE_CONTENT is deliberately absent because it controls field visibility rather than event delivery.

    ExplicitContentFilter

    pub(all) enum ExplicitContentFilter {
    Disabled
    MembersWithoutRoles
    AllMembers
    Unknown(Int)
    } derive(Eq,
    Debug
    )

    Discord's explicit content filter level.

    ExplicitContentFilter::from_int

    fn ExplicitContentFilter::from_int(value : Int) -> ExplicitContentFilter

    The ExplicitContentFilter for its Discord integer value; unknown values become Unknown(n).

    ExplicitContentFilter::to_int

    The Discord integer value of this ExplicitContentFilter.

    ExplicitContentFilter::to_json

    FileComponent

    pub(all) struct FileComponent {
    id : Int?
    file : UnfurledMediaItem
    spoiler : Bool?
    name : String?
    size : Int?
    } derive(
    Debug
    ,
    FromJson
    ,
    ToJson
    )

    A file attachment rendered as a Components v2 file component.

    FileTypeFilter

    pub(all) enum FileTypeFilter {
    Image
    Video
    Audio
    Extension(String)
    Unknown(String)
    } derive(Eq,
    Debug
    )

    One entry of a file_types upload filter (File Upload components and ATTACHMENT command options): a Discord preset group or a dot-prefixed extension. Discord matches only the filename extension, case-insensitively, and accepts at most 10 entries. Prefer the groups: Discord owns their extension lists and may change them.

    test "restrict an upload to images and PDFs" {
    let filter : Array[@model.FileTypeFilter] = [Image, Extension(".pdf")]
    inspect(Json(filter).stringify(), content="[\"image\",\".pdf\"]")
    }

    FileTypeFilter::from_string

    fn FileTypeFilter::from_string(value : String) -> FileTypeFilter

    The FileTypeFilter for its Discord string value; values starting with . become Extension, other unknown values become Unknown(s).

    FileTypeFilter::to_json

    FileTypeFilter::to_string

    fn FileTypeFilter::to_string(self : FileTypeFilter) -> String

    The Discord string value of this FileTypeFilter.

    FileUpload

    pub(all) struct FileUpload {
    id : Int?
    custom_id : String
    min_values : Int?
    max_values : Int?
    required : Bool?
    values : Array[String]?
    file_types : Array[FileTypeFilter]?
    } derive(
    Debug
    ,
    FromJson
    ,
    ToJson
    )

    A modal file upload component.

    FileUpload::to_json

    FollowedChannel

    The announcement channel and webhook created by following a channel.

    ForumLayoutType

    pub(all) enum ForumLayoutType {
    NotSet
    ListView
    GalleryView
    Unknown(Int)
    } derive(Eq,
    Debug
    )

    The presentation layout used by a forum channel.

    ForumLayoutType::from_int

    fn ForumLayoutType::from_int(value : Int) -> ForumLayoutType

    The ForumLayoutType for its Discord integer value; unknown values become Unknown(n).

    ForumLayoutType::to_int

    fn ForumLayoutType::to_int(self : ForumLayoutType) -> Int

    The Discord integer value of this ForumLayoutType.

    ForumLayoutType::to_json

    ForumTag

    pub(all) struct ForumTag {
    id : Id[GenericMarker]
    name : String
    moderated : Bool
    emoji_id : Nullable[Id[EmojiMarker]]
    emoji_name : Nullable[String]
    } derive(
    Debug
    ,
    FromJson
    ,
    ToJson
    )

    A tag available for categorizing threads in a forum or media channel.

    ForumTag::to_json

    ForumTagRequest

    pub(all) struct ForumTagRequest {
    id : Id[GenericMarker]?
    name : String
    moderated : Bool?
    emoji_id : Id[EmojiMarker]?
    emoji_name : String?
    } derive(
    Debug
    )

    A forum tag as sent in available_tags when creating or modifying a forum or media channel. Only name is required; omit id to create a new tag, keep an existing tag's id to update it in place. At most one of emoji_id and emoji_name may be set.

    ForumTagRequest::to_json

    GameDirectMessage

    pub(all) struct GameDirectMessage {
    id : Id[MessageMarker]
    typ : MessageType?
    content : String?
    channel_id : Id[ChannelMarker]?
    channel : Channel?
    author : User?
    recipient_id : Id[UserMarker]?
    timestamp : Timestamp?
    edited_timestamp : Nullable[Timestamp]?
    flags : MessageFlags?
    application_id : Id[ApplicationMarker]?
    attachments : Array[Attachment]?
    components : Array[Component]?
    activity : MessageActivity?
    application :
    Json
    ?
    raw :
    Json

    } derive(
    Debug
    )

    A compact, lossless view of a Social SDK direct message.

    These webhook objects may be standard messages or the smaller SDK DM shape. Fields that differ between those forms are optional, and raw preserves all unmodeled standard-message and SDK extension fields.

    GameDirectMessage::to_json

    GatewayBotInfo

    pub(all) struct GatewayBotInfo {
    url : String
    shards : Int
    session_start_limit : SessionStartLimit
    } derive(
    Debug
    ,
    FromJson
    ,
    ToJson
    )

    Response of GET /gateway/bot.

    GatewayCapabilities

    pub(all) struct GatewayCapabilities(UInt) derive(Eq)

    Gateway capabilities: the Identify bitfield that opts a client into gateway behaviors (as opposed to Intents, which select events). Unknown bits are preserved. Wire format: JSON number.

    test "opt into channel obfuscation ahead of general availability" {
    let capabilities = @model.GatewayCapabilities::channel_obfuscation()
    inspect(capabilities.bits(), content="32768")
    }

    GatewayCapabilities::bits

    fn GatewayCapabilities::bits(self : GatewayCapabilities) -> UInt

    The raw bit field.

    GatewayCapabilities::channel_obfuscation

    fn GatewayCapabilities::channel_obfuscation() -> GatewayCapabilities

    Receive obfuscated metadata for guild channels the bot cannot view (see ChannelFlags::channel_obfuscated). Discord documents this as a temporary testing opt-in: obfuscation applies to every bot from 2026-11-16.

    GatewayCapabilities::contains

    fn GatewayCapabilities::contains(self : GatewayCapabilities, other : GatewayCapabilities) -> Bool

    Whether every flag in other is set.

    GatewayCapabilities::from_bits

    fn GatewayCapabilities::from_bits(bits : UInt) -> GatewayCapabilities

    Flags from a raw bit field; unknown bits are kept.

    GatewayCapabilities::none

    No flags set.

    GatewayCapabilities::to_json

    GatewayOpcode

    pub(all) enum GatewayOpcode {
    Dispatch
    Heartbeat
    Identify
    PresenceUpdate
    VoiceStateUpdate
    Resume
    Reconnect
    RequestGuildMembers
    InvalidSession
    Hello
    HeartbeatAck
    RequestSoundboardSounds
    RequestChannelInfo
    Unknown(Int)
    } derive(Eq,
    Debug
    )

    Gateway opcodes (send and receive).

    GatewayOpcode::from_int

    fn GatewayOpcode::from_int(value : Int) -> GatewayOpcode

    The GatewayOpcode for its Discord integer value; unknown values become Unknown(n).

    GatewayOpcode::to_int

    fn GatewayOpcode::to_int(self : GatewayOpcode) -> Int

    The Discord integer value of this GatewayOpcode.

    GatewayRateLimitedEvent

    pub(all) struct GatewayRateLimitedEvent {
    opcode : Int
    retry_after : Double
    meta :
    Json

    } derive(
    Debug
    ,
    FromJson
    ,
    ToJson
    )

    A gateway request was rate limited.

    GenericMarker

    pub enum GenericMarker {
    }

    Marker for IDs of a resource whose kind is not tracked in the type.

    Guild

    pub(all) struct Guild {
    id : Id[GuildMarker]
    name : String
    icon : Nullable[ImageHash]
    icon_hash : Nullable[ImageHash]?
    splash : Nullable[ImageHash]
    discovery_splash : Nullable[ImageHash]
    owner : Bool?
    owner_id : Id[UserMarker]
    permissions : Permissions?
    afk_channel_id : Nullable[Id[ChannelMarker]]
    afk_timeout : Int
    widget_enabled : Bool?
    widget_channel_id : Nullable[Id[ChannelMarker]]?
    verification_level : VerificationLevel
    default_message_notifications : DefaultMessageNotifications
    explicit_content_filter : ExplicitContentFilter
    roles : Array[Role]
    emojis : Array[Emoji]
    features : Array[GuildFeature]
    mfa_level : MfaLevel
    application_id : Nullable[Id[ApplicationMarker]]
    system_channel_id : Nullable[Id[ChannelMarker]]
    system_channel_flags : SystemChannelFlags
    rules_channel_id : Nullable[Id[ChannelMarker]]
    max_presences : Nullable[Int]?
    max_members : Int?
    vanity_url_code : Nullable[String]
    description : Nullable[String]
    banner : Nullable[ImageHash]
    premium_tier : PremiumTier
    premium_subscription_count : Int?
    preferred_locale : String
    public_updates_channel_id : Nullable[Id[ChannelMarker]]
    max_video_channel_users : Int?
    max_stage_video_channel_users : Int?
    approximate_member_count : Int?
    approximate_presence_count : Int?
    welcome_screen : WelcomeScreen?
    nsfw_level : NsfwLevel?
    stickers : Array[Sticker]?
    premium_progress_bar_enabled : Bool?
    safety_alerts_channel_id : Nullable[Id[ChannelMarker]]
    incidents_data : Nullable[IncidentsData]?
    } derive(
    Debug
    ,
    FromJson
    ,
    ToJson
    )

    A Discord guild and its configured capabilities.

    Guild::to_json

    GuildApplicationCommandPermissions

    Guild-scoped permission overrides for one application command.

    GuildAuditLogEntryCreateEvent

    pub(all) struct GuildAuditLogEntryCreateEvent {
    guild_id : Id[GuildMarker]
    entry : AuditLogEntry
    } derive(
    Debug
    )

    An audit-log entry created in a guild, decoded from the flattened object.

    GuildBan

    A ban record pairing a user with an optional reason.

    GuildBan::to_json

    GuildBanEvent

    A user ban added to or removed from a guild.

    GuildCreateEvent

    pub(all) enum GuildCreateEvent {
    Available(AvailableGuildCreateEvent)
    Unavailable(UnavailableGuild)
    } derive(
    Debug
    )

    A guild-create dispatch is either a complete available guild or the small unavailable-guild sentinel emitted while Discord is having an outage.

    GuildEmojisUpdateEvent

    Guild emoji collection replacement.

    GuildFeature

    pub(all) enum GuildFeature {
    AnimatedBanner
    AnimatedIcon
    ApplicationCommandPermissionsV2
    AutoModeration
    Banner
    Community
    CreatorMonetizableProvisional
    CreatorStorePage
    DeveloperSupportServer
    Discoverable
    Featurable
    HasDirectoryEntry
    Hub
    InvitesDisabled
    InviteSplash
    LinkedToHub
    MemberVerificationGateEnabled
    MoreSoundboard
    MonetizationEnabled
    MoreStickers
    News
    Partnered
    PreviewEnabled
    PrivateThreads
    RaidAlertsDisabled
    RelayEnabled
    RoleIcons
    RoleSubscriptionsAvailableForPurchase
    RoleSubscriptionsEnabled
    Soundboard
    TicketedEventsEnabled
    VanityUrl
    Verified
    VipRegions
    WelcomeScreenEnabled
    GuildTags
    EnhancedRoleColors
    GuestsEnabled
    PinPermissionMigrationComplete
    PruneRequiresAdmin
    Unknown(String)
    } derive(Eq,
    Debug
    )

    A capability enabled for a Discord guild.

    GuildFeature::from_string

    fn GuildFeature::from_string(value : String) -> GuildFeature

    The GuildFeature for its Discord string value; unknown values become Unknown(s).

    GuildFeature::to_json

    GuildFeature::to_string

    fn GuildFeature::to_string(self : GuildFeature) -> String

    The Discord string value of this GuildFeature.

    GuildIntegrationsUpdateEvent

    Notification that a guild's integrations changed.

    GuildMarker

    pub enum GuildMarker {
    }

    Marker for IDs of a guild.

    GuildMember

    pub(all) struct GuildMember {
    user : User?
    nick : Nullable[String]?
    avatar : Nullable[ImageHash]?
    banner : Nullable[ImageHash]?
    roles : Array[Id[RoleMarker]]
    joined_at : Nullable[Timestamp]
    premium_since : Nullable[Timestamp]?
    deaf : Bool?
    mute : Bool?
    flags : GuildMemberFlags?
    pending : Bool?
    permissions : Permissions?
    communication_disabled_until : Nullable[Timestamp]?
    avatar_decoration_data : Nullable[AvatarDecorationData]?
    collectibles : Nullable[Collectibles]?
    } derive(
    Debug
    ,
    FromJson
    ,
    ToJson
    )

    A user's membership state and profile within a guild.

    GuildMemberAddEvent

    pub(all) struct GuildMemberAddEvent {
    guild_id : Id[GuildMarker]
    guild_member : GuildMember
    } derive(
    Debug
    )

    A guild member joined event decoded from Discord's flattened member object.

    GuildMemberFlags

    pub(all) struct GuildMemberFlags(UInt64) derive(Eq)

    Bit flags describing onboarding, verification, and moderation member state.

    GuildMemberFlags::auto_mod_quarantined_guild_tag

    fn GuildMemberFlags::auto_mod_quarantined_guild_tag() -> GuildMemberFlags

    The member's guild tag was blocked by AutoMod.

    GuildMemberFlags::automod_quarantined_bio

    fn GuildMemberFlags::automod_quarantined_bio() -> GuildMemberFlags

    Deprecated: the member's bio was blocked by AutoMod.

    GuildMemberFlags::automod_quarantined_username_or_guild_nickname

    fn GuildMemberFlags::automod_quarantined_username_or_guild_nickname() -> GuildMemberFlags

    The member's username or nickname was blocked by AutoMod.

    GuildMemberFlags::bits

    fn GuildMemberFlags::bits(self : GuildMemberFlags) -> UInt64

    The raw bit field.

    GuildMemberFlags::bypasses_verification

    fn GuildMemberFlags::bypasses_verification() -> GuildMemberFlags

    The member is exempt from guild verification requirements.

    GuildMemberFlags::completed_home_actions

    fn GuildMemberFlags::completed_home_actions() -> GuildMemberFlags

    The member has completed the Server Guide actions.

    GuildMemberFlags::completed_onboarding

    fn GuildMemberFlags::completed_onboarding() -> GuildMemberFlags

    The member has completed onboarding.

    GuildMemberFlags::contains

    fn GuildMemberFlags::contains(self : GuildMemberFlags, other : GuildMemberFlags) -> Bool

    Whether every flag in other is set.

    GuildMemberFlags::did_rejoin

    The member has left and rejoined the guild.

    GuildMemberFlags::dm_settings_upsell_acknowledged

    fn GuildMemberFlags::dm_settings_upsell_acknowledged() -> GuildMemberFlags

    The member has dismissed the DM settings upsell.

    GuildMemberFlags::from_bits

    fn GuildMemberFlags::from_bits(bits : UInt64) -> GuildMemberFlags

    Flags from a raw bit field; unknown bits are kept.

    GuildMemberFlags::is_guest

    The member is a guest and can only access the voice channel they were invited to.

    GuildMemberFlags::none

    No flags set.

    GuildMemberFlags::started_home_actions

    fn GuildMemberFlags::started_home_actions() -> GuildMemberFlags

    The member has started the Server Guide actions.

    GuildMemberFlags::started_onboarding

    fn GuildMemberFlags::started_onboarding() -> GuildMemberFlags

    The member has started onboarding.

    GuildMemberFlags::to_json

    GuildMemberRemoveEvent

    A user removed from a guild.

    GuildMemberUpdateEvent

    pub(all) struct GuildMemberUpdateEvent {
    guild_id : Id[GuildMarker]
    roles : Array[Id[RoleMarker]]
    user : User
    nick : Nullable[String]?
    avatar : Nullable[ImageHash]
    banner : Nullable[ImageHash]?
    collectibles : Nullable[Collectibles]?
    joined_at : Nullable[Timestamp]
    premium_since : Nullable[Timestamp]?
    deaf : Bool?
    mute : Bool?
    pending : Bool?
    communication_disabled_until : Nullable[Timestamp]?
    flags : GuildMemberFlags?
    avatar_decoration_data : Nullable[AvatarDecorationData]?
    } derive(
    Debug
    ,
    FromJson
    ,
    ToJson
    )

    Mutable guild-member fields delivered by GUILD_MEMBER_UPDATE.

    GuildMembersChunkEvent

    pub(all) struct GuildMembersChunkEvent {
    guild_id : Id[GuildMarker]
    members : Array[GuildMember]
    chunk_index : Int
    chunk_count : Int
    not_found : Array[
    Json
    ]?
    presences : Array[PresenceUpdateEvent]?
    nonce : String?
    } derive(
    Debug
    ,
    FromJson
    ,
    ToJson
    )

    A chunk returned by a gateway guild-member request.

    GuildMessageSearchResults

    pub(all) struct GuildMessageSearchResults {
    doing_deep_historical_index : Bool?
    documents_indexed : Int?
    total_results : Int?
    messages : Array[Array[Message]]?
    threads : Array[Channel]?
    members : Array[ThreadMember]?
    retry_after : Int?
    code : Int?
    message : String?
    } derive(
    Debug
    ,
    FromJson
    ,
    ToJson
    )

    A guild message search response. All fields are optional because Discord returns either completed results or an HTTP 202 indexing response. When retry_after is Some, the search index was not ready and the caller should retry after that many seconds.

    GuildOnboarding

    pub(all) struct GuildOnboarding {
    guild_id : Id[GuildMarker]
    prompts : Array[OnboardingPrompt]
    default_channel_ids : Array[Id[ChannelMarker]]
    enabled : Bool
    mode : OnboardingMode
    } derive(
    Debug
    ,
    FromJson
    ,
    ToJson
    )

    A guild's onboarding configuration.

    GuildPreview

    pub(all) struct GuildPreview {
    id : Id[GuildMarker]
    name : String
    icon : Nullable[ImageHash]
    splash : Nullable[ImageHash]
    discovery_splash : Nullable[ImageHash]
    emojis : Array[Emoji]
    features : Array[GuildFeature]
    approximate_member_count : Int
    approximate_presence_count : Int
    description : Nullable[String]
    stickers : Array[Sticker]
    } derive(
    Debug
    ,
    FromJson
    ,
    ToJson
    )

    A guild's public preview, available for discoverable guilds.

    GuildPruneResult

    The number of members pruned, or null when a begin-prune request did not compute the count.

    GuildRoleDeleteEvent

    A role deleted from a guild.

    GuildRoleEvent

    A role created or updated in a guild.

    GuildScheduledEvent

    pub(all) struct GuildScheduledEvent {
    id : Id[ScheduledEventMarker]
    guild_id : Id[GuildMarker]
    channel_id : Nullable[Id[ChannelMarker]]
    creator_id : Nullable[Id[UserMarker]]?
    name : String
    description : Nullable[String]?
    scheduled_start_time : Timestamp
    scheduled_end_time : Nullable[Timestamp]
    privacy_level : GuildScheduledEventPrivacyLevel
    status : GuildScheduledEventStatus
    entity_type : GuildScheduledEventEntityType
    entity_id : Nullable[Id[GenericMarker]]
    entity_metadata : Nullable[EntityMetadata]
    creator : User?
    user_count : Int?
    image : Nullable[ImageHash]?
    recurrence_rule : Nullable[GuildScheduledEventRecurrenceRule]
    } derive(
    Debug
    ,
    FromJson
    ,
    ToJson
    )

    A guild event scheduled for a stage, voice channel, or external location.

    GuildScheduledEventEntityType

    pub(all) enum GuildScheduledEventEntityType {
    StageInstance
    Voice
    External
    Unknown(Int)
    } derive(Eq,
    Debug
    )

    The hosting entity used by a scheduled event.

    GuildScheduledEventEntityType::from_int

    The GuildScheduledEventEntityType for its Discord integer value; unknown values become Unknown(n).

    GuildScheduledEventEntityType::to_int

    The Discord integer value of this GuildScheduledEventEntityType.

    GuildScheduledEventEntityType::to_json

    GuildScheduledEventPrivacyLevel

    pub(all) enum GuildScheduledEventPrivacyLevel {
    GuildOnly
    Unknown(Int)
    } derive(Eq,
    Debug
    )

    The audience allowed to access a scheduled event.

    GuildScheduledEventPrivacyLevel::from_int

    The GuildScheduledEventPrivacyLevel for its Discord integer value; unknown values become Unknown(n).

    GuildScheduledEventPrivacyLevel::to_int

    The Discord integer value of this GuildScheduledEventPrivacyLevel.

    GuildScheduledEventPrivacyLevel::to_json

    GuildScheduledEventRecurrenceRule

    A recurrence schedule attached to a guild scheduled event.

    GuildScheduledEventRecurrenceRuleFrequency

    pub(all) enum GuildScheduledEventRecurrenceRuleFrequency {
    Yearly
    Monthly
    Weekly
    Daily
    Unknown(Int)
    } derive(Eq,
    Debug
    )

    The base period used by a scheduled-event recurrence rule.

    GuildScheduledEventRecurrenceRuleFrequency::from_int

    The GuildScheduledEventRecurrenceRuleFrequency for its Discord integer value; unknown values become Unknown(n).

    GuildScheduledEventRecurrenceRuleFrequency::to_int

    The Discord integer value of this GuildScheduledEventRecurrenceRuleFrequency.

    GuildScheduledEventRecurrenceRuleMonth

    pub(all) enum GuildScheduledEventRecurrenceRuleMonth {
    January
    February
    March
    April
    May
    June
    July
    August
    September
    October
    November
    December
    Unknown(Int)
    } derive(Eq,
    Debug
    )

    A calendar month used by a scheduled-event recurrence rule.

    GuildScheduledEventRecurrenceRuleMonth::from_int

    The GuildScheduledEventRecurrenceRuleMonth for its Discord integer value; unknown values become Unknown(n).

    GuildScheduledEventRecurrenceRuleMonth::to_int

    The Discord integer value of this GuildScheduledEventRecurrenceRuleMonth.

    GuildScheduledEventRecurrenceRuleNWeekday

    An ordinal weekday constraint such as the first Monday of a month.

    GuildScheduledEventRecurrenceRuleWeekday

    pub(all) enum GuildScheduledEventRecurrenceRuleWeekday {
    Monday
    Tuesday
    Wednesday
    Thursday
    Friday
    Saturday
    Sunday
    Unknown(Int)
    } derive(Eq,
    Debug
    )

    A weekday used by a scheduled-event recurrence rule (Monday is zero).

    GuildScheduledEventRecurrenceRuleWeekday::from_int

    The GuildScheduledEventRecurrenceRuleWeekday for its Discord integer value; unknown values become Unknown(n).

    GuildScheduledEventRecurrenceRuleWeekday::to_int

    The Discord integer value of this GuildScheduledEventRecurrenceRuleWeekday.

    GuildScheduledEventStatus

    pub(all) enum GuildScheduledEventStatus {
    Scheduled
    Active
    Completed
    Canceled
    Unknown(Int)
    } derive(Eq,
    Debug
    )

    The lifecycle state of a scheduled event.

    GuildScheduledEventStatus::from_int

    The GuildScheduledEventStatus for its Discord integer value; unknown values become Unknown(n).

    GuildScheduledEventStatus::to_int

    The Discord integer value of this GuildScheduledEventStatus.

    GuildScheduledEventStatus::to_json

    GuildScheduledEventUser

    pub(all) struct GuildScheduledEventUser {
    guild_scheduled_event_id : Id[ScheduledEventMarker]
    user : User
    guild_member : GuildMember?
    } derive(
    Debug
    ,
    FromJson
    ,
    ToJson
    )

    A user interested in a guild scheduled event.

    GuildScheduledEventUserEvent

    pub(all) struct GuildScheduledEventUserEvent {
    guild_scheduled_event_id : Id[ScheduledEventMarker]
    user_id : Id[UserMarker]
    guild_id : Id[GuildMarker]
    } derive(
    Debug
    ,
    FromJson
    ,
    ToJson
    )

    A user added to or removed from a scheduled guild event.

    GuildSoundboardSoundDeleteEvent

    A soundboard sound deleted from a guild.

    GuildStickersUpdateEvent

    Guild sticker collection replacement.

    GuildTemplate

    pub(all) struct GuildTemplate {
    code : String
    name : String
    description : Nullable[String]
    usage_count : Int
    creator_id : Id[UserMarker]
    creator : User
    created_at : Timestamp
    updated_at : Timestamp
    source_guild_id : Id[GuildMarker]
    serialized_source_guild : GuildTemplateSource
    is_dirty : Nullable[Bool]
    } derive(
    Debug
    ,
    FromJson
    ,
    ToJson
    )

    A reusable Discord guild template and its serialized guild snapshot.

    GuildTemplateChannel

    pub(all) struct GuildTemplateChannel {
    id : Int
    typ : ChannelType
    name : String
    position : Int
    topic : Nullable[String]?
    bitrate : Int?
    user_limit : Int?
    nsfw : Bool?
    rate_limit_per_user : Int?
    parent_id : Nullable[Int]?
    permission_overwrites : Array[GuildTemplatePermissionOverwrite]?
    } derive(
    Debug
    ,
    FromJson
    ,
    ToJson
    )

    A channel in a template snapshot, using integer placeholder IDs.

    GuildTemplatePermissionOverwrite

    A permission overwrite using a template placeholder ID.

    GuildTemplatePermissions

    pub(all) struct GuildTemplatePermissions(UInt64) derive(Eq)

    A permission bitset encoded as a JSON number in template snapshots.

    GuildTemplatePermissions::bits

    The raw bit field.

    GuildTemplatePermissions::to_json

    GuildTemplateRole

    pub(all) struct GuildTemplateRole {
    id : Int
    name : String
    permissions : GuildTemplatePermissions
    color : Int
    colors : Nullable[RoleColors]?
    hoist : Bool
    mentionable : Bool
    icon : Nullable[ImageHash]?
    unicode_emoji : Nullable[String]?
    } derive(
    Debug
    ,
    FromJson
    ,
    ToJson
    )

    A role in a template snapshot, using the snapshot's integer placeholder ID.

    GuildTemplateSource

    pub(all) struct GuildTemplateSource {
    name : String?
    description : Nullable[String]?
    region : String?
    verification_level : VerificationLevel?
    default_message_notifications : DefaultMessageNotifications?
    explicit_content_filter : ExplicitContentFilter?
    preferred_locale : String?
    afk_timeout : Int?
    roles : Array[GuildTemplateRole]?
    channels : Array[GuildTemplateChannel]?
    afk_channel_id : Nullable[Int]?
    system_channel_id : Nullable[Int]?
    system_channel_flags : SystemChannelFlags?
    icon_hash : Nullable[ImageHash]?
    } derive(
    Debug
    ,
    FromJson
    ,
    ToJson
    )

    Stable guild settings exposed in a serialized template snapshot.

    Discord uses integer placeholder IDs for nested roles and channels in this payload, so this is intentionally distinct from PartialGuild.

    GuildVanityUrl

    A guild's vanity invite code and its current use count.

    GuildWidget

    pub(all) struct GuildWidget {
    id : Id[GuildMarker]
    name : String
    instant_invite : Nullable[String]
    channels : Array[GuildWidgetChannel]
    members : Array[GuildWidgetMember]
    presence_count : Int
    } derive(
    Debug
    ,
    FromJson
    ,
    ToJson
    )

    The public JSON representation of a guild widget.

    GuildWidgetChannel

    pub(all) struct GuildWidgetChannel {
    id : Id[ChannelMarker]
    name : String
    position : Int
    } derive(
    Debug
    ,
    FromJson
    ,
    ToJson
    )

    A voice channel shown in a public guild widget.

    GuildWidgetMember

    pub(all) struct GuildWidgetMember {
    id : String
    username : String
    discriminator : String
    avatar : Nullable[String]
    status : String
    avatar_url : String
    } derive(
    Debug
    ,
    FromJson
    ,
    ToJson
    )

    An anonymized member shown in a public guild widget. Widget member IDs are opaque strings rather than Discord snowflakes.

    GuildWidgetSettings

    Whether a guild widget is enabled and the channel it links to.

    Hello

    Payload of opcode 10 (Hello).

    Hello::to_json

    pub(all) struct Id[M](UInt64)

    A Discord snowflake ID, tagged with a phantom marker type so that IDs of different resources cannot be mixed up (Id[UserMarker] vs Id[GuildMarker]).

    Wire format: Discord serializes snowflakes as decimal strings (and historically as integers in a few places). We accept both on decode and always emit a string, going through the string representation so values above 2^53 never pass through a Double.

    test "parse and explicitly retag a snowflake" {
    let user_id : @model.UserId = @model.Id::parse("175928847299117063")
    inspect(user_id.to_string(), content="175928847299117063")
    inspect(user_id.timestamp_ms(), content="1462015105796")
    let guild_id : @model.GuildId = user_id.cast()
    assert_eq(guild_id.value(), user_id.value())
    }
    impl Compare for Id[M]
    impl Eq for Id[M]
    impl Hash for Id[M]
    impl Show for Id[M]
    impl Debug for Id[M]
    impl FromJson for Id[M]
    impl ToJson for Id[M]

    Id::cast

    fn[M, N] Id::cast(self : Id[M]) -> Id[N]

    Re-tag an ID with a different marker, for the few places where Discord aliases ID domains (e.g. the @everyone role ID equals the guild ID).

    Id::parse

    fn[M] Id::parse(s : StringView) -> Id[M] raise

    Parse a decimal snowflake string.

    Id::timestamp_ms

    fn[M] Id::timestamp_ms(self : Id[M]) -> Int64

    Milliseconds since the Unix epoch encoded in the snowflake.

    Id::to_json

    fn[M] Id::to_json(self : Id[M]) ->
    Json

    Id::to_string

    fn[M] Id::to_string(self : Id[M]) -> String

    Makes Id::to_string available through Show.

    Id::value

    fn[M] Id::value(self : Id[M]) -> UInt64

    The raw snowflake value.

    ImageHash

    pub(all) struct ImageHash(String) derive(Eq)

    A guild/user avatar or icon hash, kept raw (e.g. a_1269e74af4df7417b13759eae50c83dc).
    impl Debug for ImageHash
    impl ToJson for ImageHash

    ImageHash::is_animated

    fn ImageHash::is_animated(self : ImageHash) -> Bool

    Animated assets (GIF avatars etc.) are prefixed with a_.

    ImageHash::to_json

    ImageHash::to_string

    fn ImageHash::to_string(self : ImageHash) -> String

    The image hash string.

    IncidentsData

    pub(all) struct IncidentsData {
    invites_disabled_until : Nullable[Timestamp]?
    dms_disabled_until : Nullable[Timestamp]?
    dm_spam_detected_at : Nullable[Timestamp]?
    raid_detected_at : Nullable[Timestamp]?
    } derive(
    Debug
    ,
    FromJson
    ,
    ToJson
    )

    Temporary safety restrictions and detection timestamps for a guild.

    InstallParams

    Default OAuth2 installation scopes and bot permissions for an application.

    Integration

    pub(all) struct Integration {
    id : Id[IntegrationMarker]?
    name : String?
    typ : String?
    enabled : Bool?
    syncing : Bool?
    role_id : Id[RoleMarker]?
    enable_emoticons : Bool?
    expire_behavior : IntegrationExpireBehavior?
    expire_grace_period : Int?
    user : User?
    account : IntegrationAccount?
    synced_at : Timestamp?
    subscriber_count : Int?
    revoked : Bool?
    application : IntegrationApplication?
    application_id : Id[ApplicationMarker]?
    scopes : Array[String]?
    } derive(
    Debug
    ,
    FromJson
    ,
    ToJson
    )

    A guild integration. All fields are optional because audit logs and user connections carry documented partial forms of this object.

    IntegrationAccount

    pub(all) struct IntegrationAccount {
    id : String
    name : String
    } derive(
    Debug
    ,
    FromJson
    ,
    ToJson
    )

    The provider-side account an integration is linked to.

    IntegrationApplication

    pub(all) struct IntegrationApplication {
    id : Id[ApplicationMarker]
    name : String
    icon : Nullable[ImageHash]
    description : String
    bot : User?
    } derive(
    Debug
    ,
    FromJson
    ,
    ToJson
    )

    The OAuth2 application backing a Discord-app integration.

    IntegrationDeleteEvent

    A guild integration deletion.

    IntegrationEvent

    pub(all) struct IntegrationEvent {
    guild_id : Id[GuildMarker]
    integration :
    Json

    } derive(
    Debug
    )

    A guild integration payload retained raw alongside its guild id.

    IntegrationExpireBehavior

    pub(all) enum IntegrationExpireBehavior {
    RemoveRole
    Kick
    Unknown(Int)
    } derive(Eq,
    Debug
    )

    What happens to a subscriber when their integration expires.

    IntegrationExpireBehavior::from_int

    The IntegrationExpireBehavior for its Discord integer value; unknown values become Unknown(n).

    IntegrationExpireBehavior::to_int

    The Discord integer value of this IntegrationExpireBehavior.

    IntegrationExpireBehavior::to_json

    IntegrationMarker

    pub enum IntegrationMarker {
    }

    Marker for IDs of an integration.

    Intents

    pub(all) struct Intents(UInt) derive(Eq)

    Gateway intents: the server-side event subscription bitfield sent in Identify. Unknown bits are preserved. Wire format: JSON number.

    test "compose the gateway event subscriptions a bot needs" {
    let intents = @model.Intents::guilds() |
    @model.Intents::guild_messages() |
    @model.Intents::message_content()
    inspect(
    intents.bits(),
    content=(
    #|33281
    ),
    )
    assert_true(intents.contains(@model.Intents::message_content()))
    }
    impl BitAnd for Intents
    impl BitOr for Intents
    impl Debug for Intents
    impl FromJson for Intents
    impl ToJson for Intents

    Intents::auto_moderation_configuration

    fn Intents::auto_moderation_configuration() -> Intents

    AUTO_MODERATION_CONFIGURATION: auto moderation rule events.

    Intents::auto_moderation_execution

    fn Intents::auto_moderation_execution() -> Intents

    AUTO_MODERATION_EXECUTION: auto moderation action execution events.

    Intents::bits

    fn Intents::bits(self : Intents) -> UInt

    The raw bit field.

    Intents::contains

    fn Intents::contains(self : Intents, other : Intents) -> Bool

    Whether every flag in other is set.

    Intents::direct_message_polls

    fn Intents::direct_message_polls() -> Intents

    DIRECT_MESSAGE_POLLS: poll vote events in DM channels.

    Intents::direct_message_reactions

    fn Intents::direct_message_reactions() -> Intents

    DIRECT_MESSAGE_REACTIONS: reaction events in DM channels.

    Intents::direct_message_typing

    fn Intents::direct_message_typing() -> Intents

    DIRECT_MESSAGE_TYPING: typing indicators in DM channels.

    Intents::direct_messages

    fn Intents::direct_messages() -> Intents

    DIRECT_MESSAGES: message events in DM channels.

    Intents::from_bits

    fn Intents::from_bits(bits : UInt) -> Intents

    Flags from a raw bit field; unknown bits are kept.

    Intents::guild_expressions

    fn Intents::guild_expressions() -> Intents

    GUILD_EXPRESSIONS: emoji, sticker, and soundboard sound updates.

    Intents::guild_integrations

    fn Intents::guild_integrations() -> Intents

    GUILD_INTEGRATIONS: integration create, update, and delete events.

    Intents::guild_invites

    fn Intents::guild_invites() -> Intents

    GUILD_INVITES: invite create and delete events.

    Intents::guild_members

    fn Intents::guild_members() -> Intents

    GUILD_MEMBERS (privileged): member join, leave, and update events. Must also be enabled in the developer portal.

    Intents::guild_message_polls

    fn Intents::guild_message_polls() -> Intents

    GUILD_MESSAGE_POLLS: poll vote events in guilds.

    Intents::guild_message_reactions

    fn Intents::guild_message_reactions() -> Intents

    GUILD_MESSAGE_REACTIONS: reaction events in guilds.

    Intents::guild_message_typing

    fn Intents::guild_message_typing() -> Intents

    GUILD_MESSAGE_TYPING: typing indicators in guilds.

    Intents::guild_messages

    fn Intents::guild_messages() -> Intents

    GUILD_MESSAGES: message events in guilds. Content fields also need message_content.

    Intents::guild_moderation

    fn Intents::guild_moderation() -> Intents

    GUILD_MODERATION: ban events and audit log entry creation.

    Intents::guild_presences

    fn Intents::guild_presences() -> Intents

    GUILD_PRESENCES (privileged): member presence updates. Must also be enabled in the developer portal.

    Intents::guild_scheduled_events

    fn Intents::guild_scheduled_events() -> Intents

    GUILD_SCHEDULED_EVENTS: scheduled event lifecycle and user subscription events.

    Intents::guild_voice_states

    fn Intents::guild_voice_states() -> Intents

    GUILD_VOICE_STATES: voice state updates and voice channel effects.

    Intents::guild_webhooks

    fn Intents::guild_webhooks() -> Intents

    GUILD_WEBHOOKS: webhook update events.

    Intents::guilds

    fn Intents::guilds() -> Intents

    GUILDS: guild, channel, thread, role, and stage lifecycle events.

    Intents::message_content

    fn Intents::message_content() -> Intents

    MESSAGE_CONTENT (privileged): unlocks content, embeds, attachments, and components on guild messages not addressed to the bot. Delivers no events by itself; must also be enabled in the developer portal.

    Intents::none

    fn Intents::none() -> Intents

    No flags set.

    Intents::to_json

    Interaction

    pub(all) struct Interaction {
    id : Id[InteractionMarker]
    application_id : Id[ApplicationMarker]
    typ : InteractionType
    data : InteractionData?
    guild : PartialGuild?
    guild_id : Id[GuildMarker]?
    channel : Channel?
    channel_id : Id[ChannelMarker]?
    guild_member : GuildMember?
    user : User?
    token : String
    version : Int
    message : Message?
    app_permissions : Permissions?
    locale : String?
    guild_locale : String?
    entitlements : Array[Entitlement]?
    authorizing_integration_owners : Map[String, String]?
    context : InteractionContextType?
    attachment_size_limit : Int?
    } derive(
    Debug
    )

    An interaction delivered by Discord to an application.

    Interaction::to_json

    InteractionCallback

    pub(all) struct InteractionCallback {
    id : Id[InteractionMarker]
    typ : InteractionType
    activity_instance_id : String?
    response_message_id : Id[MessageMarker]?
    response_message_loading : Bool?
    response_message_ephemeral : Bool?
    } derive(
    Debug
    ,
    FromJson
    ,
    ToJson
    )

    The interaction as seen by the callback endpoint.

    InteractionCallbackActivityInstance

    pub(all) struct InteractionCallbackActivityInstance {
    id : String
    } derive(
    Debug
    ,
    FromJson
    ,
    ToJson
    )

    The Activity instance launched by an interaction response. Distinct from the fuller ActivityInstance resource returned by the application endpoints.

    InteractionCallbackResource

    What the interaction response created. message is set for message callbacks, activity_instance when an Activity was launched.

    InteractionCallbackResponse

    The envelope returned by Create Interaction Response when the caller asks for it with with_response=true.

    InteractionContextType

    pub(all) enum InteractionContextType {
    Guild
    BotDm
    PrivateChannel
    Unknown(Int)
    } derive(Eq,
    Debug
    )

    Where an interaction was triggered.

    InteractionContextType::from_int

    fn InteractionContextType::from_int(value : Int) -> InteractionContextType

    The InteractionContextType for its Discord integer value; unknown values become Unknown(n).

    InteractionContextType::to_int

    The Discord integer value of this InteractionContextType.

    InteractionContextType::to_json

    InteractionData

    pub(all) enum InteractionData {
    Command(CommandData)
    Component(ComponentData)
    Modal(ModalData)
    Unknown(
    Json
    )
    } derive(
    Debug
    )

    Polymorphic interaction data selected by the parent interaction type.

    InteractionData::to_json

    InteractionMarker

    pub enum InteractionMarker {
    }

    Marker for IDs of an interaction.

    InteractionResponse

    A response envelope sent for an interaction callback.

    InteractionResponseType

    pub(all) enum InteractionResponseType {
    Pong
    ChannelMessageWithSource
    DeferredChannelMessageWithSource
    DeferredUpdateMessage
    UpdateMessage
    Autocomplete
    Modal
    PremiumRequired
    LaunchActivity
    Unknown(Int)
    } derive(Eq,
    Debug
    )

    The callback behavior requested by an interaction response.

    InteractionResponseType::from_int

    The InteractionResponseType for its Discord integer value; unknown values become Unknown(n).

    InteractionResponseType::to_int

    The Discord integer value of this InteractionResponseType.

    InteractionResponseType::to_json

    InteractionType

    pub(all) enum InteractionType {
    Ping
    ApplicationCommand
    MessageComponent
    ApplicationCommandAutocomplete
    ModalSubmit
    Unknown(Int)
    } derive(Eq,
    Debug
    )

    The dispatch category of an interaction.

    InteractionType::from_int

    fn InteractionType::from_int(value : Int) -> InteractionType

    The InteractionType for its Discord integer value; unknown values become Unknown(n).

    InteractionType::to_int

    fn InteractionType::to_int(self : InteractionType) -> Int

    The Discord integer value of this InteractionType.

    InteractionType::to_json

    Invite

    pub(all) struct Invite {
    typ : InviteType?
    code : String
    guild : PartialGuild?
    channel : Nullable[PartialChannel]?
    inviter : User?
    target_type : InviteTargetType?
    target_user : User?
    target_application : Application?
    approximate_presence_count : Int?
    approximate_member_count : Int?
    expires_at : Nullable[Timestamp]?
    guild_scheduled_event : GuildScheduledEvent?
    flags : InviteFlags?
    roles : Array[PartialRole]?
    uses : Int?
    max_uses : Int?
    max_age : Int?
    temporary : Bool?
    created_at : Timestamp?
    } derive(
    Debug
    ,
    FromJson
    ,
    ToJson
    )

    A Discord invite with optional usage metadata.

    Invite::to_json

    InviteCreateEvent

    pub(all) struct InviteCreateEvent {
    channel_id : Id[ChannelMarker]
    code : String
    created_at : Timestamp
    guild_id : Id[GuildMarker]?
    inviter : User?
    max_age : Int
    max_uses : Int
    target_type : InviteTargetType?
    target_user : User?
    target_application :
    Json
    ?
    temporary : Bool
    uses : Int
    expires_at : Nullable[Timestamp]
    role_ids : Array[Id[RoleMarker]]?
    } derive(
    Debug
    ,
    FromJson
    ,
    ToJson
    )

    An invite created in a channel.

    InviteDeleteEvent

    pub(all) struct InviteDeleteEvent {
    channel_id : Id[ChannelMarker]
    guild_id : Id[GuildMarker]?
    code : String
    } derive(
    Debug
    ,
    FromJson
    ,
    ToJson
    )

    An invite deleted from a channel.

    InviteFlags

    pub(all) struct InviteFlags(UInt64) derive(Eq)

    Bit flags describing a guild invite.

    InviteFlags::bits

    fn InviteFlags::bits(self : InviteFlags) -> UInt64

    The raw bit field.

    InviteFlags::from_bits

    fn InviteFlags::from_bits(bits : UInt64) -> InviteFlags

    Flags from a raw bit field; unknown bits are kept.

    InviteFlags::is_guest_invite

    fn InviteFlags::is_guest_invite() -> InviteFlags

    The invite grants guest access, with temporary membership for a voice channel.

    InviteFlags::to_json

    InviteTargetType

    pub(all) enum InviteTargetType {
    Stream
    EmbeddedApplication
    Unknown(Int)
    } derive(Eq,
    Debug
    )

    The special target carried by a voice channel invite.

    InviteTargetType::from_int

    fn InviteTargetType::from_int(value : Int) -> InviteTargetType

    The InviteTargetType for its Discord integer value; unknown values become Unknown(n).

    InviteTargetType::to_int

    fn InviteTargetType::to_int(self : InviteTargetType) -> Int

    The Discord integer value of this InviteTargetType.

    InviteTargetType::to_json

    InviteType

    pub(all) enum InviteType {
    Guild
    GroupDm
    Friend
    Unknown(Int)
    } derive(Eq,
    Debug
    )

    The destination category of a Discord invite.

    InviteType::from_int

    fn InviteType::from_int(value : Int) -> InviteType

    The InviteType for its Discord integer value; unknown values become Unknown(n).

    InviteType::to_int

    fn InviteType::to_int(self : InviteType) -> Int

    The Discord integer value of this InviteType.

    InviteType::to_json

    Label

    pub(all) struct Label {
    id : Int?
    label : String?
    description : String?
    component : Component
    } derive(
    Debug
    ,
    FromJson
    ,
    ToJson
    )

    A modal label wrapping one interactive component.

    Label::to_json

    LimitViolation

    pub(all) struct LimitViolation {
    path : String
    custom_id : String?
    reason : String
    } derive(Eq,
    Debug
    )

    A value outside a limit Discord documents for an outgoing embed, message component, modal, or Gateway command. Send paths report these before any request is made.

    path locates the value from the checked argument, such as embeds[0].fields[2].value or components[1].components[0].label. custom_id is the nearest component custom id, when there is one. Text lengths are text_length characters, except where the protocol explicitly requires bytes (such as a Gateway member-request nonce).

    LimitViolation::message

    fn LimitViolation::message(self : LimitViolation) -> String

    The violation as one line: path: reason.

    LobbyMessage

    pub(all) struct LobbyMessage {
    id : Id[MessageMarker]
    typ : MessageType
    content : String
    lobby_id : Id[GenericMarker]
    channel_id : Id[ChannelMarker]
    author : User
    metadata :
    Json
    ?
    flags : MessageFlags
    application_id : Id[ApplicationMarker]?
    timestamp : Timestamp?
    edited_timestamp : Nullable[Timestamp]?
    raw :
    Json

    } derive(
    Debug
    )

    A lobby message view for outbound webhook events.

    The documented fields are decoded for direct use while raw preserves the complete object, including SDK extensions that are not a Lobby domain.

    LobbyMessage::to_json

    LobbyMessageDeleteEvent

    pub(all) struct LobbyMessageDeleteEvent {
    id : Id[MessageMarker]
    lobby_id : Id[GenericMarker]
    raw :
    Json

    } derive(
    Debug
    )

    Identifiers for a lobby message that was deleted.

    LobbyMessageDeleteEvent::to_json

    MediaGallery

    A gallery containing one to ten media items.

    MediaGalleryItem

    pub(all) struct MediaGalleryItem {
    media : UnfurledMediaItem
    description : Nullable[String]?
    spoiler : Bool?
    } derive(
    Debug
    ,
    FromJson
    ,
    ToJson
    )

    One item in a media gallery.

    MemberSelect

    pub(all) enum MemberSelect {
    All
    Prefix(String, limit~ : Int)
    Ids(Array[Id[UserMarker]])
    } derive(
    Debug
    )

    Select all members, a nonempty username prefix, or 1 to 100 user ids.

    Message

    pub(all) struct Message {
    id : Id[MessageMarker]
    channel_id : Id[ChannelMarker]
    author : User
    content : String
    timestamp : Timestamp
    edited_timestamp : Nullable[Timestamp]
    tts : Bool
    mention_everyone : Bool
    mentions : Array[User]
    mention_roles : Array[Id[RoleMarker]]
    mention_channels : Array[ChannelMention]?
    attachments : Array[Attachment]
    embeds : Array[Embed]
    reactions : Array[Reaction]?
    nonce : Nonce?
    pinned : Bool
    webhook_id : Id[WebhookMarker]?
    typ : MessageType
    activity : MessageActivity?
    application_id : Id[ApplicationMarker]?
    message_reference : MessageReference?
    flags : MessageFlags?
    referenced_message : Nullable[Message]?
    thread : Channel?
    components : Array[Component]?
    sticker_items : Array[StickerItem]?
    position : Int?
    role_subscription_data : RoleSubscriptionData?
    poll : Poll?
    call : MessageCall?
    application : Application?
    interaction_metadata : MessageInteractionMetadata?
    resolved : ResolvedData?
    message_snapshots : Array[MessageSnapshot]?
    shared_client_theme : SharedClientTheme?
    } derive(
    Debug
    ,
    FromJson
    ,
    ToJson
    )

    A message sent to a Discord channel.

    Message::to_json

    MessageActivity

    Rich Presence activity metadata attached to a message.

    MessageActivityType

    pub(all) enum MessageActivityType {
    Join
    Spectate
    Listen
    JoinRequest
    StreamRequest
    Unknown(Int)
    } derive(Eq,
    Debug
    )

    The Rich Presence action represented by a message activity.

    MessageActivityType::from_int

    fn MessageActivityType::from_int(value : Int) -> MessageActivityType

    The MessageActivityType for its Discord integer value; unknown values become Unknown(n).

    MessageActivityType::to_int

    fn MessageActivityType::to_int(self : MessageActivityType) -> Int

    The Discord integer value of this MessageActivityType.

    MessageActivityType::to_json

    MessageCall

    Participant and end-time data for a call message.

    MessageCreateEvent

    pub(all) struct MessageCreateEvent {
    message : Message
    guild_id : Id[GuildMarker]?
    guild_member : GuildMember?
    mention_members : Map[Id[UserMarker], GuildMember]
    channel_type : ChannelType?
    } derive(
    Debug
    )

    A message-create dispatch with gateway-only message fields.

    MessageDeleteBulkEvent

    A bulk message deletion.

    MessageDeleteEvent

    A message deletion containing only resource identifiers.

    MessageFlags

    pub(all) struct MessageFlags(UInt64) derive(Eq)

    Bit flags describing delivery and presentation behavior of a message.

    MessageFlags::bits

    fn MessageFlags::bits(self : MessageFlags) -> UInt64

    The raw bit field.

    MessageFlags::contains

    fn MessageFlags::contains(self : MessageFlags, other : MessageFlags) -> Bool

    Whether every flag in other is set.

    MessageFlags::crossposted

    fn MessageFlags::crossposted() -> MessageFlags

    The message has been published to subscribed channels.

    MessageFlags::ephemeral

    fn MessageFlags::ephemeral() -> MessageFlags

    The message is only visible to the user who invoked the interaction.

    MessageFlags::failed_to_mention_some_roles_in_thread

    fn MessageFlags::failed_to_mention_some_roles_in_thread() -> MessageFlags

    Some roles mentioned in the message could not be added to the thread.

    MessageFlags::from_bits

    fn MessageFlags::from_bits(bits : UInt64) -> MessageFlags

    Flags from a raw bit field; unknown bits are kept.

    MessageFlags::has_snapshot

    fn MessageFlags::has_snapshot() -> MessageFlags

    The message carries a snapshot of a forwarded message.

    MessageFlags::has_thread

    fn MessageFlags::has_thread() -> MessageFlags

    The message has an associated thread with the same ID as the message.

    MessageFlags::is_components_v2

    fn MessageFlags::is_components_v2() -> MessageFlags

    The message uses the components V2 layout instead of content and embeds.

    MessageFlags::is_crosspost

    fn MessageFlags::is_crosspost() -> MessageFlags

    The message originated from a followed channel's announcement.

    MessageFlags::is_voice_message

    fn MessageFlags::is_voice_message() -> MessageFlags

    The message is a voice message.

    MessageFlags::loading

    fn MessageFlags::loading() -> MessageFlags

    The message is an interaction response that is still deferred ("thinking").

    MessageFlags::none

    No flags set.
    fn MessageFlags::should_show_link_not_discord_warning() -> MessageFlags

    Bit 1 << 10, which Discord sets but does not document.

    MessageFlags::source_message_deleted

    fn MessageFlags::source_message_deleted() -> MessageFlags

    The source message of this crosspost has been deleted.

    MessageFlags::suppress_embeds

    fn MessageFlags::suppress_embeds() -> MessageFlags

    Do not include any embeds when serializing the message.

    MessageFlags::suppress_notifications

    fn MessageFlags::suppress_notifications() -> MessageFlags

    The message does not trigger push or desktop notifications.

    MessageFlags::to_json

    MessageFlags::urgent

    fn MessageFlags::urgent() -> MessageFlags

    The message came from Discord's urgent message system.

    MessageInteractionMetadata

    pub(all) struct MessageInteractionMetadata {
    id : Id[InteractionMarker]
    typ : InteractionType
    user : User
    authorizing_integration_owners : Map[String, String]
    original_response_message_id : Id[MessageMarker]?
    target_user : User?
    target_message_id : Id[MessageMarker]?
    interacted_message_id : Id[MessageMarker]?
    triggering_interaction_metadata : MessageInteractionMetadata?
    } derive(
    Debug
    ,
    FromJson
    ,
    ToJson
    )

    Metadata identifying the interaction that produced a message.

    The optional fields cover the documented command, component, and modal variants. type determines which subset is present.

    MessageMarker

    pub enum MessageMarker {
    }

    Marker for IDs of a message.

    MessagePin

    One entry returned by the paginated channel-pins endpoint.

    MessagePin::to_json

    MessagePollVoteEvent

    pub(all) struct MessagePollVoteEvent {
    user_id : Id[UserMarker]
    channel_id : Id[ChannelMarker]
    message_id : Id[MessageMarker]
    guild_id : Id[GuildMarker]?
    answer_id : Int
    } derive(
    Debug
    ,
    FromJson
    ,
    ToJson
    )

    A user added or removed a vote from a poll answer.

    MessageReactionAddEvent

    pub(all) struct MessageReactionAddEvent {
    user_id : Id[UserMarker]
    channel_id : Id[ChannelMarker]
    message_id : Id[MessageMarker]
    guild_id : Id[GuildMarker]?
    guild_member : GuildMember?
    emoji : Emoji
    message_author_id : Id[UserMarker]?
    burst : Bool
    burst_colors : Array[String]?
    typ : Int
    } derive(
    Debug
    ,
    FromJson
    ,
    ToJson
    )

    A reaction added to a message.

    MessageReactionRemoveAllEvent

    pub(all) struct MessageReactionRemoveAllEvent {
    channel_id : Id[ChannelMarker]
    message_id : Id[MessageMarker]
    guild_id : Id[GuildMarker]?
    } derive(
    Debug
    ,
    FromJson
    ,
    ToJson
    )

    All reactions removed from a message.

    MessageReactionRemoveEmojiEvent

    pub(all) struct MessageReactionRemoveEmojiEvent {
    channel_id : Id[ChannelMarker]
    message_id : Id[MessageMarker]
    guild_id : Id[GuildMarker]?
    emoji : Emoji
    } derive(
    Debug
    ,
    FromJson
    ,
    ToJson
    )

    Every reaction for one emoji removed from a message.

    MessageReactionRemoveEvent

    pub(all) struct MessageReactionRemoveEvent {
    user_id : Id[UserMarker]
    channel_id : Id[ChannelMarker]
    message_id : Id[MessageMarker]
    guild_id : Id[GuildMarker]?
    emoji : Emoji
    burst : Bool
    typ : Int
    } derive(
    Debug
    ,
    FromJson
    ,
    ToJson
    )

    A reaction removed from a message.

    MessageReference

    pub(all) struct MessageReference {
    typ : MessageReferenceType?
    message_id : Id[MessageMarker]?
    channel_id : Id[ChannelMarker]?
    guild_id : Id[GuildMarker]?
    fail_if_not_exists : Bool?
    } derive(
    Debug
    ,
    FromJson
    ,
    ToJson
    )

    Origin identifiers and delivery behavior for a message reference.

    MessageReferenceType

    pub(all) enum MessageReferenceType {
    Default
    Forward
    Unknown(Int)
    } derive(Eq,
    Debug
    )

    The reference mode used for a reply or forwarded message.

    MessageReferenceType::from_int

    fn MessageReferenceType::from_int(value : Int) -> MessageReferenceType

    The MessageReferenceType for its Discord integer value; unknown values become Unknown(n).

    MessageReferenceType::to_int

    fn MessageReferenceType::to_int(self : MessageReferenceType) -> Int

    The Discord integer value of this MessageReferenceType.

    MessageReferenceType::to_json

    MessageSnapshot

    A forwarded message snapshot.

    MessageSnapshotContent

    pub(all) struct MessageSnapshotContent {
    typ : MessageType?
    content : String?
    embeds : Array[Embed]?
    attachments : Array[Attachment]?
    timestamp : Timestamp?
    edited_timestamp : Nullable[Timestamp]?
    flags : MessageFlags?
    mentions : Array[User]?
    mention_roles : Array[Id[RoleMarker]]?
    sticker_items : Array[StickerItem]?
    components : Array[Component]?
    } derive(
    Debug
    ,
    FromJson
    ,
    ToJson
    )

    The documented subset of a message retained in a forwarded snapshot.

    MessageType

    pub(all) enum MessageType {
    Default
    RecipientAdd
    RecipientRemove
    Call
    ChannelNameChange
    ChannelIconChange
    ChannelPinnedMessage
    UserJoin
    GuildBoost
    GuildBoostTier1
    GuildBoostTier2
    GuildBoostTier3
    ChannelFollowAdd
    GuildDiscoveryDisqualified
    GuildDiscoveryRequalified
    GuildDiscoveryGracePeriodInitialWarning
    GuildDiscoveryGracePeriodFinalWarning
    ThreadCreated
    Reply
    ChatInputCommand
    ThreadStarterMessage
    GuildInviteReminder
    ContextMenuCommand
    AutoModerationAction
    RoleSubscriptionPurchase
    InteractionPremiumUpsell
    StageStart
    StageEnd
    StageSpeaker
    StageRaiseHand
    StageTopic
    GuildApplicationPremiumSubscription
    GuildIncidentAlertModeEnabled
    GuildIncidentAlertModeDisabled
    GuildIncidentReportRaid
    GuildIncidentReportFalseAlarm
    PurchaseNotification
    PollResult
    Unknown(Int)
    } derive(Eq,
    Debug
    )

    The system or user event category represented by a message.

    MessageType::from_int

    fn MessageType::from_int(value : Int) -> MessageType

    The MessageType for its Discord integer value; unknown values become Unknown(n).

    MessageType::to_int

    fn MessageType::to_int(self : MessageType) -> Int

    The Discord integer value of this MessageType.

    MessageType::to_json

    MessageUpdateEvent

    pub(all) struct MessageUpdateEvent {
    message : Message
    before : Message?
    guild_id : Id[GuildMarker]?
    guild_member : GuildMember?
    mention_members : Map[Id[UserMarker], GuildMember]
    channel_type : ChannelType?
    } derive(
    Debug
    )

    A message-update dispatch with the same gateway-only fields as message creation.

    MessageUpdateEvent::is_edit

    fn MessageUpdateEvent::is_edit(self : MessageUpdateEvent) -> Bool

    Whether this update changed the message's edit timestamp.

    Without before, this uses the presence of an edited timestamp as a heuristic and may misclassify pin or unfurl updates to an already-edited message as edits.

    MfaLevel

    pub(all) enum MfaLevel {
    None
    Elevated
    Unknown(Int)
    } derive(Eq,
    Debug
    )

    Discord's guild MFA level.
    impl ToJson for MfaLevel

    MfaLevel::from_int

    fn MfaLevel::from_int(value : Int) -> MfaLevel

    The MfaLevel for its Discord integer value; unknown values become Unknown(n).

    MfaLevel::to_int

    fn MfaLevel::to_int(self : MfaLevel) -> Int

    The Discord integer value of this MfaLevel.

    MfaLevel::to_json

    ModalData

    Submitted modal data containing the modal's component tree.

    ModalData::to_json

    Nameplate

    pub(all) struct Nameplate {
    sku_id : Id[SkuMarker]
    asset : String
    label : String
    palette : String
    } derive(
    Debug
    ,
    FromJson
    ,
    ToJson
    )

    A profile nameplate collectible.

    Nameplate::to_json

    Nonce

    pub(all) enum Nonce {
    Str(String)
    Num(Int64)
    } derive(Eq,
    Debug
    )

    A client nonce represented as either its string or integer wire form.
    impl ToJson for Nonce

    Nonce::to_json

    NsfwLevel

    pub(all) enum NsfwLevel {
    Default
    Explicit
    Safe
    AgeRestricted
    Unknown(Int)
    } derive(Eq,
    Debug
    )

    Discord's guild NSFW level.
    impl ToJson for NsfwLevel

    NsfwLevel::from_int

    fn NsfwLevel::from_int(value : Int) -> NsfwLevel

    The NsfwLevel for its Discord integer value; unknown values become Unknown(n).

    NsfwLevel::to_int

    fn NsfwLevel::to_int(self : NsfwLevel) -> Int

    The Discord integer value of this NsfwLevel.

    NsfwLevel::to_json

    Nullable

    pub(all) enum Nullable[T] {
    Null
    Value(T)
    } derive(Eq,
    Debug
    )

    A field that is always present on the wire but may be JSON null.

    Use as a struct field type: Nullable[T] for "present, maybe null", Nullable[T]? for "maybe absent, maybe null" (composes with the derived FromJson/ToJson optional-field handling).

    test "convert nullable and PATCH values to options" {
    let nickname = @model.Nullable::from_option(Some("Moon"))
    debug_inspect(
    nickname.to_option(),
    content=(
    #|Some("Moon")
    ),
    )
    let missing : @sdkjson.Presence[String] = Absent
    let cleared : @sdkjson.Presence[String] = Null
    assert_true(missing.to_option() is None)
    assert_true(cleared.to_option() is None)
    }
    impl ToJson for Nullable[T]

    Nullable::from_option

    fn[T] Nullable::from_option(opt : T?) -> Nullable[T]

    Value for Some, Null for None.

    Nullable::to_option

    fn[T] Nullable::to_option(self : Nullable[T]) -> T?

    Some for a value, None for JSON null.

    OnboardingMode

    pub(all) enum OnboardingMode {
    Default
    Advanced
    Unknown(Int)
    } derive(Eq,
    Debug
    )

    How extensively onboarding is configured for a guild.

    OnboardingMode::from_int

    fn OnboardingMode::from_int(value : Int) -> OnboardingMode

    The OnboardingMode for its Discord integer value; unknown values become Unknown(n).

    OnboardingMode::to_int

    fn OnboardingMode::to_int(self : OnboardingMode) -> Int

    The Discord integer value of this OnboardingMode.

    OnboardingMode::to_json

    OnboardingPrompt

    pub(all) struct OnboardingPrompt {
    id : Id[GenericMarker]
    typ : OnboardingPromptType
    options : Array[OnboardingPromptOption]
    title : String
    single_select : Bool
    required : Bool
    in_onboarding : Bool
    } derive(
    Debug
    ,
    FromJson
    ,
    ToJson
    )

    A question presented during guild onboarding.

    OnboardingPromptOption

    pub(all) struct OnboardingPromptOption {
    id : Id[GenericMarker]
    channel_ids : Array[Id[ChannelMarker]]
    role_ids : Array[Id[RoleMarker]]
    emoji : Emoji?
    emoji_id : Id[EmojiMarker]?
    emoji_name : String?
    emoji_animated : Bool?
    title : String
    description : Nullable[String]
    } derive(
    Debug
    ,
    FromJson
    ,
    ToJson
    )

    A selectable answer to an onboarding prompt.

    OnboardingPromptType

    pub(all) enum OnboardingPromptType {
    MultipleChoice
    Dropdown
    Unknown(Int)
    } derive(Eq,
    Debug
    )

    The input control used by an onboarding prompt.

    OnboardingPromptType::from_int

    fn OnboardingPromptType::from_int(value : Int) -> OnboardingPromptType

    The OnboardingPromptType for its Discord integer value; unknown values become Unknown(n).

    OnboardingPromptType::to_int

    fn OnboardingPromptType::to_int(self : OnboardingPromptType) -> Int

    The Discord integer value of this OnboardingPromptType.

    OnboardingPromptType::to_json

    Overwrite

    A role or member permission override on a channel.

    Overwrite::to_json

    OverwriteType

    pub(all) enum OverwriteType {
    Role
    Member
    Unknown(Int)
    } derive(Eq,
    Debug
    )

    The target category of a permission overwrite.

    OverwriteType::from_int

    fn OverwriteType::from_int(value : Int) -> OverwriteType

    The OverwriteType for its Discord integer value; unknown values become Unknown(n).

    OverwriteType::to_int

    fn OverwriteType::to_int(self : OverwriteType) -> Int

    The Discord integer value of this OverwriteType.

    OverwriteType::to_json

    PartialChannel

    The documented subset of a channel embedded in another Discord resource.

    PartialGuild

    pub(all) struct PartialGuild {
    id : Id[GuildMarker]
    name : String?
    icon : Nullable[ImageHash]?
    splash : Nullable[ImageHash]?
    banner : Nullable[ImageHash]?
    description : Nullable[String]?
    features : Array[GuildFeature]?
    verification_level : VerificationLevel?
    vanity_url_code : Nullable[String]?
    nsfw_level : NsfwLevel?
    premium_subscription_count : Int?
    locale : String?
    } derive(
    Debug
    ,
    FromJson
    ,
    ToJson
    )

    The documented subset of a guild embedded in another Discord resource.

    Partial guild payloads vary by endpoint, so fields other than id are optional on receipt.

    PartialRole

    pub(all) struct PartialRole {
    id : Id[RoleMarker]
    name : String
    position : Int
    color : Int
    colors : RoleColors?
    icon : Nullable[ImageHash]?
    unicode_emoji : Nullable[String]?
    } derive(
    Debug
    ,
    FromJson
    ,
    ToJson
    )

    The subset of a role returned on an invite.

    Permissions

    pub(all) struct Permissions(UInt64) derive(Eq)

    Guild/channel permissions bitfield. Unknown bits are preserved.

    Wire format: a decimal string (Discord serializes permissions as strings because they exceed JavaScript's 53-bit safe-integer range).

    Permissions::add_reactions

    fn Permissions::add_reactions() -> Permissions

    Allows adding new reactions to messages.

    Permissions::administrator

    fn Permissions::administrator() -> Permissions

    Grants every permission and bypasses channel permission overwrites.

    Permissions::attach_files

    fn Permissions::attach_files() -> Permissions

    Allows uploading files and images.

    Permissions::ban_members

    fn Permissions::ban_members() -> Permissions

    Allows banning members from the guild.

    Permissions::bits

    fn Permissions::bits(self : Permissions) -> UInt64

    The raw bit field.

    Permissions::bypass_slowmode

    fn Permissions::bypass_slowmode() -> Permissions

    Allows sending messages without being limited by channel slowmode.

    Permissions::change_nickname

    fn Permissions::change_nickname() -> Permissions

    Allows changing the member's own nickname.

    Permissions::connect

    fn Permissions::connect() -> Permissions

    Allows joining voice channels.

    Permissions::contains

    fn Permissions::contains(self : Permissions, other : Permissions) -> Bool

    Whether every flag in other is set.

    Permissions::create_events

    fn Permissions::create_events() -> Permissions

    Allows creating scheduled events.

    Permissions::create_guild_expressions

    fn Permissions::create_guild_expressions() -> Permissions

    Allows creating emojis, stickers, and soundboard sounds.

    Permissions::create_instant_invite

    fn Permissions::create_instant_invite() -> Permissions

    Allows creating instant invites.

    Permissions::create_private_threads

    fn Permissions::create_private_threads() -> Permissions

    Allows creating private threads.

    Permissions::create_public_threads

    fn Permissions::create_public_threads() -> Permissions

    Allows creating public and announcement threads.

    Permissions::deafen_members

    fn Permissions::deafen_members() -> Permissions

    Allows deafening other members in voice channels.
    fn Permissions::embed_links() -> Permissions

    Allows links in the member's messages to be embedded.

    Permissions::from_bits

    fn Permissions::from_bits(bits : UInt64) -> Permissions

    Flags from a raw bit field; unknown bits are kept.

    Permissions::kick_members

    fn Permissions::kick_members() -> Permissions

    Allows kicking members from the guild.

    Permissions::manage_channels

    fn Permissions::manage_channels() -> Permissions

    Allows creating, editing, and deleting channels.

    Permissions::manage_events

    fn Permissions::manage_events() -> Permissions

    Allows creating, editing, and deleting scheduled events.

    Permissions::manage_guild

    fn Permissions::manage_guild() -> Permissions

    Allows editing the guild's settings and adding bots to it.

    Permissions::manage_guild_expressions

    fn Permissions::manage_guild_expressions() -> Permissions

    Allows editing and deleting emojis, stickers, and soundboard sounds.

    Permissions::manage_messages

    fn Permissions::manage_messages() -> Permissions

    Allows deleting other members' messages.

    Permissions::manage_nicknames

    fn Permissions::manage_nicknames() -> Permissions

    Allows changing other members' nicknames.

    Permissions::manage_roles

    fn Permissions::manage_roles() -> Permissions

    Allows creating, editing, and deleting roles below the member's highest role.

    Permissions::manage_threads

    fn Permissions::manage_threads() -> Permissions

    Allows deleting and archiving threads and viewing all private threads.

    Permissions::manage_webhooks

    fn Permissions::manage_webhooks() -> Permissions

    Allows creating, editing, and deleting webhooks.

    Permissions::mention_everyone

    fn Permissions::mention_everyone() -> Permissions

    Allows mentioning @everyone, @here, and all roles.

    Permissions::moderate_members

    fn Permissions::moderate_members() -> Permissions

    Allows timing out members.

    Permissions::move_members

    fn Permissions::move_members() -> Permissions

    Allows moving members between voice channels.

    Permissions::mute_members

    fn Permissions::mute_members() -> Permissions

    Allows muting other members in voice channels.

    Permissions::none

    fn Permissions::none() -> Permissions

    No flags set.

    Permissions::pin_messages

    fn Permissions::pin_messages() -> Permissions

    Allows pinning and unpinning messages.

    Permissions::priority_speaker

    fn Permissions::priority_speaker() -> Permissions

    Allows using priority speaker in a voice channel.

    Permissions::read_message_history

    fn Permissions::read_message_history() -> Permissions

    Allows reading the message history of a channel.

    Permissions::request_to_speak

    fn Permissions::request_to_speak() -> Permissions

    Allows requesting to speak in stage channels.

    Permissions::send_messages

    fn Permissions::send_messages() -> Permissions

    Allows sending messages in a channel and creating posts in a forum (but not messages in threads).

    Permissions::send_messages_in_threads

    fn Permissions::send_messages_in_threads() -> Permissions

    Allows sending messages in threads.

    Permissions::send_polls

    fn Permissions::send_polls() -> Permissions

    Allows creating polls.

    Permissions::send_tts_messages

    fn Permissions::send_tts_messages() -> Permissions

    Allows sending text-to-speech messages.

    Permissions::send_voice_messages

    fn Permissions::send_voice_messages() -> Permissions

    Allows sending voice messages.

    Permissions::set_voice_channel_status

    fn Permissions::set_voice_channel_status() -> Permissions

    Allows setting the status of a voice channel.

    Permissions::speak

    fn Permissions::speak() -> Permissions

    Allows speaking in voice channels.

    Permissions::stream

    fn Permissions::stream() -> Permissions

    Allows going live (video or screen share) in a voice channel.

    Permissions::to_json

    Permissions::use_application_commands

    fn Permissions::use_application_commands() -> Permissions

    Allows using application commands.

    Permissions::use_embedded_activities

    fn Permissions::use_embedded_activities() -> Permissions

    Allows using Activities in a voice channel.

    Permissions::use_external_apps

    fn Permissions::use_external_apps() -> Permissions

    Allows user-installed apps to send public responses in the channel.

    Permissions::use_external_emojis

    fn Permissions::use_external_emojis() -> Permissions

    Allows using custom emojis from other guilds.

    Permissions::use_external_sounds

    fn Permissions::use_external_sounds() -> Permissions

    Allows using custom soundboard sounds from other guilds.

    Permissions::use_external_stickers

    fn Permissions::use_external_stickers() -> Permissions

    Allows using custom stickers from other guilds.

    Permissions::use_soundboard

    fn Permissions::use_soundboard() -> Permissions

    Allows using the soundboard in a voice channel.

    Permissions::use_vad

    fn Permissions::use_vad() -> Permissions

    Allows using voice activity detection instead of push-to-talk.

    Permissions::view_audit_log

    fn Permissions::view_audit_log() -> Permissions

    Allows viewing the guild's audit log.

    Permissions::view_channel

    fn Permissions::view_channel() -> Permissions

    Allows viewing a channel, including reading its messages.

    Permissions::view_creator_monetization_analytics

    fn Permissions::view_creator_monetization_analytics() -> Permissions

    Allows viewing role subscription insights.

    Permissions::view_guild_insights

    fn Permissions::view_guild_insights() -> Permissions

    Allows viewing the guild's insights.

    Poll

    pub(all) struct Poll {
    question : PollMedia
    answers : Array[PollAnswer]
    expiry : Nullable[Timestamp]
    allow_multiselect : Bool
    layout_type : PollLayoutType
    results : PollResults?
    } derive(
    Debug
    ,
    FromJson
    ,
    ToJson
    )

    A poll attached to a Discord message.

    Poll::to_json

    PollAnswer

    A selectable answer in a poll.

    PollAnswer::to_json

    PollAnswerCount

    pub(all) struct PollAnswerCount {
    id : Int
    count : Int
    me_voted : Bool
    } derive(
    Debug
    ,
    FromJson
    ,
    ToJson
    )

    Vote count and current-user state for one poll answer.

    PollAnswerVoters

    Users returned by the poll answer-voters endpoint.

    PollCreateRequest

    pub(all) struct PollCreateRequest {
    question : PollMedia
    answers : Array[PollMedia]
    duration : Int?
    allow_multiselect : Bool?
    layout_type : PollLayoutType?
    } derive(
    Debug
    )

    Poll definition attached when creating a message or executing a webhook. Answers carry their media directly; Discord assigns the answer ids. duration is the number of hours the poll stays open (up to 32 days, default 24).

    PollCreateRequest::to_json

    PollLayoutType

    pub(all) enum PollLayoutType {
    Default
    Unknown(Int)
    } derive(Eq,
    Debug
    )

    The presentation layout used by a poll.

    PollLayoutType::from_int

    fn PollLayoutType::from_int(value : Int) -> PollLayoutType

    The PollLayoutType for its Discord integer value; unknown values become Unknown(n).

    PollLayoutType::to_int

    fn PollLayoutType::to_int(self : PollLayoutType) -> Int

    The Discord integer value of this PollLayoutType.

    PollLayoutType::to_json

    PollMedia

    Text and emoji content used by a poll question or answer.

    PollMedia::to_json

    PollResults

    Aggregated results for a poll.

    PremiumTier

    pub(all) enum PremiumTier {
    None
    Tier1
    Tier2
    Tier3
    Unknown(Int)
    } derive(Eq,
    Debug
    )

    Discord's guild premium tier.

    PremiumTier::from_int

    fn PremiumTier::from_int(value : Int) -> PremiumTier

    The PremiumTier for its Discord integer value; unknown values become Unknown(n).

    PremiumTier::to_int

    fn PremiumTier::to_int(self : PremiumTier) -> Int

    The Discord integer value of this PremiumTier.

    PremiumTier::to_json

    PremiumType

    pub(all) enum PremiumType {
    None
    NitroClassic
    Nitro
    NitroBasic
    Unknown(Int)
    } derive(Eq,
    Debug
    )

    The type of Nitro subscription on a user's account.

    PremiumType::from_int

    fn PremiumType::from_int(value : Int) -> PremiumType

    The PremiumType for its Discord integer value; unknown values become Unknown(n).

    PremiumType::to_int

    fn PremiumType::to_int(self : PremiumType) -> Int

    The Discord integer value of this PremiumType.

    PremiumType::to_json

    PresenceStatus

    pub(all) enum PresenceStatus {
    Idle
    Dnd
    Online
    Offline
    Invisible
    Unknown(String)
    } derive(Eq,
    Debug
    )

    A user's overall presence state.

    PresenceStatus::from_string

    fn PresenceStatus::from_string(value : String) -> PresenceStatus

    The PresenceStatus for its Discord string value; unknown values become Unknown(s).

    PresenceStatus::to_json

    PresenceStatus::to_string

    fn PresenceStatus::to_string(self : PresenceStatus) -> String

    The Discord string value of this PresenceStatus.

    PresenceUpdateEvent

    pub(all) struct PresenceUpdateEvent {
    user : PresenceUser?
    guild_id : Id[GuildMarker]?
    status : PresenceStatus?
    activities : Array[Activity]?
    client_status : ClientStatus?
    } derive(
    Debug
    ,
    ToJson
    )

    A gateway presence update decoded field-by-field.

    Discord does not validate the presence payload. A missing field or a field whose value has the wrong type is represented as None; one bad field never prevents the rest of the event from being delivered.

    PresenceUser

    The user fragment carried by a presence update.

    Discord only normally requires id, but explicitly warns that presence fields and their types are not validated. Keeping the id optional lets a malformed user fragment remain observable without rejecting the event.

    RadioGroup

    pub(all) struct RadioGroup {
    id : Int?
    custom_id : String
    options : Array[RadioOption]
    required : Bool?
    value : String?
    } derive(
    Debug
    ,
    FromJson
    ,
    ToJson
    )

    A modal radio group accepting one option.

    RadioGroup::to_json

    RadioOption

    pub(all) struct RadioOption {
    value : String
    label : String
    description : String?
    default : Bool?
    } derive(
    Debug
    ,
    FromJson
    ,
    ToJson
    )

    A selectable option shared by radio and checkbox groups.

    Reaction

    pub(all) struct Reaction {
    count : Int
    count_details : ReactionCountDetails
    me : Bool
    me_burst : Bool
    emoji : Emoji
    burst_colors : Array[String]
    } derive(
    Debug
    ,
    FromJson
    ,
    ToJson
    )

    Aggregate reaction state for one emoji on a message.

    Reaction::to_json

    ReactionCountDetails

    pub(all) struct ReactionCountDetails {
    burst : Int
    normal : Int
    } derive(
    Debug
    ,
    FromJson
    ,
    ToJson
    )

    Normal and burst reaction counts for a reaction.

    ReactionType

    pub(all) enum ReactionType {
    Normal
    Burst
    Unknown(Int)
    } derive(Eq,
    Debug
    )

    Whether a reaction is a normal or a burst (super) reaction, as selected by the type query parameter of the reaction endpoints.

    ReactionType::from_int

    fn ReactionType::from_int(value : Int) -> ReactionType

    The ReactionType for its Discord integer value; unknown values become Unknown(n).

    ReactionType::to_int

    fn ReactionType::to_int(self : ReactionType) -> Int

    The Discord integer value of this ReactionType.

    ReactionType::to_json

    Ready

    pub(all) struct Ready {
    v : Int
    user : User
    guilds : Array[UnavailableGuild]
    session_id : String
    resume_gateway_url : String
    shard : Array[Int]?
    application : ReadyApplication
    } derive(
    Debug
    ,
    FromJson
    ,
    ToJson
    )

    Payload of the READY dispatch.

    Ready::to_json

    ReadyApplication

    Partial application object included in READY.

    RequestChannelInfo

    pub(all) struct RequestChannelInfo {
    guild_id : Id[GuildMarker]
    fields : Array[ChannelInfoField]
    } derive(
    Debug
    ,
    ToJson
    )

    Request ephemeral channel data for a guild.

    RequestGuildMembers

    pub(all) struct RequestGuildMembers {
    guild_id : Id[GuildMarker]
    select : MemberSelect
    presences : Bool
    nonce : String?
    } derive(
    Debug
    )

    Request members for one guild. validate is called by typed send paths.

    RequestGuildMembers::to_json

    RequestGuildMembers::validate

    Check selection bounds and the nonce's UTF-8 byte length before sending.

    RequestSoundboardSounds

    pub(all) struct RequestSoundboardSounds {
    guild_ids : Array[Id[GuildMarker]]
    } derive(
    Debug
    ,
    ToJson
    )

    Request soundboard sounds for each listed guild.

    ResolvedData

    pub(all) struct ResolvedData {
    users : Map[String, User]?
    members : Map[String, GuildMember]?
    roles : Map[String, Role]?
    channels : Map[String, Channel]?
    messages : Map[String, Message]?
    attachments : Map[String, Attachment]?
    } derive(
    Debug
    ,
    FromJson
    ,
    ToJson
    )

    Entity maps resolved alongside interaction option values.

    Role

    pub(all) struct Role {
    id : Id[RoleMarker]
    name : String
    color : Int
    colors : RoleColors?
    hoist : Bool
    icon : Nullable[ImageHash]?
    unicode_emoji : Nullable[String]?
    position : Int
    permissions : Permissions
    managed : Bool
    mentionable : Bool
    tags : RoleTags?
    flags : RoleFlags?
    } derive(
    Debug
    ,
    FromJson
    ,
    ToJson
    )

    A Discord guild role and its permissions.

    Role::to_json

    RoleColors

    pub(all) struct RoleColors {
    primary_color : Int
    secondary_color : Nullable[Int]
    tertiary_color : Nullable[Int]
    } derive(
    Debug
    ,
    FromJson
    ,
    ToJson
    )

    Primary and optional enhanced gradient colors of a role.

    RoleColors::to_json

    RoleFlags

    pub(all) struct RoleFlags(UInt64) derive(Eq)

    Bit flags describing special behavior assigned to a role.
    impl BitAnd for RoleFlags
    impl BitOr for RoleFlags
    impl Debug for RoleFlags
    impl ToJson for RoleFlags

    RoleFlags::bits

    fn RoleFlags::bits(self : RoleFlags) -> UInt64

    The raw bit field.

    RoleFlags::contains

    fn RoleFlags::contains(self : RoleFlags, other : RoleFlags) -> Bool

    Whether every flag in other is set.

    RoleFlags::from_bits

    fn RoleFlags::from_bits(bits : UInt64) -> RoleFlags

    Flags from a raw bit field; unknown bits are kept.

    RoleFlags::in_prompt

    fn RoleFlags::in_prompt() -> RoleFlags

    The role can be selected by members in an onboarding prompt.

    RoleFlags::none

    fn RoleFlags::none() -> RoleFlags

    No flags set.

    RoleFlags::to_json

    RoleMarker

    pub enum RoleMarker {
    }

    Marker for IDs of a role.

    RoleSubscriptionData

    pub(all) struct RoleSubscriptionData {
    role_subscription_listing_id : Id[SkuMarker]
    tier_name : String
    total_months_subscribed : Int
    is_renewal : Bool
    } derive(
    Debug
    ,
    FromJson
    ,
    ToJson
    )

    Subscription tier data attached to a role purchase message.

    RoleTags

    pub(all) struct RoleTags {
    bot_id : Id[UserMarker]?
    premium_subscriber : Bool
    integration_id : Id[IntegrationMarker]?
    subscription_listing_id : Id[SkuMarker]?
    available_for_purchase : Bool
    guild_connections : Bool
    } derive(Eq,
    Debug
    )

    Role ownership tags, including null-valued markers whose presence means true.

    Discord represents premium_subscriber, available_for_purchase, and guild_connections as optional fields whose only wire value is null. Their Boolean values record whether each field was present.
    impl ToJson for RoleTags

    RoleTags::to_json

    ScheduledEventMarker

    pub enum ScheduledEventMarker {
    }

    Marker for IDs of a scheduled event.

    Section

    A section containing text components and a button or thumbnail accessory.

    Section::to_json

    SelectDefaultValue

    A preselected entity in an auto-populated select menu.

    SelectMenu

    pub(all) struct SelectMenu {
    id : Int?
    custom_id : String
    placeholder : String?
    min_values : Int?
    max_values : Int?
    disabled : Bool?
    required : Bool?
    options : Array[SelectOption]?
    channel_types : Array[ChannelType]?
    default_values : Array[SelectDefaultValue]?
    values : Array[String]?
    } derive(
    Debug
    ,
    FromJson
    ,
    ToJson
    )

    A text or auto-populated select menu component.

    SelectMenu::to_json

    SelectOption

    pub(all) struct SelectOption {
    label : String
    value : String
    description : String?
    emoji : Emoji?
    default : Bool?
    } derive(
    Debug
    ,
    FromJson
    ,
    ToJson
    )

    A selectable option in a string select menu.

    Separator

    pub(all) struct Separator {
    id : Int?
    divider : Bool?
    spacing : Int?
    } derive(
    Debug
    ,
    FromJson
    ,
    ToJson
    )

    A visual separator between Components v2 content blocks.

    Separator::to_json

    SessionStartLimit

    pub(all) struct SessionStartLimit {
    total : Int
    remaining : Int
    reset_after : Int64
    max_concurrency : Int
    } derive(
    Debug
    ,
    ToJson
    )

    Identify session allowance: how many session starts remain in the current window and how many shards may identify concurrently.

    SessionStartLimitWire

    type SessionStartLimitWire derive(
    FromJson
    )

    SharedClientTheme

    pub(all) struct SharedClientTheme {
    colors : Array[String]
    gradient_angle : Int
    base_mix : Int
    base_theme : Nullable[BaseTheme]?
    } derive(
    Debug
    ,
    FromJson
    ,
    ToJson
    )

    Theme colors shared by an activity-card message.

    Sku

    pub(all) struct Sku {
    id : Id[SkuMarker]
    typ : SkuType
    application_id : Id[ApplicationMarker]
    name : String
    slug : String
    flags : SkuFlags
    } derive(
    Debug
    ,
    FromJson
    ,
    ToJson
    )

    A purchasable Discord application product.

    Sku::to_json

    SkuFlags

    pub(all) struct SkuFlags(UInt64) derive(Eq)

    Bit flags describing availability and subscription scope for a SKU.
    impl BitAnd for SkuFlags
    impl BitOr for SkuFlags
    impl Debug for SkuFlags
    impl ToJson for SkuFlags

    SkuFlags::available

    fn SkuFlags::available() -> SkuFlags

    The SKU is available for purchase.

    SkuFlags::bits

    fn SkuFlags::bits(self : SkuFlags) -> UInt64

    The raw bit field.

    SkuFlags::contains

    fn SkuFlags::contains(self : SkuFlags, other : SkuFlags) -> Bool

    Whether every flag in other is set.

    SkuFlags::from_bits

    fn SkuFlags::from_bits(bits : UInt64) -> SkuFlags

    Flags from a raw bit field; unknown bits are kept.

    SkuFlags::guild_subscription

    fn SkuFlags::guild_subscription() -> SkuFlags

    The SKU is a recurring subscription purchased by a guild.

    SkuFlags::none

    fn SkuFlags::none() -> SkuFlags

    No flags set.

    SkuFlags::to_json

    SkuFlags::user_subscription

    fn SkuFlags::user_subscription() -> SkuFlags

    The SKU is a recurring subscription purchased by a user.

    SkuMarker

    pub enum SkuMarker {
    }

    Marker for IDs of a SKU.

    SkuType

    pub(all) enum SkuType {
    Durable
    Consumable
    Subscription
    SubscriptionGroup
    Unknown(Int)
    } derive(Eq,
    Debug
    )

    The product category represented by a SKU.
    impl FromJson for SkuType
    impl ToJson for SkuType

    SkuType::from_int

    fn SkuType::from_int(value : Int) -> SkuType

    The SkuType for its Discord integer value; unknown values become Unknown(n).

    SkuType::to_int

    fn SkuType::to_int(self : SkuType) -> Int

    The Discord integer value of this SkuType.

    SkuType::to_json

    SortOrderType

    pub(all) enum SortOrderType {
    LatestActivity
    CreationDate
    Unknown(Int)
    } derive(Eq,
    Debug
    )

    The ordering used for posts in a forum or media channel.

    SortOrderType::from_int

    fn SortOrderType::from_int(value : Int) -> SortOrderType

    The SortOrderType for its Discord integer value; unknown values become Unknown(n).

    SortOrderType::to_int

    fn SortOrderType::to_int(self : SortOrderType) -> Int

    The Discord integer value of this SortOrderType.

    SortOrderType::to_json

    SoundboardSound

    pub(all) struct SoundboardSound {
    name : String
    sound_id : Id[SoundboardSoundMarker]
    volume : Double
    emoji_id : Nullable[Id[EmojiMarker]]
    emoji_name : Nullable[String]
    guild_id : Id[GuildMarker]?
    available : Bool
    user : User?
    } derive(
    Debug
    ,
    FromJson
    ,
    ToJson
    )

    A reusable soundboard sound configured for Discord playback.

    SoundboardSoundMarker

    pub enum SoundboardSoundMarker {
    }

    Marker for IDs of a soundboard sound.

    SoundboardSoundsEvent

    The complete soundboard sound collection for a guild.

    StageInstance

    pub(all) struct StageInstance {
    id : Id[StageInstanceMarker]
    guild_id : Id[GuildMarker]
    channel_id : Id[ChannelMarker]
    topic : String
    privacy_level : StagePrivacyLevel
    guild_scheduled_event_id : Nullable[Id[ScheduledEventMarker]]
    } derive(
    Debug
    ,
    FromJson
    ,
    ToJson
    )

    A live stage instance associated with a guild stage channel.

    StageInstanceMarker

    pub enum StageInstanceMarker {
    }

    Marker for IDs of a stage instance.

    StagePrivacyLevel

    pub(all) enum StagePrivacyLevel {
    Public
    GuildOnly
    Unknown(Int)
    } derive(Eq,
    Debug
    )

    The audience allowed to discover a stage instance.

    StagePrivacyLevel::from_int

    fn StagePrivacyLevel::from_int(value : Int) -> StagePrivacyLevel

    The StagePrivacyLevel for its Discord integer value; unknown values become Unknown(n).

    StagePrivacyLevel::to_int

    fn StagePrivacyLevel::to_int(self : StagePrivacyLevel) -> Int

    The Discord integer value of this StagePrivacyLevel.

    StagePrivacyLevel::to_json

    Sticker

    pub(all) struct Sticker {
    id : Id[StickerMarker]
    pack_id : Id[StickerPackMarker]?
    name : String
    description : Nullable[String]
    tags : String
    asset : String?
    typ : StickerType
    format_type : StickerFormatType
    available : Bool?
    guild_id : Id[GuildMarker]?
    user : User?
    sort_value : Int?
    } derive(
    Debug
    ,
    FromJson
    ,
    ToJson
    )

    A Discord standard or guild sticker.

    Sticker::to_json

    StickerFormatType

    pub(all) enum StickerFormatType {
    Png
    Apng
    Lottie
    Gif
    Unknown(Int)
    } derive(Eq,
    Debug
    )

    The media format used by a sticker asset.

    StickerFormatType::from_int

    fn StickerFormatType::from_int(value : Int) -> StickerFormatType

    The StickerFormatType for its Discord integer value; unknown values become Unknown(n).

    StickerFormatType::to_int

    fn StickerFormatType::to_int(self : StickerFormatType) -> Int

    The Discord integer value of this StickerFormatType.

    StickerFormatType::to_json

    StickerItem

    The compact sticker representation included in messages.

    StickerMarker

    pub enum StickerMarker {
    }

    Marker for IDs of a sticker.

    StickerPack

    pub(all) struct StickerPack {
    id : Id[StickerPackMarker]
    stickers : Array[Sticker]
    name : String
    sku_id : Id[SkuMarker]
    cover_sticker_id : Id[StickerMarker]?
    description : String
    banner_asset_id : Id[GenericMarker]?
    } derive(
    Debug
    ,
    FromJson
    ,
    ToJson
    )

    A purchasable collection of standard stickers.

    StickerPackMarker

    pub enum StickerPackMarker {
    }

    Marker for IDs of a sticker pack.

    StickerPacksResponse

    The envelope returned by the sticker-packs listing endpoint.

    StickerType

    pub(all) enum StickerType {
    Standard
    Guild
    Unknown(Int)
    } derive(Eq,
    Debug
    )

    The origin category of a sticker.

    StickerType::from_int

    fn StickerType::from_int(value : Int) -> StickerType

    The StickerType for its Discord integer value; unknown values become Unknown(n).

    StickerType::to_int

    fn StickerType::to_int(self : StickerType) -> Int

    The Discord integer value of this StickerType.

    StickerType::to_json

    Subscription

    pub(all) struct Subscription {
    id : Id[GenericMarker]
    user_id : Id[UserMarker]
    sku_ids : Array[Id[SkuMarker]]
    entitlement_ids : Array[Id[EntitlementMarker]]
    renewal_sku_ids : Nullable[Array[Id[SkuMarker]]]
    current_period_start : Timestamp
    current_period_end : Timestamp
    status : SubscriptionStatus
    canceled_at : Nullable[Timestamp]
    country : String?
    } derive(
    Debug
    ,
    FromJson
    ,
    ToJson
    )

    A user's recurring subscription to one or more application SKUs.

    SubscriptionMarker

    pub enum SubscriptionMarker {
    }

    Marker for IDs of a subscription.

    SubscriptionStatus

    pub(all) enum SubscriptionStatus {
    Active
    Ending
    Inactive
    Unknown(Int)
    } derive(Eq,
    Debug
    )

    The renewal state of a Discord application subscription.

    SubscriptionStatus::from_int

    fn SubscriptionStatus::from_int(value : Int) -> SubscriptionStatus

    The SubscriptionStatus for its Discord integer value; unknown values become Unknown(n).

    SubscriptionStatus::to_int

    fn SubscriptionStatus::to_int(self : SubscriptionStatus) -> Int

    The Discord integer value of this SubscriptionStatus.

    SubscriptionStatus::to_json

    SystemChannelFlags

    pub(all) struct SystemChannelFlags(UInt64) derive(Eq)

    Bit flags controlling messages sent to a guild system channel.

    SystemChannelFlags::bits

    fn SystemChannelFlags::bits(self : SystemChannelFlags) -> UInt64

    The raw bit field.

    SystemChannelFlags::contains

    fn SystemChannelFlags::contains(self : SystemChannelFlags, other : SystemChannelFlags) -> Bool

    Whether every flag in other is set.

    SystemChannelFlags::from_bits

    fn SystemChannelFlags::from_bits(bits : UInt64) -> SystemChannelFlags

    Flags from a raw bit field; unknown bits are kept.

    SystemChannelFlags::none

    No flags set.

    SystemChannelFlags::suppress_guild_reminder_notifications

    fn SystemChannelFlags::suppress_guild_reminder_notifications() -> SystemChannelFlags

    Suppresses server setup tips.

    SystemChannelFlags::suppress_join_notification_replies

    fn SystemChannelFlags::suppress_join_notification_replies() -> SystemChannelFlags

    Hides the sticker-reply button on member join notifications.

    SystemChannelFlags::suppress_join_notifications

    fn SystemChannelFlags::suppress_join_notifications() -> SystemChannelFlags

    Suppresses member join notifications.

    SystemChannelFlags::suppress_premium_subscriptions

    fn SystemChannelFlags::suppress_premium_subscriptions() -> SystemChannelFlags

    Suppresses server boost notifications.

    SystemChannelFlags::suppress_role_subscription_purchase_notification_replies

    fn SystemChannelFlags::suppress_role_subscription_purchase_notification_replies() -> SystemChannelFlags

    Hides the sticker-reply button on role subscription purchase notifications.

    SystemChannelFlags::suppress_role_subscription_purchase_notifications

    fn SystemChannelFlags::suppress_role_subscription_purchase_notifications() -> SystemChannelFlags

    Suppresses role subscription purchase and renewal notifications.

    SystemChannelFlags::to_json

    TargetUsersJobStatus

    pub(all) struct TargetUsersJobStatus {
    status : TargetUsersJobStatusCode
    total_users : Int
    processed_users : Int
    created_at : Timestamp
    completed_at : Nullable[Timestamp]
    error_message : String?
    } derive(
    Debug
    ,
    FromJson
    ,
    ToJson
    )

    Progress and outcome of an invite target-user CSV update.

    TargetUsersJobStatusCode

    pub(all) enum TargetUsersJobStatusCode {
    Unspecified
    Processing
    Completed
    Failed
    Unknown(Int)
    } derive(Eq,
    Debug
    )

    State of an invite target-user CSV update job.

    TargetUsersJobStatusCode::from_int

    The TargetUsersJobStatusCode for its Discord integer value; unknown values become Unknown(n).

    TargetUsersJobStatusCode::to_int

    The Discord integer value of this TargetUsersJobStatusCode.

    TargetUsersJobStatusCode::to_json

    Team

    A Discord developer team and its members.

    Team::to_json

    TeamMarker

    pub enum TeamMarker {
    }

    Marker for IDs of a team.

    TeamMember

    pub(all) struct TeamMember {
    membership_state : TeamMembershipState
    team_id : Id[TeamMarker]
    user : User
    role : String?
    } derive(
    Debug
    ,
    FromJson
    ,
    ToJson
    )

    A user's membership record within a developer team.

    TeamMember::to_json

    TeamMembershipState

    pub(all) enum TeamMembershipState {
    Invited
    Accepted
    Unknown(Int)
    } derive(Eq,
    Debug
    )

    A user's invitation state within a developer team.

    TeamMembershipState::from_int

    fn TeamMembershipState::from_int(value : Int) -> TeamMembershipState

    The TeamMembershipState for its Discord integer value; unknown values become Unknown(n).

    TeamMembershipState::to_int

    fn TeamMembershipState::to_int(self : TeamMembershipState) -> Int

    The Discord integer value of this TeamMembershipState.

    TeamMembershipState::to_json

    TextDisplay

    A markdown text block displayed in a Components v2 layout.

    TextInput

    pub(all) struct TextInput {
    id : Int?
    custom_id : String
    style : TextInputStyle?
    label : String?
    min_length : Int?
    max_length : Int?
    required : Bool?
    value : String?
    placeholder : String?
    } derive(
    Debug
    ,
    FromJson
    ,
    ToJson
    )

    A free-form text input component used in a modal.

    TextInput::to_json

    TextInputStyle

    pub(all) enum TextInputStyle {
    Short
    Paragraph
    Unknown(Int)
    } derive(Eq,
    Debug
    )

    The single-line or multi-line style of a text input.

    TextInputStyle::from_int

    fn TextInputStyle::from_int(value : Int) -> TextInputStyle

    The TextInputStyle for its Discord integer value; unknown values become Unknown(n).

    TextInputStyle::to_int

    fn TextInputStyle::to_int(self : TextInputStyle) -> Int

    The Discord integer value of this TextInputStyle.

    TextInputStyle::to_json

    ThreadAutoArchiveDuration

    pub(all) enum ThreadAutoArchiveDuration {
    OneHour
    OneDay
    ThreeDays
    OneWeek
    Unknown(Int)
    } derive(Eq,
    Debug
    )

    The inactivity duration in minutes before a thread is archived.

    ThreadAutoArchiveDuration::from_int

    The ThreadAutoArchiveDuration for its Discord integer value (minutes); unknown values become Unknown(n).

    ThreadAutoArchiveDuration::to_int

    The Discord integer value of this ThreadAutoArchiveDuration, in minutes.

    ThreadAutoArchiveDuration::to_json

    ThreadCreateEvent

    pub(all) struct ThreadCreateEvent {
    channel : Channel
    newly_created : Bool?
    } derive(
    Debug
    )

    A thread channel delivered with THREAD_CREATE-only metadata.

    ThreadDeleteEvent

    A deleted thread's identifying fields.

    ThreadListSyncEvent

    Threads and memberships synchronized for a guild.

    ThreadMember

    pub(all) struct ThreadMember {
    id : Id[ChannelMarker]?
    user_id : Id[UserMarker]?
    join_timestamp : Timestamp
    flags : Int
    guild_member : GuildMember?
    } derive(
    Debug
    ,
    FromJson
    ,
    ToJson
    )

    A user's membership state in a thread.

    ThreadMemberUpdateEvent

    pub(all) struct ThreadMemberUpdateEvent {
    guild_id : Id[GuildMarker]
    thread_member : ThreadMember
    } derive(
    Debug
    )

    The current user's thread membership decoded from a flattened object.

    ThreadMembersUpdateEvent

    pub(all) struct ThreadMembersUpdateEvent {
    id : Id[ChannelMarker]
    guild_id : Id[GuildMarker]
    member_count : Int
    added_members : Array[ThreadMember]?
    removed_member_ids : Array[Id[UserMarker]]?
    } derive(
    Debug
    ,
    FromJson
    ,
    ToJson
    )

    Membership changes for a thread.

    ThreadMetadata

    pub(all) struct ThreadMetadata {
    archived : Bool
    auto_archive_duration : ThreadAutoArchiveDuration
    archive_timestamp : Timestamp
    locked : Bool
    invitable : Bool?
    create_timestamp : Nullable[Timestamp]?
    } derive(
    Debug
    ,
    FromJson
    ,
    ToJson
    )

    Metadata controlling a thread's archive and lock state.

    Thumbnail

    pub(all) struct Thumbnail {
    id : Int?
    media : UnfurledMediaItem
    description : Nullable[String]?
    spoiler : Bool?
    } derive(
    Debug
    ,
    FromJson
    ,
    ToJson
    )

    A thumbnail accessory rendered from an unfurled media item.

    Thumbnail::to_json

    Timestamp

    pub(all) struct Timestamp(String) derive(Eq)

    An ISO 8601 timestamp, kept as the raw string for lossless round-tripping. Discord sends e.g. 2021-03-11T18:15:37.907000+00:00.
    impl Debug for Timestamp
    impl ToJson for Timestamp

    Timestamp::to_json

    Timestamp::to_string

    fn Timestamp::to_string(self : Timestamp) -> String

    The ISO 8601 timestamp text exactly as received.

    Timestamp::unix_ms

    fn Timestamp::unix_ms(self : Timestamp) -> Int64 raise TimestampError

    Parse the timestamp into milliseconds since the Unix epoch.

    Supports the shapes Discord emits: YYYY-MM-DDTHH:MM:SS[.f...](Z|±HH:MM).

    test "parse a Discord timestamp without losing its source text" {
    let timestamp = @model.Timestamp("2021-03-11T18:15:37.907000+00:00")
    inspect(timestamp.to_string(), content="2021-03-11T18:15:37.907000+00:00")
    inspect(timestamp.unix_ms(), content="1615486537907")
    }

    TriggerMetadata

    pub(all) struct TriggerMetadata {
    keyword_filter : Array[String]?
    presets : Array[AutoModerationKeywordPresetType]?
    allow_list : Array[String]?
    regex_patterns : Array[String]?
    mention_total_limit : Int?
    mention_raid_protection_enabled : Bool?
    } derive(
    Debug
    ,
    FromJson
    ,
    ToJson
    )

    Optional condition settings used by auto-moderation triggers.

    TypingStartEvent

    pub(all) struct TypingStartEvent {
    channel_id : Id[ChannelMarker]
    guild_id : Id[GuildMarker]?
    user_id : Id[UserMarker]
    timestamp : Int64
    guild_member : GuildMember?
    } derive(
    Debug
    ,
    ToJson
    )

    A user began typing in a channel.

    TypingStartEventWire

    type TypingStartEventWire derive(
    FromJson
    )

    UnavailableGuild

    pub(all) struct UnavailableGuild {
    id : Id[GuildMarker]
    unavailable : Bool
    } derive(
    Debug
    ,
    ToJson
    )

    A guild that is temporarily unavailable to the client. In a Guild Delete event, unavailable is true while the guild is unavailable, for example during an outage, and a Guild Create follows when it returns; otherwise the user left or was removed from the guild.

    UnfurledMediaItem

    pub(all) struct UnfurledMediaItem {
    url : String
    proxy_url : String?
    height : Nullable[Int]?
    width : Nullable[Int]?
    placeholder : String?
    placeholder_version : Int?
    content_type : String?
    flags : Int?
    content_scan_metadata : ContentScanMetadata?
    attachment_id : String?
    } derive(
    Debug
    ,
    FromJson
    ,
    ToJson
    )

    Media metadata used by thumbnail, gallery, and file components.

    UpdatePresence

    pub(all) struct UpdatePresence {
    status : PresenceStatus
    activities : Array[BotActivity]
    afk : Bool
    since : Int64?
    } derive(
    Debug
    )

    An outgoing presence, also usable as the initial Identify presence.

    UpdatePresence::UpdatePresence

    fn UpdatePresence::UpdatePresence(status? : PresenceStatus, activities? : Array[BotActivity], afk? : Bool, since? : Int64) -> UpdatePresence

    Construct a presence; an absent since is encoded as null.

    UpdatePresence::to_json

    UpdateVoiceState

    pub(all) struct UpdateVoiceState {
    guild_id : Id[GuildMarker]
    channel_id : Id[ChannelMarker]?
    self_mute : Bool
    self_deaf : Bool
    } derive(Eq,
    Debug
    )

    Payload of opcode 4 (Update Voice State): join or move to channel_id in guild_id, or leave the guild's voice channel with channel_id = None.

    UpdateVoiceState::to_json

    User

    pub(all) struct User {
    id : Id[UserMarker]
    username : String
    discriminator : String
    global_name : Nullable[String]?
    avatar : Nullable[ImageHash]
    bot : Bool?
    system : Bool?
    mfa_enabled : Bool?
    banner : Nullable[ImageHash]?
    accent_color : Nullable[Int]?
    locale : String?
    verified : Bool?
    email : Nullable[String]?
    flags : UserFlags?
    premium_type : PremiumType?
    public_flags : UserFlags?
    avatar_decoration : Nullable[ImageHash]?
    avatar_decoration_data : Nullable[AvatarDecorationData]?
    collectibles : Nullable[Collectibles]?
    primary_guild : Nullable[UserPrimaryGuild]?
    } derive(
    Debug
    ,
    FromJson
    ,
    ToJson
    )

    A Discord user account returned by the API.

    User::to_json

    UserFlags

    pub(all) struct UserFlags(UInt64) derive(Eq)

    Bit flags describing badges and account properties assigned to a user.
    impl BitAnd for UserFlags
    impl BitOr for UserFlags
    impl Debug for UserFlags
    impl ToJson for UserFlags

    UserFlags::active_developer

    fn UserFlags::active_developer() -> UserFlags

    Active Developer badge holder.

    UserFlags::bits

    fn UserFlags::bits(self : UserFlags) -> UInt64

    The raw bit field.

    UserFlags::bot_http_interactions

    fn UserFlags::bot_http_interactions() -> UserFlags

    Bot that receives interactions over HTTP only and has no gateway presence.

    UserFlags::bug_hunter_level_1

    fn UserFlags::bug_hunter_level_1() -> UserFlags

    Bug Hunter, level 1.

    UserFlags::bug_hunter_level_2

    fn UserFlags::bug_hunter_level_2() -> UserFlags

    Bug Hunter, level 2.

    UserFlags::certified_moderator

    fn UserFlags::certified_moderator() -> UserFlags

    Moderator Programs Alumni.

    UserFlags::collaborator

    fn UserFlags::collaborator() -> UserFlags

    Bit 1 << 50, which Discord sets but does not document.

    UserFlags::contains

    fn UserFlags::contains(self : UserFlags, other : UserFlags) -> Bool

    Whether every flag in other is set.

    UserFlags::disable_premium

    fn UserFlags::disable_premium() -> UserFlags

    Bit 1 << 21, which Discord sets but does not document.

    UserFlags::from_bits

    fn UserFlags::from_bits(bits : UInt64) -> UserFlags

    Flags from a raw bit field; unknown bits are kept.

    UserFlags::has_unread_urgent_messages

    fn UserFlags::has_unread_urgent_messages() -> UserFlags

    Bit 1 << 13, which Discord sets but does not document.

    UserFlags::hype_squad_online_house_1

    fn UserFlags::hype_squad_online_house_1() -> UserFlags

    Member of HypeSquad House Bravery.

    UserFlags::hype_squad_online_house_2

    fn UserFlags::hype_squad_online_house_2() -> UserFlags

    Member of HypeSquad House Brilliance.

    UserFlags::hype_squad_online_house_3

    fn UserFlags::hype_squad_online_house_3() -> UserFlags

    Member of HypeSquad House Balance.

    UserFlags::hypesquad

    fn UserFlags::hypesquad() -> UserFlags

    HypeSquad Events member.

    UserFlags::mfa_sms

    fn UserFlags::mfa_sms() -> UserFlags

    Bit 1 << 4, which Discord sets but does not document.

    UserFlags::none

    fn UserFlags::none() -> UserFlags

    No flags set.

    UserFlags::partner

    fn UserFlags::partner() -> UserFlags

    Owner of a partnered server.

    UserFlags::premium_early_supporter

    fn UserFlags::premium_early_supporter() -> UserFlags

    Early Nitro supporter.

    UserFlags::premium_promo_dismissed

    fn UserFlags::premium_promo_dismissed() -> UserFlags

    Bit 1 << 5, which Discord sets but does not document.

    UserFlags::quarantined

    fn UserFlags::quarantined() -> UserFlags

    Discord has quarantined the account because of its recent activity. Discord does not document this bit (1 << 44).

    UserFlags::restricted_collaborator

    fn UserFlags::restricted_collaborator() -> UserFlags

    Bit 1 << 51, which Discord sets but does not document.

    UserFlags::spammer

    fn UserFlags::spammer() -> UserFlags

    Discord has flagged the user as a likely spammer. Discord does not document this bit (1 << 20).

    UserFlags::staff

    fn UserFlags::staff() -> UserFlags

    Discord employee.

    UserFlags::team_pseudo_user

    fn UserFlags::team_pseudo_user() -> UserFlags

    Pseudo-user that represents a team rather than a person.

    UserFlags::to_json

    UserFlags::verified_bot

    fn UserFlags::verified_bot() -> UserFlags

    Verified bot.

    UserFlags::verified_developer

    fn UserFlags::verified_developer() -> UserFlags

    Early verified bot developer.

    UserMarker

    pub enum UserMarker {
    }

    Marker for IDs of a user.

    UserPrimaryGuild

    pub(all) struct UserPrimaryGuild {
    identity_guild_id : Nullable[Id[GuildMarker]]?
    identity_enabled : Nullable[Bool]?
    tag : Nullable[String]?
    badge : Nullable[ImageHash]?
    } derive(
    Debug
    ,
    FromJson
    ,
    ToJson
    )

    The primary-guild identity displayed on a user's profile.

    VerificationLevel

    pub(all) enum VerificationLevel {
    None
    Low
    Medium
    High
    VeryHigh
    Unknown(Int)
    } derive(Eq,
    Debug
    )

    Discord's guild verification level.

    VerificationLevel::from_int

    fn VerificationLevel::from_int(value : Int) -> VerificationLevel

    The VerificationLevel for its Discord integer value; unknown values become Unknown(n).

    VerificationLevel::to_int

    fn VerificationLevel::to_int(self : VerificationLevel) -> Int

    The Discord integer value of this VerificationLevel.

    VerificationLevel::to_json

    VideoQualityMode

    pub(all) enum VideoQualityMode {
    Auto
    Full
    Unknown(Int)
    } derive(Eq,
    Debug
    )

    The camera quality mode used by a voice channel.

    VideoQualityMode::from_int

    fn VideoQualityMode::from_int(value : Int) -> VideoQualityMode

    The VideoQualityMode for its Discord integer value; unknown values become Unknown(n).

    VideoQualityMode::to_int

    fn VideoQualityMode::to_int(self : VideoQualityMode) -> Int

    The Discord integer value of this VideoQualityMode.

    VideoQualityMode::to_json

    VoiceChannelEffectSendEvent

    pub(all) struct VoiceChannelEffectSendEvent {
    channel_id : Id[ChannelMarker]
    guild_id : Id[GuildMarker]
    user_id : Id[UserMarker]
    emoji : Nullable[Emoji]?
    animation_type : Nullable[Int]?
    animation_id : Int?
    sound_id :
    Json
    ?
    sound_volume : Double?
    } derive(
    Debug
    ,
    FromJson
    ,
    ToJson
    )

    A visual or soundboard effect sent in a voice channel.

    VoiceChannelStartTimeUpdateEvent

    pub(all) struct VoiceChannelStartTimeUpdateEvent {
    id : Id[ChannelMarker]
    guild_id : Id[GuildMarker]
    voice_start_time : Nullable[Int64]?
    } derive(
    Debug
    ,
    FromJson
    ,
    ToJson
    )

    A voice channel's session start time changed.

    VoiceChannelStatusUpdateEvent

    pub(all) struct VoiceChannelStatusUpdateEvent {
    id : Id[ChannelMarker]
    guild_id : Id[GuildMarker]
    status : Nullable[String]
    } derive(
    Debug
    ,
    FromJson
    ,
    ToJson
    )

    A voice channel's text status changed.

    VoiceRegion

    pub(all) struct VoiceRegion {
    id : String
    name : String
    optimal : Bool
    deprecated : Bool
    custom : Bool
    } derive(
    Debug
    ,
    FromJson
    ,
    ToJson
    )

    A voice server region available to Discord clients.

    VoiceServerUpdateEvent

    pub(all) struct VoiceServerUpdateEvent {
    token : String
    guild_id : Id[GuildMarker]
    endpoint : Nullable[String]
    } derive(
    Debug
    ,
    FromJson
    ,
    ToJson
    )

    Voice server connection information for a guild.

    VoiceState

    pub(all) struct VoiceState {
    guild_id : Id[GuildMarker]?
    channel_id : Nullable[Id[ChannelMarker]]
    user_id : Id[UserMarker]
    guild_member : GuildMember?
    session_id : String
    deaf : Bool
    mute : Bool
    self_deaf : Bool
    self_mute : Bool
    self_stream : Bool?
    self_video : Bool?
    suppress : Bool
    request_to_speak_timestamp : Nullable[Timestamp]
    } derive(
    Debug
    ,
    FromJson
    ,
    ToJson
    )

    A user's connection state in a Discord voice channel.

    VoiceState::to_json

    Webhook

    pub(all) struct Webhook {
    id : Id[WebhookMarker]
    typ : WebhookType
    guild_id : Nullable[Id[GuildMarker]]?
    channel_id : Nullable[Id[ChannelMarker]]
    user : User?
    name : Nullable[String]
    avatar : Nullable[ImageHash]
    token : String?
    application_id : Nullable[Id[ApplicationMarker]]
    source_guild : PartialGuild?
    source_channel : PartialChannel?
    url : String?
    } derive(
    Debug
    ,
    FromJson
    ,
    ToJson
    )

    A Discord webhook and its execution metadata.

    Webhook::to_json

    WebhookEvent

    pub(all) enum WebhookEvent {
    ApplicationAuthorized(ApplicationAuthorizedEvent)
    ApplicationDeauthorized(ApplicationDeauthorizedEvent)
    EntitlementCreate(Entitlement)
    EntitlementUpdate(Entitlement)
    EntitlementDelete(Entitlement)
    LobbyMessageCreate(LobbyMessage)
    LobbyMessageUpdate(LobbyMessage)
    LobbyMessageDelete(LobbyMessageDeleteEvent)
    GameDirectMessageCreate(GameDirectMessage)
    GameDirectMessageUpdate(GameDirectMessage)
    GameDirectMessageDelete(GameDirectMessage)
    QuestUserEnrollment
    Unknown(typ~ : String, data~ :
    Json
    ?)
    } derive(
    Debug
    )

    A webhook event projected into its documented payload shape.

    Known event names always use a typed variant. Unknown names retain their original name and optional data for forward compatibility.

    WebhookEventBody

    The timestamped body nested inside an event webhook payload.

    WebhookEventBody::project

    fn WebhookEventBody::project(self : WebhookEventBody) -> WebhookEvent raise

    Decode the event-specific data carried by this body.

    Unknown event names never raise. A known event raises when its data does not match the documented wire shape.

    WebhookEventPayload

    An outbound HTTP webhook event payload sent by Discord.

    WebhookEventType

    pub(all) enum WebhookEventType {
    ApplicationAuthorized
    ApplicationDeauthorized
    EntitlementCreate
    EntitlementUpdate
    EntitlementDelete
    LobbyMessageCreate
    LobbyMessageUpdate
    LobbyMessageDelete
    GameDirectMessageCreate
    GameDirectMessageUpdate
    GameDirectMessageDelete
    QuestUserEnrollment
    Unknown(String)
    } derive(Eq,
    Debug
    )

    A subscribable outbound webhook event category.

    WebhookEventType::from_string

    fn WebhookEventType::from_string(value : String) -> WebhookEventType

    The WebhookEventType for its Discord string value; unknown values become Unknown(s).

    WebhookEventType::to_json

    WebhookEventType::to_string

    fn WebhookEventType::to_string(self : WebhookEventType) -> String

    The Discord string value of this WebhookEventType.

    WebhookMarker

    pub enum WebhookMarker {
    }

    Marker for IDs of a webhook.

    WebhookPayloadType

    pub(all) enum WebhookPayloadType {
    Ping
    Event
    Unknown(Int)
    } derive(Eq,
    Debug
    )

    The outer category of an outbound Discord webhook payload.

    WebhookPayloadType::from_int

    fn WebhookPayloadType::from_int(value : Int) -> WebhookPayloadType

    The WebhookPayloadType for its Discord integer value; unknown values become Unknown(n).

    WebhookPayloadType::to_int

    fn WebhookPayloadType::to_int(self : WebhookPayloadType) -> Int

    The Discord integer value of this WebhookPayloadType.

    WebhookPayloadType::to_json

    WebhookType

    pub(all) enum WebhookType {
    Incoming
    ChannelFollower
    Application
    Unknown(Int)
    } derive(Eq,
    Debug
    )

    The behavior category of a Discord webhook.

    WebhookType::from_int

    fn WebhookType::from_int(value : Int) -> WebhookType

    The WebhookType for its Discord integer value; unknown values become Unknown(n).

    WebhookType::to_int

    fn WebhookType::to_int(self : WebhookType) -> Int

    The Discord integer value of this WebhookType.

    WebhookType::to_json

    WebhooksUpdateEvent

    Webhook configuration changed in a guild channel.

    WelcomeScreen

    The welcome screen shown to new members of a community guild.

    WelcomeScreenChannel

    pub(all) struct WelcomeScreenChannel {
    channel_id : Id[ChannelMarker]
    description : String
    emoji_id : Nullable[Id[EmojiMarker]]
    emoji_name : Nullable[String]
    } derive(
    Debug
    ,
    FromJson
    ,
    ToJson
    )

    A channel suggested on a guild welcome screen.

    command_limit_violations

    fn command_limit_violations(typ~ : ApplicationCommandType, name~ : String, name_localizations~ : Map[String, String]?, description~ : String, description_localizations~ : Map[String, String]?, options~ : Array[CommandOption]) -> Array[LimitViolation]

    The limits Discord documents for an application command declaration (https://docs.discord.com/developers/interactions/application-commands):

    • command and option names are 1 to 32 characters, and CHAT_INPUT command and option names follow the naming rule (lowercase where a lowercase variant exists, no spaces or punctuation other than - and _);
    • CHAT_INPUT descriptions and option descriptions are 1 to 100 characters;
    • localizations follow the rules of the field they localize;
    • each options array holds at most 25 entries with unique names;
    • an option has at most 25 choices, whose names are 1 to 100 characters and whose string values are at most 100 characters;
    • min_length is 0 to 6000 and max_length is 1 to 6000;
    • a CHAT_INPUT command's names, descriptions, and string choice values total at most 8000 characters, counting only the longest localization of each field.

    The naming rule is checked for ASCII characters only: a non-ASCII character is never reported, so every reported name is certainly invalid.

    dispatch_event

    fn dispatch_event(t : String, d :
    Json
    ) -> Event raise

    Decode a dispatch payload by event name.

    Unknown names never raise. A known event raises only when its payload does not match the modeled wire shape; the gateway converts that failure into an unknown event so shard processing remains lenient.

    embed_limit_violations

    fn embed_limit_violations(embeds : Array[Embed]) -> Array[LimitViolation]

    The limits Discord documents for the embeds of one message, including the 6000-unit total across all of them.

    flatten

    fn[T] flatten(field : Nullable[T]?) -> T?

    Collapse an optional nullable field to a plain option: None for both an absent key and JSON null, Some(v) for a present value.

    This is a lossy view. Do not use it when the distinction between a missing key and JSON null matters, such as when building PATCH bodies or merging cache updates.

    test "flatten optional nullable fields" {
    let absent : @model.Nullable[String]? = None
    let null_value : @model.Nullable[String]? = Some(Null)
    let present : @model.Nullable[String]? = Some(Value("Moon"))
    debug_inspect(
    [
    @model.flatten(absent),
    @model.flatten(null_value),
    @model.flatten(present),
    ],
    content=(
    #|[None, None, Some("Moon")]
    ),
    )
    }

    message_component_limit_violations

    fn message_component_limit_violations(components : Array[Component]) -> Array[LimitViolation]

    The limits Discord documents for the components of one message, for both action-row layouts and Components V2.
    fn modal_limit_violations(title~ : String, components~ : Array[Component]) -> Array[LimitViolation]

    The limits Discord documents for a modal: its title, its top-level component count, and every component it carries.

    requires_components_v2

    fn requires_components_v2(components : Array[Component]) -> Bool

    Whether any top-level component requires Discord's Components V2 message flag.

    test "detect top-level Components V2 layouts" {
    let row : @model.Component = ActionRow({ id: None, components: [], })
    let container : @model.Component = Container({
    id: None,
    components: [],
    accent_color: None,
    spoiler: None,
    })
    assert_false(@model.requires_components_v2([row]))
    assert_true(@model.requires_components_v2([row, container]))
    }

    text_input_max_length

    let text_input_max_length : Int

    Discord's upper bound for a text input's min_length, max_length, and value. A prefilled value must also fit the input's own max_length (this bound when unset) measured in UTF-16 units: Discord accepts up to 4000 code points, but the official clients count the field in UTF-16 units and refuse to submit a modal whose prefill exceeds max_length until the user deletes text. Checked live on the Android and web clients.

    text_length

    fn text_length(text : String) -> Int

    The length Discord applies its documented text limits to: Unicode code points. An emoji outside the Basic Multilingual Plane is one character here, though it is two UTF-16 units in a MoonBit String. Verified live for message content, embed fields and totals, component custom ids and labels, command descriptions, role names, and audit log reasons. The official clients count their own input fields in UTF-16 units, so users typing emoji reach a field's limit sooner than a bot sending the same text.