grom

Types

pub type ActionRowComponent {
  ActionRowButton(MessageButton)
  ActionRowStringSelect(MessageStringSelect)
  ActionRowUserSelect(MessageUserSelect)
  ActionRowRoleSelect(MessageRoleSelect)
  ActionRowMentionableSelect(MessageMentionableSelect)
  ActionRowChannelSelect(MessageChannelSelect)
}

Constructors

Represents the time after which an AFK person will be moved to an AFK channel, if one is present.

pub type AfkTimeout {
  AfkTimeout60Seconds
  AfkTimeout300Seconds
  AfkTimeout900Seconds
  AfkTimeout1800Seconds
  AfkTimeout3600Seconds
}

Constructors

  • AfkTimeout60Seconds

    After 1 minute.

  • AfkTimeout300Seconds

    After 5 minutes.

  • AfkTimeout900Seconds

    After 15 minutes.

  • AfkTimeout1800Seconds

    After 30 minutes.

  • AfkTimeout3600Seconds

    After 60 minutes.

This type controls which persons get notified after mentioning them in a message.

This type will always be used as a special unique list - you cannot reuse the same variant.

That means that, i.e.

[
  AllowMentioningUsers(AllowMentioningAllUsers),
  AllowMentioningUsers(AllowMentioningSpecificUsers([some_id]))
]

is not a valid allowed mention.

In that case, the more specific allowed mention will be given priority. If multiple specific mentions are passed, only the first will be used.

If an empty list is passed (which is the default Grom behavior), contrary to default Discord behavior, no mentions will be allowed to notify users, to prevent abuse.

pub type AllowedMessageMention {
  AllowMentioningRoles(AllowedRoleMentions)
  AllowMentioningUsers(AllowedUserMentions)
  AllowMentioningAtEveryone
  AllowMentioningRepliedUser
}

Constructors

  • AllowMentioningRoles(AllowedRoleMentions)
  • AllowMentioningUsers(AllowedUserMentions)
  • AllowMentioningAtEveryone

    Allows mentioning @everyone and @here.

    Requires the AllowMentioningEveryone permission - otherwise ineffective.

  • AllowMentioningRepliedUser
pub type AllowedRoleMentions {
  AllowMentioningAllRoles
  AllowMentioningSpecificRoles(ids: List(Snowflake(Role)))
}

Constructors

  • AllowMentioningAllRoles
  • AllowMentioningSpecificRoles(ids: List(Snowflake(Role)))
pub type AllowedUserMentions {
  AllowMentioningAllUsers
  AllowMentioningSpecificUsers(ids: List(Snowflake(User)))
}

Constructors

  • AllowMentioningAllUsers
  • AllowMentioningSpecificUsers(ids: List(Snowflake(User)))
pub type AnnouncementChannel {
  AnnouncementChannel(
    id: Snowflake(AnnouncementChannel),
    channel_id: Snowflake(Channel),
    guild_channel_id: Snowflake(GuildChannel),
    thread_creatable_channel_id: Snowflake(ThreadCreatableChannel),
    permission_overwrites: List(PermissionOverwrite),
    guild_id: option.Option(Snowflake(Guild)),
    position: Int,
    name: String,
    topic: option.Option(String),
    is_nsfw: Bool,
    last_message_id: option.Option(Snowflake(Message)),
    last_pin_timestamp: option.Option(timestamp.Timestamp),
    default_thread_auto_archive_duration: ThreadAutoArchiveDuration,
    parent_id: option.Option(Snowflake(CategoryChannel)),
  )
}

Constructors

pub type Application {
  Application(
    id: Snowflake(Application),
    name: String,
    icon_hash: option.Option(ImageHash),
    description: String,
    rpc_origins: option.Option(List(String)),
    is_bot_public: Bool,
    bot_requires_code_grant: Bool,
    bot: option.Option(User),
    terms_of_service_url: option.Option(String),
    privacy_policy_url: option.Option(String),
    owner: ApplicationOwner,
    verify_key: String,
    guild: option.Option(Guild),
    primary_sku_id: option.Option(Snowflake(Sku)),
    slug: option.Option(String),
    cover_image_hash: option.Option(ImageHash),
    flags: List(ApplicationFlag),
    approximate_guild_count: option.Option(Int),
    approximate_user_install_count: option.Option(Int),
    approximate_user_authorization_count: option.Option(Int),
    redirect_uris: List(String),
    interactions_endpoint_url: option.Option(String),
    role_connections_verification_url: option.Option(String),
    webhook_events_url: option.Option(String),
    webhook_events_status: ApplicationWebhookEventStatus,
    webhook_events_types: option.Option(List(String)),
    tags: List(String),
    in_app_installation_settings: option.Option(
      ApplicationInstallationSettings,
    ),
    guild_installation_settings: option.Option(
      ApplicationInstallationSettings,
    ),
    user_installation_settings: option.Option(
      ApplicationInstallationSettings,
    ),
    custom_installation_url: option.Option(String),
  )
}

Constructors

  • Application(
      id: Snowflake(Application),
      name: String,
      icon_hash: option.Option(ImageHash),
      description: String,
      rpc_origins: option.Option(List(String)),
      is_bot_public: Bool,
      bot_requires_code_grant: Bool,
      bot: option.Option(User),
      terms_of_service_url: option.Option(String),
      privacy_policy_url: option.Option(String),
      owner: ApplicationOwner,
      verify_key: String,
      guild: option.Option(Guild),
      primary_sku_id: option.Option(Snowflake(Sku)),
      slug: option.Option(String),
      cover_image_hash: option.Option(ImageHash),
      flags: List(ApplicationFlag),
      approximate_guild_count: option.Option(Int),
      approximate_user_install_count: option.Option(Int),
      approximate_user_authorization_count: option.Option(Int),
      redirect_uris: List(String),
      interactions_endpoint_url: option.Option(String),
      role_connections_verification_url: option.Option(String),
      webhook_events_url: option.Option(String),
      webhook_events_status: ApplicationWebhookEventStatus,
      webhook_events_types: option.Option(List(String)),
      tags: List(String),
      in_app_installation_settings: option.Option(
        ApplicationInstallationSettings,
      ),
      guild_installation_settings: option.Option(
        ApplicationInstallationSettings,
      ),
      user_installation_settings: option.Option(
        ApplicationInstallationSettings,
      ),
      custom_installation_url: option.Option(String),
    )

    Arguments

    description

    Appears in a bot’s biography.

    rpc_origins

    List of RPC origin URLs, if RPC is enabled.

    is_bot_public

    If False, only the owner can add the app to guilds.

    bot_requires_code_grant

    If True, the bot will only join a guild upon completion of the full OAuth2 code grant flow.

    bot

    Is None if there’s no bot associated with the app.

    terms_of_service_url

    The app’s Terms of Service.

    Is None if the developer didn’t specify any Terms of Service.

    privacy_policy_url

    The app’s Privacy Policy.

    Is None if the developer didn’t specify any Privacy Policy.

    guild

    Guild associated with the app - for example, a developer support server.

    primary_sku_id

    If this app is a game sold on Discord, this field will be the ID of the Game SKU.

    slug

    If this app is a game sold on Discord, this field will be the URL slug that links to the store page.

    cover_image_hash

    Default rich presence invite cover image.

    approximate_guild_count

    Approximately, how many guilds has the app been added to?

    Is None if not computed yet.

    approximate_user_install_count

    Approximately, how many users installed the app?

    Is None if not computed yet.

    approximate_user_authorization_count

    Approximately, how many users have completed OAuth2 authorizations for the app?

    Is None if not computed yet.

    redirect_uris

    OAuth2 redirect URIs.

    interactions_endpoint_url

    The URL for webhook-based interactions.

    role_connections_verification_url

    The URL for verification to link an app to a user’s Discord profile.

    webhook_events_url

    The URL for webhook-based events.

    webhook_events_types

    The types of events the application is subscribed to (if any)

    tags

    A list of maximum 5 tags describing the application.

    in_app_installation_settings

    Installation settings for the default in-app authorization link.

    guild_installation_settings

    Default installation settings for guild installation.

    user_installation_settings

    Default installation settings for user installation.

    custom_installation_url

    Custom authorization URL.

pub type ApplicationEmoji {
  ApplicationEmoji(
    id: Snowflake(Emoji),
    name: String,
    creator: User,
    allowed_roles_ids: option.Option(List(Snowflake(Role))),
    requires_colons: Bool,
    is_integration_managed: Bool,
    is_animated: Bool,
    is_available: Bool,
  )
}

Constructors

  • ApplicationEmoji(
      id: Snowflake(Emoji),
      name: String,
      creator: User,
      allowed_roles_ids: option.Option(List(Snowflake(Role))),
      requires_colons: Bool,
      is_integration_managed: Bool,
      is_animated: Bool,
      is_available: Bool,
    )

    Arguments

    allowed_roles_ids

    Is None if the emoji is not restricted on a per-role basis.

    requires_colons

    Whether this emoji must be wrapped in colons.

    is_integration_managed

    Whether this emoji is managed by an integration.

pub type ApplicationFlag {
  ApplicationCreatedAutoModerationRule
  ApplicationApprovedForPresenceIntent
  ApplicationTemporarilyApprovedForPresenceIntent
  ApplicationApprovedForGuildMembersIntent
  ApplicationTemporarilyApprovedForGuildMembersIntent
  ApplicationGrowsUnusuallyFast
  ApplicationIsEmbedded
  ApplicationApprovedForMessageContentIntent
  ApplicationTemporarilyApprovedForMessageContentIntent
  ApplicationRegisteredGlobalCommand
}

Constructors

  • ApplicationCreatedAutoModerationRule

    The application was awarded a badge for creating an auto moderation rule

  • ApplicationApprovedForPresenceIntent

    The application is approved for the privileged presence intent. (100+ guilds)

  • ApplicationTemporarilyApprovedForPresenceIntent

    The application is temporarily approved for the privileged presence intent (0-99 guilds)

  • ApplicationApprovedForGuildMembersIntent

    The application is approved for the privileged guild members intent. (100+ guilds)

  • ApplicationTemporarilyApprovedForGuildMembersIntent

    The application is temporarily approved for the privileged guild members intent (0-99 guilds)

  • ApplicationGrowsUnusuallyFast

    Indicates unusual growth of an app that prevents verification.

  • ApplicationIsEmbedded

    The application is embedded within the Discord client (unavailable publicly)

  • ApplicationApprovedForMessageContentIntent

    The application is approved for the privileged message content intent. (100+ guilds)

  • ApplicationTemporarilyApprovedForMessageContentIntent

    The application is temporarily approved for the privileged message content intent (0-99 guilds)

  • ApplicationRegisteredGlobalCommand

    The application was awarded a badge for creating a global command

Describes variable values during application installation.

pub type ApplicationInstallationSettings {
  ApplicationInstallationSettings(
    scopes: List(String),
    permissions: List(Permission),
  )
}

Constructors

  • ApplicationInstallationSettings(
      scopes: List(String),
      permissions: List(Permission),
    )

    Arguments

    scopes

    The OAuth2 scopes the app will be installed with.

    permissions

    The permissions the app will be installed with.

pub type ApplicationInstallationType {
  GuildInstalledApplication
  UserInstalledApplication
}

Constructors

  • GuildInstalledApplication

    A guild installed application allows all members of the guild to use its functionality.

    They may also receive permissions in the guild and execute permission-restricted actions, such as kicking members.

  • UserInstalledApplication

    A user installed application only allows the user who installed it to themselves to use its functionality.

    User installed applications cannot receive guild permissions - they can only respond to interactions.

    In DMs, the interaction response will be posted to all recipients.

    In guilds, whether the response will be ephemeral depends on whether the executing user has the AllowUsingExternalApplications permission.

pub type ApplicationOwner {
  ApplicationOwnerUser(user: User)
  ApplicationOwnerTeam(team: DeveloperTeam)
}

Constructors

pub type ApplicationWebhookEventStatus {
  ApplicationWebhookEventsDisabled
  ApplicationWebhookEventsEnabled
  ApplicationWebhookEventsDisabledByDiscord
}

Constructors

  • ApplicationWebhookEventsDisabled

    The application isn’t receiving webhook events

  • ApplicationWebhookEventsEnabled

    The application’s receiving webhook events

  • ApplicationWebhookEventsDisabledByDiscord

    The application’s webhook events were disabled by Discord (usually due to inactivity)

pub type AttachmentSlashCommandOption {
  AttachmentSlashCommandOption(
    name: String,
    name_localizations: option.Option(dict.Dict(Locale, String)),
    description: String,
    description_localizations: option.Option(
      dict.Dict(Locale, String),
    ),
    is_required: Bool,
    file_types: List(FileUploadFilter),
  )
}

Constructors

pub type AudioMessageAttachment {
  AudioMessageAttachment(duration: duration.Duration)
}

Constructors

This is always a slash command.

pub type AutocompleteRequestCommand {
  AutocompleteRequestCommand(
    id: Snowflake(Command),
    slash_command_id: Snowflake(SlashCommand),
    name: String,
    guild_id: option.Option(Snowflake(Guild)),
    options: List(AutocompleteRequestCommandOption),
    resolved_objects: InteractionResolvedObjects,
  )
}

Constructors

pub type AutocompleteRequestCommandOption {
  AutocompleteRequestCommandOptionSubCommand(
    AutocompleteRequestSubCommandCommandOption,
  )
  AutocompleteRequestCommandOptionSubCommandGroup(
    AutocompleteRequestSubCommandGroupCommandOption,
  )
  AutocompleteRequestCommandOptionString(
    AutocompleteRequestStringCommandOption,
  )
  AutocompleteRequestCommandOptionInt(
    AutocompleteRequestIntCommandOption,
  )
  AutocompleteRequestCommandOptionFloat(
    AutocompleteRequestFloatCommandOption,
  )
}

Constructors

pub type AutocompleteRequestFloatCommandOption {
  AutocompleteRequestFloatCommandOption(
    name: String,
    value: Float,
    is_focused: Bool,
  )
}

Constructors

  • AutocompleteRequestFloatCommandOption(
      name: String,
      value: Float,
      is_focused: Bool,
    )
pub type AutocompleteRequestIntCommandOption {
  AutocompleteRequestIntCommandOption(
    name: String,
    value: Int,
    is_focused: Bool,
  )
}

Constructors

  • AutocompleteRequestIntCommandOption(
      name: String,
      value: Int,
      is_focused: Bool,
    )
pub type AutocompleteRequestInteraction {
  AutocompleteRequestInteraction(
    id: Snowflake(Interaction),
    application_id: Snowflake(Application),
    command: AutocompleteRequestCommand,
    invokement_data: InteractionInvokementData,
    channel_id: Snowflake(Channel),
    token: AutocompleteRequestInteractionToken,
    application_permissions: List(Permission),
    invoking_user_locale: Locale,
    invoking_user_entitlements: List(Entitlement),
    context: InteractionContext,
    authorizing_installers: InteractionAuthorizingInstallers,
  )
}

Constructors

pub opaque type AutocompleteRequestInteractionResponse
pub opaque type AutocompleteRequestInteractionToken
pub type AutocompleteRequestStringCommandOption {
  AutocompleteRequestStringCommandOption(
    name: String,
    value: String,
    is_focused: Bool,
  )
}

Constructors

  • AutocompleteRequestStringCommandOption(
      name: String,
      value: String,
      is_focused: Bool,
    )
pub type AutocompleteRequestSubCommandCommandOption {
  AutocompleteRequestSubCommandCommandOption(
    name: String,
    options: List(AutocompleteRequestSubCommandOption),
  )
}

Constructors

pub type AutocompleteRequestSubCommandGroupCommandOption {
  AutocompleteRequestSubCommandGroupCommandOption(
    name: String,
    options: List(AutocompleteRequestSubCommandGroupOption),
  )
}

Constructors

pub type AutocompleteRequestSubCommandGroupOption {
  AutocompleteRequestSubCommandGroupOptionSubCommand(
    AutocompleteRequestSubCommandCommandOption,
  )
  AutocompleteRequestSubCommandGroupOptionSubCommandGroup(
    AutocompleteRequestSubCommandGroupCommandOption,
  )
}

Constructors

pub type AutocompleteRequestSubCommandOption {
  AutocompleteRequestSubCommandOptionString(
    AutocompleteRequestStringCommandOption,
  )
  AutocompleteRequestSubCommandOptionInt(
    AutocompleteRequestIntCommandOption,
  )
  AutocompleteRequestSubCommandOptionFloat(
    AutocompleteRequestFloatCommandOption,
  )
}

Constructors

pub type BoolSlashCommandOption {
  BoolSlashCommandOption(
    name: String,
    name_localizations: option.Option(dict.Dict(Locale, String)),
    description: String,
    description_localizations: option.Option(
      dict.Dict(Locale, String),
    ),
    is_required: Bool,
  )
}

Constructors

pub type BulkGuildBanResponse {
  BulkGuildBanResponse(
    banned_users: List(Snowflake(User)),
    failed_users: List(Snowflake(User)),
  )
}

Constructors

pub opaque type BulkOverwriteGlobalCommands
pub opaque type BulkOverwriteGuildCommands
pub type CategoryChannel {
  CategoryChannel(
    id: Snowflake(CategoryChannel),
    channel_id: Snowflake(Channel),
    guild_channel_id: Snowflake(GuildChannel),
    permission_overwrites: List(PermissionOverwrite),
    guild_id: option.Option(Snowflake(Guild)),
    position: Int,
    name: String,
  )
}

Constructors

pub type Channel {
  ChannelText(TextChannel)
  ChannelVoice(VoiceChannel)
  ChannelCategory(CategoryChannel)
  ChannelAnnouncement(AnnouncementChannel)
  ChannelStage(StageChannel)
  ChannelForum(ForumChannel)
  ChannelMedia(MediaChannel)
  ChannelDm(DmChannel)
  ChannelThread(Thread)
}

Constructors

pub type ChannelSlashCommandOption {
  ChannelSlashCommandOption(
    name: String,
    name_localizations: option.Option(dict.Dict(Locale, String)),
    description: String,
    description_localizations: option.Option(
      dict.Dict(Locale, String),
    ),
    is_required: Bool,
    channel_types: List(SelectChannelType),
  )
}

Constructors

pub type ClipMessageAttachment {
  ClipMessageAttachment(
    height: Int,
    width: Int,
    placeholder: String,
    placeholder_version: Int,
    duration: duration.Duration,
    participants: List(User),
    created_timestamp: timestamp.Timestamp,
    application: option.Option(Application),
  )
}

Constructors

pub type Command {
  CommandSlash(SlashCommand)
  CommandUser(UserCommand)
  CommandMessage(MessageCommand)
}

Constructors

pub type CommandContext {
  CommandUsableInGuilds
  CommandUsableInBotDms
  CommandUsableInDms
}

Constructors

  • CommandUsableInGuilds
  • CommandUsableInBotDms
  • CommandUsableInDms

    The command is usable in DMs between different users.

pub type CommandInstallationType {
  GuildInstalledCommand
  UserInstalledCommand
}

Constructors

  • GuildInstalledCommand

    A guild installed command can be used when the application is guild installed.

  • UserInstalledCommand

    A user installed command can be used when the application is user installed.

pub type CommandInteraction {
  CommandInteraction(
    id: Snowflake(Interaction),
    application_id: Snowflake(Application),
    command: ExecutedCommand,
    invokement_data: InteractionInvokementData,
    channel_id: Snowflake(Channel),
    token: CommandInteractionToken,
    interaction_token: InteractionToken,
    application_permissions: List(Permission),
    invoking_user_locale: Locale,
    invoking_user_entitlements: List(Entitlement),
    context: InteractionContext,
    authorizing_installers: InteractionAuthorizingInstallers,
  )
}

Constructors

pub opaque type CommandInteractionResponse
pub opaque type CommandInteractionToken
pub type CommandVersion
pub type ComponentEmoji {
  UnicodeComponentEmoji(character: String)
  CustomComponentEmoji(
    id: Snowflake(Emoji),
    name: String,
    is_animated: Bool,
  )
}

Constructors

  • UnicodeComponentEmoji(character: String)
  • CustomComponentEmoji(
      id: Snowflake(Emoji),
      name: String,
      is_animated: Bool,
    )
pub type ContainerComponent {
  ContainerActionRow(MessageActionRow)
  ContainerTextDisplay(MessageTextDisplay)
  ContainerSection(MessageSection)
  ContainerMediaGallery(MessageMediaGallery)
  ContainerSeparator(MessageSeparator)
  ContainerFile(MessageFile)
}

Constructors

pub type CreateActionRowComponent {
  CreateActionRowButton(CreateMessageButton)
  CreateActionRowStringSelect(CreateMessageStringSelect)
  CreateActionRowUserSelect(CreateMessageUserSelect)
  CreateActionRowRoleSelect(CreateMessageRoleSelect)
  CreateActionRowMentionableSelect(
    CreateMessageMentionableSelect,
  )
  CreateActionRowChannelSelect(CreateMessageChannelSelect)
}

Constructors

pub opaque type CreateAnnouncementChannel
pub opaque type CreateCategoryChannel
pub opaque type CreateCheckboxGroupOption
pub type CreateContainerComponent {
  CreateContainerActionRow(CreateMessageActionRow)
  CreateContainerTextDisplay(CreateMessageTextDisplay)
  CreateContainerSection(CreateMessageSection)
  CreateContainerMediaGallery(CreateMessageMediaGallery)
  CreateContainerSeparator(CreateMessageSeparator)
  CreateContainerFile(CreateMessageFile)
}

Constructors

pub opaque type CreateEmbedAuthor
pub opaque type CreateEmbedField
pub opaque type CreateEmbedFooter
pub opaque type CreateEmbedImage
pub opaque type CreateForumChannel
pub opaque type CreateForumLikeThread
pub opaque type CreateForumLikeThreadMessage
pub opaque type CreateForumLikeThreadMessageEmbed
pub type CreateForumLikeThreadMessageFlag {
  CreateForumLikeThreadMessageWithSuppressedEmbeds
  CreateForumLikeThreadMessageWithSuppressedNotifications
  CreateForumLikeThreadMessageUsingComponentsV2
}

Constructors

  • CreateForumLikeThreadMessageWithSuppressedEmbeds
  • CreateForumLikeThreadMessageWithSuppressedNotifications
  • CreateForumLikeThreadMessageUsingComponentsV2
pub opaque type CreateGlobalMessageCommand
pub opaque type CreateGlobalSlashCommand
pub opaque type CreateGlobalUserCommand
pub opaque type CreateGuildChannelInvite
pub opaque type CreateGuildMessageCommand
pub opaque type CreateGuildSlashCommand
pub opaque type CreateGuildSoundboardSound
pub opaque type CreateGuildSticker
pub opaque type CreateGuildUserCommand
pub opaque type CreateLinkButton
pub opaque type CreateMediaChannel
pub opaque type CreateMediaGalleryItem
pub opaque type CreateMessage
pub opaque type CreateMessageActionRow
pub opaque type CreateMessageAttachment
pub type CreateMessageButton {
  CreateRegularMessageButton(CreateRegularButton)
  CreateLinkMessageButton(CreateLinkButton)
  CreatePremiumMessageButton(CreatePremiumButton)
}

Constructors

pub opaque type CreateMessageChannelSelect
pub type CreateMessageComponent {
  CreateMessageActionRowComponent(CreateMessageActionRow)
  CreateMessageSectionComponent(CreateMessageSection)
  CreateMessageTextDisplayComponent(CreateMessageTextDisplay)
  CreateMessageMediaGalleryComponent(CreateMessageMediaGallery)
  CreateMessageFileComponent(CreateMessageFile)
  CreateMessageSeparatorComponent(CreateMessageSeparator)
  CreateMessageContainerComponent(CreateMessageContainer)
}

Constructors

pub opaque type CreateMessageContainer
pub opaque type CreateMessageEmbed
pub opaque type CreateMessageFile
pub type CreateMessageFlag {
  CreateMessageWithSuppressedEmbeds
  CreateMessageWithSuppressedNotifications
  CreateMessageUsingComponentsV2
}

Constructors

  • CreateMessageWithSuppressedEmbeds

    Makes the links in the message not create an embed.

  • CreateMessageWithSuppressedNotifications
  • CreateMessageUsingComponentsV2

    If this flag is set, you cannot set content, embeds, sticker_ids, or poll.

pub opaque type CreateMessageMediaGallery
pub opaque type CreateMessageMentionableSelect
pub opaque type CreateMessageReference
pub opaque type CreateMessageRoleSelect
pub opaque type CreateMessageSection
pub opaque type CreateMessageSeparator
pub opaque type CreateMessageStringSelect
pub opaque type CreateMessageTextDisplay
pub opaque type CreateMessageThumbnail
pub opaque type CreateMessageUserSelect
pub opaque type CreateModalChannelSelect
pub opaque type CreateModalCheckbox
pub opaque type CreateModalCheckboxGroup
pub type CreateModalComponent {
  CreateModalTextDisplayComponent(CreateModalTextDisplay)
  CreateModalLabelComponent(CreateModalLabel)
}

Constructors

pub opaque type CreateModalFileUpload
pub opaque type CreateModalLabel
pub type CreateModalLabelComponent {
  CreateModalLabelStringSelectComponent(CreateModalStringSelect)
  CreateModalLabelTextInputComponent(CreateModalTextInput)
  CreateModalLabelUserSelectComponent(CreateModalUserSelect)
  CreateModalLabelRoleSelectComponent(CreateModalRoleSelect)
  CreateModalLabelMentionableSelectComponent(
    CreateModalMentionableSelect,
  )
  CreateModalLabelChannelSelectComponent(
    CreateModalChannelSelect,
  )
  CreateModalLabelFileUploadComponent(CreateModalFileUpload)
  CreateModalLabelRadioGroupComponent(CreateModalRadioGroup)
  CreateModalLabelCheckboxGroupComponent(
    CreateModalCheckboxGroup,
  )
  CreateModalLabelCheckboxComponent(CreateModalCheckbox)
}

Constructors

pub opaque type CreateModalMentionableSelect
pub opaque type CreateModalRadioGroup
pub opaque type CreateModalRoleSelect
pub opaque type CreateModalStringSelect
pub opaque type CreateModalTextDisplay
pub opaque type CreateModalTextInput
pub opaque type CreateModalUserSelect
pub opaque type CreatePoll
pub opaque type CreatePollAnswer
pub type CreatePollAnswerEmoji {
  CreatePollAnswerUnicodeEmoji(character: String)
  CreatePollAnswerCustomEmoji(id: Snowflake(Emoji))
}

Constructors

  • CreatePollAnswerUnicodeEmoji(character: String)
  • CreatePollAnswerCustomEmoji(id: Snowflake(Emoji))
pub opaque type CreatePremiumButton
pub opaque type CreateRadioGroupOption
pub opaque type CreateRegularButton
pub opaque type CreateRole
pub type CreateSectionAccessory {
  CreateSectionButton(CreateMessageButton)
  CreateSectionThumbnail(CreateMessageThumbnail)
}

Constructors

pub type CreateSectionComponent {
  CreateSectionTextDisplay(CreateMessageTextDisplay)
}

Constructors

pub opaque type CreateStageChannel
pub opaque type CreateStageInstance
pub opaque type CreateTextChannel
pub opaque type CreateThread
pub opaque type CreateThreadFromMessage
pub opaque type CreateUnfurledMediaItem
pub opaque type CreateVoiceChannel
pub type CustomEmoji {
  CustomEmoji(
    id: Snowflake(Emoji),
    name: String,
    allowed_roles_ids: option.Option(List(Snowflake(Role))),
    requires_colons: Bool,
    is_integration_managed: Bool,
    is_animated: Bool,
    is_available: Bool,
  )
}

Constructors

  • CustomEmoji(
      id: Snowflake(Emoji),
      name: String,
      allowed_roles_ids: option.Option(List(Snowflake(Role))),
      requires_colons: Bool,
      is_integration_managed: Bool,
      is_animated: Bool,
      is_available: Bool,
    )

    Arguments

    allowed_roles_ids

    Is None if the emoji is not restricted on a per-role basis.

    requires_colons

    Whether this emoji must be wrapped in colons.

    is_integration_managed

    Whether this emoji is managed by an integration.

    is_available

    May be False when a server loses boosts.

pub type DefaultForumReaction {
  CustomDefaultForumReaction(id: Snowflake(CustomEmoji))
  StandardDefaultForumReaction(character: String)
}

Constructors

  • CustomDefaultForumReaction(id: Snowflake(CustomEmoji))
  • StandardDefaultForumReaction(character: String)
pub type DeveloperTeam {
  DeveloperTeam(
    id: Snowflake(DeveloperTeam),
    members: List(DeveloperTeamMember),
    icon_hash: option.Option(ImageHash),
    name: String,
    owner_id: Snowflake(User),
  )
}

Constructors

pub type DeveloperTeamMember {
  DeveloperTeamMember(
    user: User,
    role: DeveloperTeamMemberRole,
    team_id: Snowflake(DeveloperTeam),
    membership_state: DeveloperTeamMembershipState,
  )
}

Constructors

pub type DeveloperTeamMemberRole {
  DeveloperTeamAdmin
  DeveloperTeamDeveloper
  DeveloperTeamReadOnlyAccess
}

Constructors

  • DeveloperTeamAdmin

    Owners and admins have the admin role.

    Use the DeveloperTeam.owner_id property to determine who is the owner of the team.

  • DeveloperTeamDeveloper
  • DeveloperTeamReadOnlyAccess
pub type DeveloperTeamMembershipState {
  DeveloperIsAccepted
  DeveloperIsInvited
}

Constructors

  • DeveloperIsAccepted

    The developer was invited to the team and accepted the invite.

  • DeveloperIsInvited

    The developer was invited to the team and has not accepted the invite (yet).

pub type DmChannel {
  DmChannel(
    id: Snowflake(DmChannel),
    channel_id: Snowflake(Channel),
    last_message_id: option.Option(Snowflake(Message)),
    recipient: User,
    last_pin_timestamp: option.Option(timestamp.Timestamp),
  )
}

Constructors

pub type EmbedAuthor {
  EmbedAuthor(
    name: String,
    url: option.Option(String),
    icon_url: option.Option(String),
    proxy_icon_url: option.Option(String),
  )
}

Constructors

pub type EmbedField {
  EmbedField(name: String, value: String, is_inline: Bool)
}

Constructors

  • EmbedField(name: String, value: String, is_inline: Bool)
pub type EmbedFooter {
  EmbedFooter(
    text: String,
    icon_url: option.Option(String),
    proxy_icon_url: option.Option(String),
  )
}

Constructors

pub type EmbedImage {
  EmbedImage(
    url: String,
    proxy_url: String,
    height: Int,
    width: Int,
    content_type: String,
    placeholder: String,
    placeholder_version: Int,
    description: option.Option(String),
    flags: List(EmbedImageFlag),
  )
}

Constructors

  • EmbedImage(
      url: String,
      proxy_url: String,
      height: Int,
      width: Int,
      content_type: String,
      placeholder: String,
      placeholder_version: Int,
      description: option.Option(String),
      flags: List(EmbedImageFlag),
    )

    Arguments

    height

    In pixels.

    width

    In pixels.

    placeholder

    Thumbhash representation of a placeholder.

    placeholder_version

    Thumbhash version.

pub type EmbedImageFlag {
  EmbedImageIsAnimated
}

Constructors

  • EmbedImageIsAnimated
pub type EmbedType {
  RichEmbed
  ImageEmbed
  VideoEmbed
  GifEmbed
  ArticleEmbed
  LinkEmbed
  PollResultsEmbed
}

Constructors

  • RichEmbed
  • ImageEmbed
  • VideoEmbed
  • GifEmbed
  • ArticleEmbed
  • LinkEmbed
  • PollResultsEmbed
pub type EmbedVideo {
  EmbedVideo(
    url: String,
    proxy_url: String,
    height: Int,
    width: Int,
    content_type: String,
    placeholder: String,
    placeholder_version: Int,
    description: option.Option(String),
  )
}

Constructors

  • EmbedVideo(
      url: String,
      proxy_url: String,
      height: Int,
      width: Int,
      content_type: String,
      placeholder: String,
      placeholder_version: Int,
      description: option.Option(String),
    )

    Arguments

    height

    In pixels.

    width

    In pixels.

    placeholder

    Thumbhash representation of a placeholder.

    placeholder_version

    Thumbhash version.

pub type Emoji {
  EmojiUnicode(character: String)
  EmojiCustom(emoji: CustomEmoji)
  EmojiApplication(emoji: ApplicationEmoji)
}

Constructors

An “entitlement” is something a user gets access to by purchasing an application’s premium offer (SKU).

pub type Entitlement {
  Entitlement(
    id: Snowflake(Entitlement),
    sku_id: Snowflake(Sku),
    application_id: Snowflake(Application),
    type_: EntitlementType,
    is_deleted: Bool,
    start_timestamp: option.Option(timestamp.Timestamp),
    end_timestamp: option.Option(timestamp.Timestamp),
    holder: EntitlementHolder,
    is_consumed: option.Option(Bool),
  )
}

Constructors

pub type EntitlementHolder {
  UserEntitlementHolder(id: Snowflake(User))
  GuildEntitlementHolder(id: Snowflake(Guild))
}

Constructors

  • UserEntitlementHolder(id: Snowflake(User))

    The perks were given to a user.

  • GuildEntitlementHolder(id: Snowflake(Guild))

    The perks were given to a guild.

pub type EntitlementType {
  EntitlementThroughPurchase
  EntitlementThroughPremiumSubscription
  EntitlementThroughDeveloperGift
  EntitlementThroughTestModePurchase
  EntitlementThroughFreePurchase
  EntitlementThroughUserGift
  EntitlementThroughPremiumPurchase
  EntitlementThroughApplicationSubscription
}

Constructors

  • EntitlementThroughPurchase

    The entitlement was purchased by a user.

  • EntitlementThroughPremiumSubscription

    The entitlement is for a Discord Nitro subscription.

  • EntitlementThroughDeveloperGift

    The entitlement was gifted to a user/guild by the application’s developer.

  • EntitlementThroughTestModePurchase

    The entitlement was purchased by a developer in application test mode.

  • EntitlementThroughFreePurchase

    The entitlement was granted when the SKU was free.

  • EntitlementThroughUserGift

    The entitlement was gifted to a user/guild by another user.

  • EntitlementThroughPremiumPurchase

    The entitlement was claimed by user for free as a Nitro subscriber.

  • EntitlementThroughApplicationSubscription

    The entitlement was purchased as an application subscription.

pub type ErrorCode {
  IntErrorCode(Int)
  StringErrorCode(String)
}

Constructors

  • IntErrorCode(Int)
  • StringErrorCode(String)
pub type ErrorItem {
  ErrorItem(code: ErrorCode, message: String)
}

Constructors

  • ErrorItem(code: ErrorCode, message: String)
pub type ErrorNode {
  ErrorNode(List(ErrorItem))
  ErrorBranch(dict.Dict(String, ErrorNode))
}

Constructors

pub type ErrorResponse {
  ErrorResponse(
    code: Int,
    message: String,
    errors: option.Option(ErrorNode),
  )
}

Constructors

  • ErrorResponse(
      code: Int,
      message: String,
      errors: option.Option(ErrorNode),
    )

    Arguments

    code

    See the list of error codes: link

    message

    User-friendly message briefly explaining what error happened.

    errors

    Contains a tree of errors

pub type ExecutedAttachmentSlashCommandOption {
  ExecutedAttachmentSlashCommandOption(
    name: String,
    value: Snowflake(MessageAttachment),
  )
}

Constructors

pub type ExecutedBoolSlashCommandOption {
  ExecutedBoolSlashCommandOption(name: String, value: Bool)
}

Constructors

  • ExecutedBoolSlashCommandOption(name: String, value: Bool)
pub type ExecutedButton {
  ExecutedButton(custom_id: String)
}

Constructors

  • ExecutedButton(custom_id: String)
pub type ExecutedChannelSelect {
  ExecutedChannelSelect(
    custom_id: String,
    selected_channels_ids: List(Snowflake(Channel)),
    resolved_channels: dict.Dict(
      Snowflake(Channel),
      ResolvedChannel,
    ),
  )
}

Constructors

pub type ExecutedChannelSlashCommandOption {
  ExecutedChannelSlashCommandOption(
    name: String,
    value: Snowflake(Channel),
  )
}

Constructors

pub type ExecutedCommand {
  ExecutedCommand(
    id: Snowflake(Command),
    name: String,
    guild_id: option.Option(Snowflake(Guild)),
    data: ExecutedCommandData,
    resolved_objects: InteractionResolvedObjects,
  )
}

Constructors

pub type ExecutedCommandData {
  ExecutedSlashCommand(options: List(ExecutedSlashCommandOption))
  ExecutedUserCommand(target_user_id: Snowflake(User))
  ExecutedMessageCommand(target_message_id: Snowflake(Message))
}

Constructors

pub type ExecutedFloatSlashCommandOption {
  ExecutedFloatSlashCommandOption(name: String, value: Float)
}

Constructors

  • ExecutedFloatSlashCommandOption(name: String, value: Float)
pub type ExecutedIntSlashCommandOption {
  ExecutedIntSlashCommandOption(name: String, value: Int)
}

Constructors

  • ExecutedIntSlashCommandOption(name: String, value: Int)
pub type ExecutedMentionableSelect {
  ExecutedMentionableSelect(
    custom_id: String,
    selected_mentionables_ids: List(Snowflake(Mentionable)),
    resolved_users: dict.Dict(Snowflake(Mentionable), User),
    resolved_guild_members: option.Option(
      dict.Dict(Snowflake(Mentionable), ResolvedGuildMember),
    ),
    resolved_roles: dict.Dict(Snowflake(Mentionable), Role),
  )
}

Constructors

pub type ExecutedMentionableSlashCommandOption {
  ExecutedMentionableSlashCommandOption(
    name: String,
    value: Snowflake(Mentionable),
  )
}

Constructors

pub type ExecutedMessageComponent {
  ButtonExecuted(ExecutedButton)
  StringSelectExecuted(ExecutedStringSelect)
  UserSelectExecuted(ExecutedUserSelect)
  RoleSelectExecuted(ExecutedRoleSelect)
  MentionableSelectExecuted(ExecutedMentionableSelect)
  ChannelSelectExecuted(ExecutedChannelSelect)
}

Constructors

pub type ExecutedRoleSelect {
  ExecutedRoleSelect(
    custom_id: String,
    selected_roles_ids: List(Snowflake(Role)),
    resolved_roles: dict.Dict(Snowflake(Role), Role),
  )
}

Constructors

pub type ExecutedRoleSlashCommandOption {
  ExecutedRoleSlashCommandOption(
    name: String,
    value: Snowflake(Role),
  )
}

Constructors

  • ExecutedRoleSlashCommandOption(
      name: String,
      value: Snowflake(Role),
    )
pub type ExecutedSlashCommandOption {
  ExecutedSlashCommandOptionSubCommand(
    ExecutedSubCommandSlashCommandOption,
  )
  ExecutedSlashCommandOptionSubCommandGroup(
    ExecutedSubCommandGroupSlashCommandOption,
  )
  ExecutedSlashCommandOptionString(
    ExecutedStringSlashCommandOption,
  )
  ExecutedSlashCommandOptionInt(ExecutedIntSlashCommandOption)
  ExecutedSlashCommandOptionFloat(
    ExecutedFloatSlashCommandOption,
  )
  ExecutedSlashCommandOptionBool(ExecutedBoolSlashCommandOption)
  ExecutedSlashCommandOptionUser(ExecutedUserSlashCommandOption)
  ExecutedSlashCommandOptionChannel(
    ExecutedChannelSlashCommandOption,
  )
  ExecutedSlashCommandOptionRole(ExecutedRoleSlashCommandOption)
  ExecutedSlashCommandOptionMentionable(
    ExecutedMentionableSlashCommandOption,
  )
  ExecutedSlashCommandOptionAttachment(
    ExecutedAttachmentSlashCommandOption,
  )
}

Constructors

pub type ExecutedStringSelect {
  ExecutedStringSelect(
    custom_id: String,
    selected_values: List(String),
  )
}

Constructors

  • ExecutedStringSelect(
      custom_id: String,
      selected_values: List(String),
    )
pub type ExecutedStringSlashCommandOption {
  ExecutedStringSlashCommandOption(name: String, value: String)
}

Constructors

  • ExecutedStringSlashCommandOption(name: String, value: String)
pub type ExecutedSubCommandGroupOption {
  ExecutedSubCommandGroupOptionSubCommand(
    ExecutedSubCommandSlashCommandOption,
  )
  ExecutedSubCommandGroupOptionSubCommandGroup(
    ExecutedSubCommandGroupSlashCommandOption,
  )
}

Constructors

pub type ExecutedSubCommandGroupSlashCommandOption {
  ExecutedSubCommandGroupSlashCommandOption(
    name: String,
    options: List(ExecutedSubCommandGroupOption),
  )
}

Constructors

pub type ExecutedSubCommandOption {
  ExecutedSubCommandOptionString(
    ExecutedStringSlashCommandOption,
  )
  ExecutedSubCommandOptionInt(ExecutedIntSlashCommandOption)
  ExecutedSubCommandOptionFloat(ExecutedFloatSlashCommandOption)
  ExecutedSubCommandOptionBool(ExecutedBoolSlashCommandOption)
  ExecutedSubCommandOptionUser(ExecutedUserSlashCommandOption)
  ExecutedSubCommandOptionChannel(
    ExecutedChannelSlashCommandOption,
  )
  ExecutedSubCommandOptionRole(ExecutedRoleSlashCommandOption)
  ExecutedSubCommandOptionMentionable(
    ExecutedMentionableSlashCommandOption,
  )
  ExecutedSubCommandOptionAttachment(
    ExecutedAttachmentSlashCommandOption,
  )
}

Constructors

pub type ExecutedSubCommandSlashCommandOption {
  ExecutedSubCommandSlashCommandOption(
    name: String,
    options: List(ExecutedSubCommandOption),
  )
}

Constructors

pub type ExecutedUserSelect {
  ExecutedUserSelect(
    custom_id: String,
    selected_users_ids: List(Snowflake(User)),
    resolved_users: dict.Dict(Snowflake(User), User),
    resolved_guild_members: option.Option(
      dict.Dict(Snowflake(User), ResolvedGuildMember),
    ),
  )
}

Constructors

pub type ExecutedUserSlashCommandOption {
  ExecutedUserSlashCommandOption(
    name: String,
    value: Snowflake(User),
  )
}

Constructors

  • ExecutedUserSlashCommandOption(
      name: String,
      value: Snowflake(User),
    )
pub type File {
  File(name: String, content_type: String, content: BitArray)
}

Constructors

  • File(name: String, content_type: String, content: BitArray)

CAUTION: The filter doesn’t check file contents, only the file’s extension!

You’re still expected to verify file contents.

pub type FileUploadFilter {
  AcceptUploadingImages
  AcceptUploadingVideos
  AcceptUploadingAudios
  AcceptUploadingFilesWithExtension(extension: String)
}

Constructors

  • AcceptUploadingImages

    Default set: .png, .gif, .jpg, .jpeg, .jfif, .webp, .avif

  • AcceptUploadingVideos

    Default set: .mp4, .mov, .qt, .webm

  • AcceptUploadingAudios

    Default set: .mp3, .m4a, .wav, .ogg, .opus, .flac

  • AcceptUploadingFilesWithExtension(extension: String)

    Including the . prefix.

pub type FloatSlashCommandOption {
  FloatSlashCommandOption(
    name: String,
    name_localizations: option.Option(dict.Dict(Locale, String)),
    description: String,
    description_localizations: option.Option(
      dict.Dict(Locale, String),
    ),
    is_required: Bool,
    choices: List(FloatSlashCommandOptionChoice),
    min_value: option.Option(Float),
    max_value: option.Option(Float),
    is_autocomplete_enabled: Bool,
  )
}

Constructors

pub type FloatSlashCommandOptionChoice {
  FloatSlashCommandOptionChoice(
    name: String,
    name_localizations: option.Option(dict.Dict(Locale, String)),
    value: Float,
  )
}

Constructors

A followed channel represents a followed announcement channel, which copies its messages to a text channel.

pub type FollowedChannel {
  FollowedChannel(
    source_channel_id: Snowflake(AnnouncementChannel),
    target_channel_id: Snowflake(TextChannel),
  )
}

Constructors

pub type ForumChannel {
  ForumChannel(
    id: Snowflake(ForumChannel),
    channel_id: Snowflake(Channel),
    guild_channel_id: Snowflake(GuildChannel),
    forum_like_channel_id: Snowflake(ForumLikeChannel),
    permission_overwrites: List(PermissionOverwrite),
    guild_id: option.Option(Snowflake(Guild)),
    position: Int,
    name: String,
    topic: option.Option(String),
    rate_limit_per_user: RateLimitPerUser,
    last_thread_id: option.Option(Snowflake(Thread)),
    parent_id: option.Option(Snowflake(CategoryChannel)),
    default_thread_auto_archive_duration: ThreadAutoArchiveDuration,
    flags: List(ForumChannelFlag),
    available_tags: List(ForumTag),
    default_reaction: option.Option(DefaultForumReaction),
    default_thread_rate_limit_per_user: RateLimitPerUser,
    default_sort_order: ForumSortOrder,
    default_layout: ForumLayout,
  )
}

Constructors

pub type ForumChannelFlag {
  ForumChannelRequiresTags
}

Constructors

  • ForumChannelRequiresTags
pub type ForumLayout {
  ForumLayoutUnspecified
  ListForumLayout
  GalleryForumLayout
}

Constructors

  • ForumLayoutUnspecified

    An admin hasn’t specified a default forum layout.

  • ListForumLayout
  • GalleryForumLayout

A forum-like channel - forum and media channels.

pub type ForumLikeChannel
pub type ForumSortOrder {
  ForumSortOrderUnspecified
  SortForumPostsByActivity
  SortForumPostsByCreationTime
}

Constructors

  • ForumSortOrderUnspecified
  • SortForumPostsByActivity
  • SortForumPostsByCreationTime

    From newest to oldest

pub type ForumTag {
  ForumTag(
    id: Snowflake(ForumTag),
    name: String,
    is_moderated: Bool,
    emoji: ForumTagEmoji,
  )
}

Constructors

  • ForumTag(
      id: Snowflake(ForumTag),
      name: String,
      is_moderated: Bool,
      emoji: ForumTagEmoji,
    )

    Arguments

    is_moderated

    Whether this tag can only be added/removed from threads by a member with the AllowManagingThreads permission.

pub type ForumTagEmoji {
  StandardForumTagEmoji(character: String)
  CustomForumTagEmoji(id: Snowflake(CustomEmoji))
}

Constructors

pub type GetAllActiveGuildThreadsResponse {
  GetAllActiveGuildThreadsResponse(
    threads: List(Thread),
    members: List(ThreadMember),
  )
}

Constructors

  • GetAllActiveGuildThreadsResponse(
      threads: List(Thread),
      members: List(ThreadMember),
    )

    Arguments

    threads

    The active threads. Sorted by id in descending order.

    members

    The thread member object for each thread the current user has joined.

pub opaque type GetChannelPinsOptions
pub type GetChannelPinsResponse {
  GetChannelPinsResponse(pins: List(MessagePin), has_more: Bool)
}

Constructors

  • GetChannelPinsResponse(pins: List(MessagePin), has_more: Bool)
pub opaque type GetCurrentApplicationEntitlementsOptions
pub opaque type GetGuildBansOptions
pub opaque type GetGuildMembersOptions
pub opaque type GetPollAnswerVotersOptions
pub type GetReactingUsersOptions {
  GetReactingUsersOptions(
    get_burst_reactions: Bool,
    after: option.Option(Snowflake(User)),
    limit: Int,
  )
}

Constructors

pub opaque type GetSkuSubscriptionsOptions
pub type Guild {
  Guild(
    id: Snowflake(Guild),
    name: String,
    icon_hash: option.Option(ImageHash),
    splash_hash: option.Option(ImageHash),
    discovery_splash_hash: option.Option(ImageHash),
    owner_id: Snowflake(User),
    afk_channel_id: option.Option(Snowflake(Channel)),
    afk_timeout: AfkTimeout,
    is_widget_enabled: Bool,
    widget_channel_id: option.Option(Snowflake(Channel)),
    required_verification_level: GuildMemberVerificationLevel,
    default_message_notification_setting: GuildDefaultMessageNotificationSetting,
    explicit_content_filter_setting: GuildExplicitContentFilterSetting,
    roles: List(Role),
    emojis: List(CustomEmoji),
    features: List(GuildFeature),
    required_mfa_level: GuildRequiredMfaLevel,
    application_id: option.Option(Snowflake(Application)),
    system_channel_id: option.Option(Snowflake(Channel)),
    system_channel_flags: List(GuildSystemChannelFlag),
    rules_channel_id: option.Option(Snowflake(Channel)),
    max_presences: option.Option(Int),
    max_members: option.Option(Int),
    vanity_url_code: option.Option(String),
    description: option.Option(String),
    banner_hash: option.Option(ImageHash),
    premium_tier: GuildPremiumTier,
    premium_subscription_count: Int,
    preferred_locale: Locale,
    public_updates_channel_id: option.Option(Snowflake(Channel)),
    max_video_channel_users: Int,
    max_stage_video_channel_users: Int,
    welcome_screen: option.Option(GuildWelcomeScreen),
    nsfw_level: GuildNsfwLevel,
    stickers: option.Option(List(GuildSticker)),
    is_premium_progress_bar_enabled: Bool,
    safety_alerts_channel_id: option.Option(Snowflake(Channel)),
    incidents_data: option.Option(GuildIncidentsData),
  )
}

Constructors

  • Guild(
      id: Snowflake(Guild),
      name: String,
      icon_hash: option.Option(ImageHash),
      splash_hash: option.Option(ImageHash),
      discovery_splash_hash: option.Option(ImageHash),
      owner_id: Snowflake(User),
      afk_channel_id: option.Option(Snowflake(Channel)),
      afk_timeout: AfkTimeout,
      is_widget_enabled: Bool,
      widget_channel_id: option.Option(Snowflake(Channel)),
      required_verification_level: GuildMemberVerificationLevel,
      default_message_notification_setting: GuildDefaultMessageNotificationSetting,
      explicit_content_filter_setting: GuildExplicitContentFilterSetting,
      roles: List(Role),
      emojis: List(CustomEmoji),
      features: List(GuildFeature),
      required_mfa_level: GuildRequiredMfaLevel,
      application_id: option.Option(Snowflake(Application)),
      system_channel_id: option.Option(Snowflake(Channel)),
      system_channel_flags: List(GuildSystemChannelFlag),
      rules_channel_id: option.Option(Snowflake(Channel)),
      max_presences: option.Option(Int),
      max_members: option.Option(Int),
      vanity_url_code: option.Option(String),
      description: option.Option(String),
      banner_hash: option.Option(ImageHash),
      premium_tier: GuildPremiumTier,
      premium_subscription_count: Int,
      preferred_locale: Locale,
      public_updates_channel_id: option.Option(Snowflake(Channel)),
      max_video_channel_users: Int,
      max_stage_video_channel_users: Int,
      welcome_screen: option.Option(GuildWelcomeScreen),
      nsfw_level: GuildNsfwLevel,
      stickers: option.Option(List(GuildSticker)),
      is_premium_progress_bar_enabled: Bool,
      safety_alerts_channel_id: option.Option(Snowflake(Channel)),
      incidents_data: option.Option(GuildIncidentsData),
    )

    Arguments

    icon_hash

    Image hash of the guild icon.

    An icon is the picture shown in the server list.

    Is None when the guild doesn’t have an icon.

    splash_hash

    Image hash of the guild splash.

    A splash is the picture shown when a user joins a guild, at the “Accept Invite” UI.

    Is None when the guild doesn’t have a splash.

    discovery_splash_hash

    Image hash of the guild discovery splash.

    A discovery splash is the picture shown when a user clicks on a guild in the “Server Discovery” UI.

    Is None when the guild isn’t discoverable or doesn’t have a discovery splash.

    afk_channel_id

    The “AFK channel” is the channel to which inactive voice channel users are moved.

    Is None when the guild doesn’t have a configured AFK channel.

    afk_timeout

    The time of inactivity after a voice channel user is marked as AFK in this guild.

    is_widget_enabled

    Whether the “server widget” is enabled. The server widget is a feature allowing guild advertisements on websites.

    widget_channel_id

    The channel to which the widget will generate an invite to.

    Is None if the widget was configured to not generate invites or is disabled.

    required_verification_level

    The verification level required for a guild member to be able to communicate in a guild.

    default_message_notification_setting

    The default setting regarding sending push notifications to members’ devices.

    Note that this can be overriden on a per-member basis.

    emojis

    List of the guild’s custom emojis.

    required_mfa_level

    MFA = multi-factor authentication

    application_id

    Application ID of the guild creator if it is created by a bot.

    system_channel_id

    The system channel is the channel where certain notifications, such as on-boost messages are sent.

    Is None if the guild does not use system messages.

    rules_channel_id

    Is None if the guild doesn’t have a rules channel.

    max_presences

    The maximum number of presences for the guild.

    Is always None, apart from the largest of guilds.

    max_members

    According to discord.py, this is always None, unless the guild is received from get_guild().

    vanity_url_code

    Is None if the guild doesn’t have a vanity url.

    description

    Is None if the guild doesn’t have a description.

    banner_hash

    Is None if the guild doesn’t have a banner.

    premium_tier

    The guild’s server boost benefit tier.

    premium_subscription_count

    The guild’s current amount of active server boosts.

    preferred_locale

    Is present for all guilds, but only community guilds have the ability to change it.

    Defaults to EnglishUsLocale if not selected by the guild’s admins.

    public_updates_channel_id

    ID of the channel where admins and moderators of a Community guild receive notices from Discord.

    Is None if the guild isn’t a community guild.

    max_video_channel_users

    The maximum amount of webcam-sharing users in a voice channel for this guild.

    max_stage_video_channel_users

    The maximum amount of webcam-sharing users in a stage channel for this guild.

    welcome_screen

    Is only present in the Invite.guild field.

    stickers

    Is None in many circumstances, it’s best to always check for this field’s presence.

    is_premium_progress_bar_enabled

    Whether the guild has the boost progress bar enabled.

    safety_alerts_channel_id

    ID of the chanel where moderators of Community guilds receive safety alerts from Discord. Is None if the guild isn’t a community guild.

    incidents_data

    Is None if there is no active incident.

pub type GuildApproximateCounts {
  GuildApproximateCounts(
    approximate_member_count: Int,
    approximate_presence_count: Int,
  )
}

Constructors

  • GuildApproximateCounts(
      approximate_member_count: Int,
      approximate_presence_count: Int,
    )
pub type GuildBan {
  GuildBan(reason: option.Option(String), user: User)
}

Constructors

pub type GuildChannel {
  GuildChannelText(TextChannel)
  GuildChannelVoice(VoiceChannel)
  GuildChannelCategory(CategoryChannel)
  GuildChannelAnnouncement(AnnouncementChannel)
  GuildChannelStage(StageChannel)
  GuildChannelForum(ForumChannel)
  GuildChannelMedia(MediaChannel)
}

Constructors

pub type GuildDefaultMessageNotificationSetting {
  NotifyForAllMessages
  NotifyOnlyForMentions
}

Constructors

  • NotifyForAllMessages

    By default, notifications will be sent for all messages in the guild.

  • NotifyOnlyForMentions

    By default, notifications will be sent only for messages in which the user was mentioned.

pub type GuildDiscordBotIntegration {
  GuildDiscordBotIntegration(
    application: GuildIntegrationApplication,
    scopes: List(String),
  )
}

Constructors

  • GuildDiscordBotIntegration(
      application: GuildIntegrationApplication,
      scopes: List(String),
    )

    Arguments

    scopes

    OAuth2 scopes the application has been authorized for.

pub type GuildExplicitContentFilterSetting {
  GuildExplicitContentFilterDisabled
  GuildExplicitContentFilterForMembersWithoutRoles
  GuildExplicitContentFilterForAllMembers
}

Constructors

  • GuildExplicitContentFilterDisabled

    Media will not be scanned for explicit content.

  • GuildExplicitContentFilterForMembersWithoutRoles

    Only media sent by members who do not have any roles will be scanned for explicit content.

  • GuildExplicitContentFilterForAllMembers

    Media sent by all members will be scanned for explicit content.

pub type GuildFeature {
  GuildCanUseAnimatedBanner
  GuildCanUseAnimatedIcon
  GuildUsesOldPermissionConfigurationBehavior
  GuildCreatedAutoModerationRules
  GuildCanUseBanner
  GuildIsCommunity
  GuildUsesMonetization
  GuildUsesRoleSubscriptionPromoPage
  GuildIsDeveloperSupportServer
  GuildIsDiscoverable
  GuildIsFeaturable
  GuildHasPausedInvites
  GuildCanUseInviteSplash
  GuildUsesMembershipScreening
  GuildHasMoreSoundboardSoundSlots
  GuildHasMoreStickerSlots
  GuildCanCreateAnnouncementChannels
  GuildIsPartnered
  GuildCanBePreviewed
  GuildDisabledRaidAlerts
  GuildCanUseRoleIcons
  GuildHasPurchasableRoleSubscriptions
  GuildUsesRoleSubscriptions
  GuildCreatedSoundboardSounds
  GuildUsesTicketedEvents
  GuildCanUseVanityUrl
  GuildIsVerified
  GuildCanUse384KbpsVoiceBitrate
  GuildUsesWelcomeScreen
  GuildCanUseGuestInvites
  GuildCanUseGuildTags
  GuildCanUseEnhancedRoleColours
}

Constructors

  • GuildCanUseAnimatedBanner
  • GuildCanUseAnimatedIcon
  • GuildUsesOldPermissionConfigurationBehavior
  • GuildCreatedAutoModerationRules

    Guild has set up auto-moderation rules. This does not guarantee that the guild currently has auto-moderation rules set-up.

  • GuildCanUseBanner
  • GuildIsCommunity

    Guild can use the welcome screen, Membership Screening, stage channels, and server discovery and receives community updates.

  • GuildUsesMonetization
  • GuildUsesRoleSubscriptionPromoPage
  • GuildIsDeveloperSupportServer

    Guild has been set as a support server on the App Directory.

  • GuildIsDiscoverable

    Guild can be discovered in the discovery tab.

  • GuildIsFeaturable

    Guild can be featured in the discovery tab.

  • GuildHasPausedInvites

    Guild has currently paused invites as an anti-raid measure.

  • GuildCanUseInviteSplash
  • GuildUsesMembershipScreening
  • GuildHasMoreSoundboardSoundSlots
  • GuildHasMoreStickerSlots
  • GuildCanCreateAnnouncementChannels
  • GuildIsPartnered

    Guild is partnered with Discord.

  • GuildCanBePreviewed
  • GuildDisabledRaidAlerts
  • GuildCanUseRoleIcons
  • GuildHasPurchasableRoleSubscriptions
  • GuildUsesRoleSubscriptions
  • GuildCreatedSoundboardSounds

    Guild has created soundboard sounds. This does not guarantee that the guild currently has any soundboard sounds.

  • GuildUsesTicketedEvents
  • GuildCanUseVanityUrl
  • GuildIsVerified

    Guild is verified by Discord.

  • GuildCanUse384KbpsVoiceBitrate
  • GuildUsesWelcomeScreen
  • GuildCanUseGuestInvites
  • GuildCanUseGuildTags
  • GuildCanUseEnhancedRoleColours
pub type GuildIncidentsData {
  GuildIncidentsData(
    invites_disabled_until: option.Option(timestamp.Timestamp),
    dms_disabled_until: option.Option(timestamp.Timestamp),
    dm_spam_detected_at: option.Option(timestamp.Timestamp),
    raid_detected_at: option.Option(timestamp.Timestamp),
  )
}

Constructors

Discord has some integrations with YouTube/Twitch for member/subscriber-only guilds.

Additionally, a guild may also be integrated with a Discord bot.

pub type GuildIntegration {
  GuildIntegration(
    id: Snowflake(GuildIntegration),
    name: String,
    is_enabled: Bool,
    account: GuildIntegrationAccount,
    integrator: option.Option(User),
    data: GuildIntegrationData,
  )
}

Constructors

The account is the integration’s pseudo-user.

pub type GuildIntegrationAccount {
  GuildIntegrationAccount(id: Snowflake(User), name: String)
}

Constructors

Partial application object used by guild integrations.

pub type GuildIntegrationApplication {
  GuildIntegrationApplication(
    id: Snowflake(Application),
    name: String,
    icon_hash: option.Option(ImageHash),
    description: String,
    bot: option.Option(User),
  )
}

Constructors

pub type GuildIntegrationData {
  GuildIntegrationDiscordBot(data: GuildDiscordBotIntegration)
  GuildIntegrationSocial(data: GuildSocialIntegration)
  GuildIntegrationGuildSubscription
}

Constructors

pub type GuildMember {
  GuildMember(
    user: User,
    nick: option.Option(String),
    avatar_hash: option.Option(ImageHash),
    banner_hash: option.Option(ImageHash),
    role_ids: List(Snowflake(Role)),
    joined_timestamp: timestamp.Timestamp,
    boosting_since: option.Option(timestamp.Timestamp),
    is_deafened: Bool,
    is_muted: Bool,
    flags: List(GuildMemberFlag),
    is_pending: Bool,
    communication_disabled_until: option.Option(
      timestamp.Timestamp,
    ),
    avatar_decoration: option.Option(UserAvatarDecoration),
  )
}

Constructors

  • GuildMember(
      user: User,
      nick: option.Option(String),
      avatar_hash: option.Option(ImageHash),
      banner_hash: option.Option(ImageHash),
      role_ids: List(Snowflake(Role)),
      joined_timestamp: timestamp.Timestamp,
      boosting_since: option.Option(timestamp.Timestamp),
      is_deafened: Bool,
      is_muted: Bool,
      flags: List(GuildMemberFlag),
      is_pending: Bool,
      communication_disabled_until: option.Option(timestamp.Timestamp),
      avatar_decoration: option.Option(UserAvatarDecoration),
    )

    Arguments

    user

    Corresponding user object.

    nick

    Guild-specific nickname.

    Is None when the member doesn’t have a guild-specific nickname.

    avatar_hash

    Guild-specific avatar hash.

    Is None if the member chose not to use a guild-specific avatar.

    banner_hash

    Guild-specific banner hash.

    Is None if the member chose not to use a guild-specific banner.

    is_deafened

    Whether the member is deafened in voice channels for this guild.

    is_muted

    Whether the member is muted in voice channels for this guild.

    is_pending

    Whether the member has not yet passed the membership screening requirements.

    communication_disabled_until

    When the member’s timeout will expire, returning their ability to communicate in the guild.

    IMPORTANT: the member is not timed out if this field is None or a time in the past.

    avatar_decoration

    Guild-specific avatar decoration.

    Is None if the member chose not to use guild-specific avatar decorations.

pub type GuildMemberFlag {
  GuildMemberRejoined
  GuildMemberCompletedOnboarding
  GuildMemberBypassesVerification
  GuildMemberStartedOnboarding
  GuildMemberIsGuest
  GuildMemberStartedHomeActions
  GuildMemberCompletedHomeActions
  GuildMemberUsernameQuarantinedByAutomod
  GuildMemberAcknowledgedDmSettingsUpsell
  GuildMemberGuildTagQuarantinedByAutomod
}

Constructors

  • GuildMemberRejoined

    Member left and rejoined the guild

  • GuildMemberCompletedOnboarding

    Member completed onboarding

  • GuildMemberBypassesVerification

    Member is exempt from guild verification requirements

  • GuildMemberStartedOnboarding

    Member has started onboarding

  • GuildMemberIsGuest

    Member is a guest and can only access the voice channel they were invited to

  • GuildMemberStartedHomeActions

    Member has started Server Guide new member actions

  • GuildMemberCompletedHomeActions

    Member has completed Server Guide new member actions

  • GuildMemberUsernameQuarantinedByAutomod

    Member’s username, display name or nickname is blocked by AutoMod

  • GuildMemberAcknowledgedDmSettingsUpsell

    Member has dismissed the DM settings upsell

  • GuildMemberGuildTagQuarantinedByAutomod

    Member’s guild tag is blocked by AutoMod

pub type GuildMemberVerificationLevel {
  NoGuildMemberVerification
  LowGuildMemberVerification
  MediumGuildMemberVerification
  HighGuildMemberVerification
  VeryHighGuildMemberVerification
}

Constructors

  • NoGuildMemberVerification

    Access to the guild is unrestricted.

  • LowGuildMemberVerification

    Access to the guild is granted to those who have verified their email with Discord.

  • MediumGuildMemberVerification

    Access to the guild is granted to those who have been registered on Discord for longer than 5 minutes.

  • HighGuildMemberVerification

    Access to the guild is granted to those who have been a member of the guild for longer than 10 minutes.

  • VeryHighGuildMemberVerification

    Access to the guild is granted to those who have verified their phone number with Discord.

pub type GuildNsfwLevel {
  DefaultGuildNsfwLevel
  ExplicitGuild
  SafeGuild
  AgeRestrictedGuild
}

Constructors

  • DefaultGuildNsfwLevel

    Unrated.

  • ExplicitGuild

    Has explicit content.

  • SafeGuild

    Safe-for-work.

  • AgeRestrictedGuild

    Guild is restricted to adults.

pub type GuildOnboarding {
  GuildOnboarding(
    guild_id: Snowflake(Guild),
    prompts: List(GuildOnboardingPrompt),
    default_channel_ids: List(Snowflake(Channel)),
    is_enabled: Bool,
    mode: GuildOnboardingMode,
  )
}

Constructors

pub type GuildOnboardingMode {
  DefaultOnboardingMode
  AdvancedOnboardingMode
}

Constructors

  • DefaultOnboardingMode

    Assigns only default channels.

  • AdvancedOnboardingMode

    Asks pre-join questions to add people to channels & roles based on their answers.

pub type GuildOnboardingPrompt {
  GuildOnboardingPrompt(
    id: Snowflake(GuildOnboardingPrompt),
    type_: GuildOnboardingPromptType,
    options: List(GuildOnboardingPromptOption),
    title: String,
    is_single_select: Bool,
    is_required: Bool,
    is_present_in_onboarding_flow: Bool,
  )
}

Constructors

pub type GuildOnboardingPromptOption {
  GuildOnboadingPromptOption(
    id: Snowflake(GuildOnboardingPromptOption),
    channel_ids: List(Snowflake(Channel)),
    role_ids: List(Snowflake(Role)),
    emoji: option.Option(Emoji),
    title: String,
    description: option.Option(String),
  )
}

Constructors

pub type GuildOnboardingPromptType {
  MultipleChoiceGuildOnboardingPrompt
  DropdownGuildOnboardingPrompt
}

Constructors

  • MultipleChoiceGuildOnboardingPrompt
  • DropdownGuildOnboardingPrompt
pub type GuildPremiumTier {
  GuildWithoutPremium
  GuildPremiumTier1
  GuildPremiumTier2
  GuildPremiumTier3
}

Constructors

  • GuildWithoutPremium

    The guild hasn’t unlocked any server boost perks.

  • GuildPremiumTier1

    Server boost level 1 perks.

  • GuildPremiumTier2

    Server boost level 2 perks.

  • GuildPremiumTier3

    Server boost level 3 perks.

pub type GuildPreview {
  GuildPreview(
    id: Snowflake(Guild),
    name: String,
    icon_hash: option.Option(ImageHash),
    splash_hash: option.Option(ImageHash),
    discovery_splash_hash: option.Option(ImageHash),
    emojis: List(CustomEmoji),
    features: List(GuildFeature),
    approximate_member_count: Int,
    approximate_presence_count: Int,
    description: option.Option(String),
    stickers: List(GuildSticker),
  )
}

Constructors

pub type GuildRequiredMfaLevel {
  GuildDoesNotRequireMfa
  GuildRequiresMfaForModerationActions
}

Constructors

  • GuildDoesNotRequireMfa
  • GuildRequiresMfaForModerationActions

A social integration is an integration between a Discord guild and Youtube/Twitch.

It’s used to make subscriber-only guilds/roles.

Vocabulary:

  • Subscriber - A paid supporter of a YouTube/Twitch channel (Twitch subscriber/YouTube channel member)
pub type GuildSocialIntegration {
  GuildSocialIntegration(
    data: GuildSocialIntegrationData,
    is_syncing: Bool,
    subscriber_role_id: option.Option(Snowflake(Role)),
    subscription_expiration_behavior: GuildSocialIntegrationSubscriptionExpirationBehavior,
    subscription_expiration_grace_period: duration.Duration,
    last_sync_timestamp: option.Option(timestamp.Timestamp),
    subscriber_count: Int,
    is_revoked: Bool,
  )
}

Constructors

pub type GuildSocialIntegrationData {
  YoutubeGuildIntegration
  TwitchGuildIntegration(is_syncing_emoticons: Bool)
}

Constructors

  • YoutubeGuildIntegration
  • TwitchGuildIntegration(is_syncing_emoticons: Bool)
pub type GuildSocialIntegrationSubscriptionExpirationBehavior {
  RemoveRoleOnSubscriptionExpiration
  KickOnSubscriptionExpiration
}

Constructors

  • RemoveRoleOnSubscriptionExpiration

    Remove the subscriber-only role when the subscription expires.

  • KickOnSubscriptionExpiration

    Kick the ex-subscriber from the guild when the subscription expires.

pub type GuildSticker {
  GuildSticker(
    id: Snowflake(GuildSticker),
    sticker_id: Snowflake(Sticker),
    name: String,
    description: option.Option(String),
    tags: String,
    format_type: StickerFormatType,
    is_available: Bool,
    guild_id: Snowflake(Guild),
    uploader: option.Option(User),
  )
}

Constructors

  • GuildSticker(
      id: Snowflake(GuildSticker),
      sticker_id: Snowflake(Sticker),
      name: String,
      description: option.Option(String),
      tags: String,
      format_type: StickerFormatType,
      is_available: Bool,
      guild_id: Snowflake(Guild),
      uploader: option.Option(User),
    )

    Arguments

    description

    Is None if the sticker doesn’t have a description.

    tags

    Auto-complete/suggestion tags (keywords).

    is_available

    Is False when a guild loses its premium tier, reducing its sticker capacity and removing the sticker.

    uploader

    Only returned with certain permissions.

pub type GuildSystemChannelFlag {
  GuildSystemChannelWithoutJoinNotifications
  GuildSystemChannelWithoutPremiumNotifications
  GuildSystemChannelWithoutGuildReminderNotifications
  GuildSystemChannelWithoutJoinNotificationStickerReplyButtons
  GuildSystemChannelWithoutRoleSubscriptionPurchaseNotifications
  GuildSystemChannelWithoutRoleSubscriptionPurchaseNotificationStickerReplyButtons
}

Constructors

  • GuildSystemChannelWithoutJoinNotifications

    Suppresses the member join notifications.

  • GuildSystemChannelWithoutPremiumNotifications

    Suppresses the server boost notifications.

  • GuildSystemChannelWithoutGuildReminderNotifications

    Suppresses server setup tips.

  • GuildSystemChannelWithoutJoinNotificationStickerReplyButtons

    Hides the sticker reply buttons to member join notifications.

  • GuildSystemChannelWithoutRoleSubscriptionPurchaseNotifications

    Suppresses role subscription purchase/renewal notifications.

  • GuildSystemChannelWithoutRoleSubscriptionPurchaseNotificationStickerReplyButtons

    Hides the sticker reply buttons to role subscription purchase/renewal notifications.

pub type GuildVanityInvite {
  GuildVanityInvite(code: String, uses: Int)
}

Constructors

  • GuildVanityInvite(code: String, uses: Int)

    Arguments

    code

    Prepend https://discord.gg/ to the code to create an invite link!

    uses

    How many times the invite has been used.

pub type GuildWelcomeScreen {
  GuildWelcomeScreen(
    description: option.Option(String),
    welcome_channels: List(GuildWelcomeScreenChannel),
  )
}

Constructors

  • GuildWelcomeScreen(
      description: option.Option(String),
      welcome_channels: List(GuildWelcomeScreenChannel),
    )

    Arguments

    description

    The guild description shown in the welcome screen. Is None if the guild hasn’t configured a description.

    welcome_channels

    The channels shown in the welcome screen. Up to 5.

pub type GuildWelcomeScreenChannel {
  GuildWelcomeScreenChannel(
    id: Snowflake(Channel),
    description: String,
    emoji: option.Option(GuildWelcomeScreenChannelEmoji),
  )
}

Constructors

pub type GuildWelcomeScreenChannelEmoji {
  StandardGuildWelcomeScreenChannelEmoji(character: String)
  CustomGuildWelcomeScreenChannelEmoji(
    id: Snowflake(Emoji),
    name: String,
  )
}

Constructors

  • StandardGuildWelcomeScreenChannelEmoji(character: String)
  • CustomGuildWelcomeScreenChannelEmoji(
      id: Snowflake(Emoji),
      name: String,
    )
pub type GuildWidget {
  GuildWidget(
    guild_id: Snowflake(Guild),
    guild_name: String,
    instant_invite_url: option.Option(String),
    channels: List(GuildWidgetChannel),
    users: List(GuildWidgetUser),
    presence_count: Int,
  )
}

Constructors

  • GuildWidget(
      guild_id: Snowflake(Guild),
      guild_name: String,
      instant_invite_url: option.Option(String),
      channels: List(GuildWidgetChannel),
      users: List(GuildWidgetUser),
      presence_count: Int,
    )

    Arguments

    channels

    Contains voice and stage channels which are accessible by @everyone

    presence_count

    Amount of online members in the guild.

A partial channel object used in guild widgets.

Represents an @everyone-accessible voice or stage channel.

pub type GuildWidgetChannel {
  GuildWidgetChannel(
    id: Snowflake(GuildChannel),
    name: String,
    position: Int,
  )
}

Constructors

  • GuildWidgetChannel(
      id: Snowflake(GuildChannel),
      name: String,
      position: Int,
    )

    Arguments

    position

    Channels with the same position are sorted by ID.

A guild’s settings pertaining to the website widget.

pub type GuildWidgetSettings {
  GuildWidgetSettings(
    is_enabled: Bool,
    channel_id: option.Option(Snowflake(Channel)),
  )
}

Constructors

A partial user object used in guild widgets.

Includes the user’s status + a specific avatar URL.

pub type GuildWidgetUser {
  GuildWidgetUser(
    id: Snowflake(User),
    username: String,
    discriminator: String,
    avatar_hash: option.Option(ImageHash),
    status: UserStatus,
    avatar_url: option.Option(String),
  )
}

Constructors

  • GuildWidgetUser(
      id: Snowflake(User),
      username: String,
      discriminator: String,
      avatar_hash: option.Option(ImageHash),
      status: UserStatus,
      avatar_url: option.Option(String),
    )

    Arguments

    discriminator

    Mostly deprecated. Only bots have discriminators nowadays.

    Users will very likely have their discriminator set to 0.

    Used in the past when usernames weren’t user-specific.

    Doesn’t include the # prefix.

Used for uploading images to Discord. You’ll encounter this type in modify and create functions. Use image_data_from_bit_array to create this.

pub opaque type ImageData
pub type ImageDataContentType {
  JpegImageData
  PngImageData
  GifImageData
}

Constructors

  • JpegImageData
  • PngImageData
  • GifImageData

An image hash is used to download images from Discord.

Every non-attachment image (avatars, banners, even guild tag badges) is hashed by Discord and is able to be downloaded through a link.

pub opaque type ImageHash
pub type ImageMessageAttachment {
  ImageMessageAttachment(
    height: Int,
    width: Int,
    placeholder: String,
    placeholder_version: Int,
  )
}

Constructors

  • ImageMessageAttachment(
      height: Int,
      width: Int,
      placeholder: String,
      placeholder_version: Int,
    )

    Arguments

    height

    In pixels.

    width

    In pixels.

    placeholder

    Thumbhash representation of a placeholder.

    placeholder_version

    Thumbhash version.

pub type IntSlashCommandOption {
  IntSlashCommandOption(
    name: String,
    name_localizations: option.Option(dict.Dict(Locale, String)),
    description: String,
    description_localizations: option.Option(
      dict.Dict(Locale, String),
    ),
    is_required: Bool,
    choices: List(IntSlashCommandOptionChoice),
    min_value: option.Option(Int),
    max_value: option.Option(Int),
    is_autocomplete_enabled: Bool,
  )
}

Constructors

pub type IntSlashCommandOptionChoice {
  IntSlashCommandOptionChoice(
    name: String,
    name_localizations: option.Option(dict.Dict(Locale, String)),
    value: Int,
  )
}

Constructors

pub type Interaction {
  InteractionCommand(CommandInteraction)
  InteractionMessageComponent(MessageComponentInteraction)
  InteractionModal(ModalInteraction)
  InteractionAutocompleteRequest(AutocompleteRequestInteraction)
}

Constructors

pub type InteractionAuthorizingInstallers {
  InteractionAuthorizingInstallers(
    guild_installer: option.Option(Snowflake(Guild)),
    user_installer: option.Option(Snowflake(User)),
  )
}

Constructors

  • InteractionAuthorizingInstallers(
      guild_installer: option.Option(Snowflake(Guild)),
      user_installer: option.Option(Snowflake(User)),
    )

    Arguments

    guild_installer

    If the command was guild installed, the guild installer is the guild where the application is installed.

    user_installer

    If the command was user installed, the user installer is the user who installed the application.

pub type InteractionContext {
  InteractionExecutedInGuild
  InteractionExecutedInBotDms
  InteractionExecutedInDms
}

Constructors

  • InteractionExecutedInGuild

    The interaction was executed in a guild channel.

  • InteractionExecutedInBotDms

    The interaction was executed in the DM channel between the invoking user and the bot.

  • InteractionExecutedInDms

    The interaction was executed in a DM channel between different recipients where the bot was user-installed.

pub type InteractionInvokementData {
  InteractionInvokedInGuild(
    guild: InteractionPartialGuild,
    invoking_member: GuildMember,
  )
  InteractionInvokedInPrivateChannel(invoking_user: User)
}

Constructors

  • InteractionInvokedInGuild(
      guild: InteractionPartialGuild,
      invoking_member: GuildMember,
    )
  • InteractionInvokedInPrivateChannel(invoking_user: User)

    Invoked in something such as a DM Channel.

pub type InteractionPartialGuild {
  InteractionPartialGuild(
    id: Snowflake(Guild),
    preferred_locale: Locale,
    features: List(GuildFeature),
  )
}

Constructors

  • InteractionPartialGuild(
      id: Snowflake(Guild),
      preferred_locale: Locale,
      features: List(GuildFeature),
    )

    Arguments

    preferred_locale

    Only Community Guilds can change their locale.

    Other guilds, and ones who haven’t set their locale, will default to the EnglishUsLocale

Contains objects mentioned in an interaction - for example, if a slash command was executed with a user parameter, you can grab the user’s ID from the command options, and get the object from the resolved data.

pub type InteractionResolvedObjects {
  InteractionResolvedObjects(
    users: dict.Dict(Snowflake(User), User),
    guild_members: dict.Dict(Snowflake(User), ResolvedGuildMember),
    roles: dict.Dict(Snowflake(Role), Role),
    mentionable_users: dict.Dict(Snowflake(Mentionable), User),
    mentionable_guild_members: dict.Dict(
      Snowflake(Mentionable),
      ResolvedGuildMember,
    ),
    mentionable_roles: dict.Dict(Snowflake(Mentionable), Role),
    channels: dict.Dict(Snowflake(Channel), ResolvedChannel),
    messages: dict.Dict(Snowflake(Message), Message),
    attachments: dict.Dict(
      Snowflake(MessageAttachment),
      MessageAttachment,
    ),
  )
}

Constructors

pub opaque type InteractionResponseMessage
pub type InteractionResponseMessageFlag {
  InteractionResponseMessageWithSuppressedEmbeds
  InteractionResponseMessageIsEphemeral
  InteractionResponseMessageIsVoiceMessage
  InteractionResponseMessageUsesComponentsV2
  InteractionResponseMessageWithSuppressedNotifications
}

Constructors

  • InteractionResponseMessageWithSuppressedEmbeds

    Makes links not create embeds.

  • InteractionResponseMessageIsEphemeral

    Makes the response only visible to the invoking user.

  • InteractionResponseMessageIsVoiceMessage
  • InteractionResponseMessageUsesComponentsV2

    Required for some components, see CreateMessageComponent for more info on which components require this flag.

  • InteractionResponseMessageWithSuppressedNotifications

    Makes people not receive push notifications for this message.

pub opaque type InteractionResponseModal
pub opaque type InteractionToken
pub type Invite {
  Invite(
    code: String,
    guild: Guild,
    channel: option.Option(GuildChannel),
    inviter: option.Option(User),
    target: option.Option(InviteTarget),
    expiration: option.Option(timestamp.Timestamp),
    scheduled_event: option.Option(ScheduledEvent),
    flags: List(InviteFlag),
    automatically_awarded_roles: List(InviteRole),
    metadata: option.Option(InviteMetadata),
  )
}

Constructors

pub type InviteFlag {
  InviteIsGuestInvite
}

Constructors

  • InviteIsGuestInvite
pub type InviteMetadata {
  InviteMetadata(
    uses: Int,
    max_uses: Int,
    max_age: duration.Duration,
    grants_temporary_membership: Bool,
    creation: timestamp.Timestamp,
  )
}

Constructors

  • InviteMetadata(
      uses: Int,
      max_uses: Int,
      max_age: duration.Duration,
      grants_temporary_membership: Bool,
      creation: timestamp.Timestamp,
    )

    Arguments

    uses

    How many times has the invite been used?

    max_uses

    How many times can the invite be used?

    max_age

    Duration after which the invite expires.

A partial role object for invites.

pub type InviteRole {
  InviteRole(
    id: Snowflake(Role),
    name: String,
    position: Int,
    colours: RoleColours,
    icon_hash: option.Option(ImageHash),
    unicode_emoji: option.Option(String),
  )
}

Constructors

pub type InviteTarget {
  StreamInvite(streaming_user: User)
  EmbeddedApplicationInvite(application: Application)
}

Constructors

  • StreamInvite(streaming_user: User)
  • EmbeddedApplicationInvite(application: Application)
pub type LinkButton {
  LinkButton(
    id: Int,
    label: option.Option(String),
    emoji: option.Option(ComponentEmoji),
    url: String,
    is_disabled: Bool,
  )
}

Constructors

An enum describing every available Discord locale.

pub type Locale {
  IndonesianLocale
  DanishLocale
  GermanLocale
  EnglishUkLocale
  EnglishUsLocale
  SpanishSpainLocale
  SpanishLatamLocale
  FrenchLocale
  CroatianLocale
  ItalianLocale
  LithuanianLocale
  HungarianLocale
  DutchLocale
  NorwegianLocale
  PolishLocale
  PortugueseBrazilLocale
  RomanianRomaniaLocale
  FinnishLocale
  SwedishLocale
  VietnameseLocale
  TurkishLocale
  CzechLocale
  GreekLocale
  BulgarianLocale
  RussianLocale
  UkrainianLocale
  HindiLocale
  ThaiLocale
  ChineseChinaLocale
  JapaneseLocale
  ChineseTaiwanLocale
  KoreanLocale
}

Constructors

  • IndonesianLocale
  • DanishLocale
  • GermanLocale
  • EnglishUkLocale
  • EnglishUsLocale
  • SpanishSpainLocale
  • SpanishLatamLocale
  • FrenchLocale
  • CroatianLocale
  • ItalianLocale
  • LithuanianLocale
  • HungarianLocale
  • DutchLocale
  • NorwegianLocale
  • PolishLocale

    🇵🇱

  • PortugueseBrazilLocale
  • RomanianRomaniaLocale
  • FinnishLocale
  • SwedishLocale
  • VietnameseLocale
  • TurkishLocale
  • CzechLocale
  • GreekLocale
  • BulgarianLocale
  • RussianLocale
  • UkrainianLocale
  • HindiLocale
  • ThaiLocale
  • ChineseChinaLocale
  • JapaneseLocale
  • ChineseTaiwanLocale
  • KoreanLocale
pub type MediaChannel {
  MediaChannel(
    id: Snowflake(MediaChannel),
    channel_id: Snowflake(Channel),
    guild_channel_id: Snowflake(GuildChannel),
    forum_like_channel_id: Snowflake(ForumLikeChannel),
    permission_overwrites: List(PermissionOverwrite),
    guild_id: option.Option(Snowflake(Guild)),
    position: Int,
    name: String,
    topic: option.Option(String),
    rate_limit_per_user: RateLimitPerUser,
    last_thread_id: option.Option(Snowflake(Thread)),
    parent_id: option.Option(Snowflake(CategoryChannel)),
    default_thread_auto_archive_duration: ThreadAutoArchiveDuration,
    flags: List(MediaChannelFlag),
    available_tags: List(ForumTag),
    default_reaction: option.Option(DefaultForumReaction),
    default_thread_rate_limit_per_user: RateLimitPerUser,
    default_sort_order: ForumSortOrder,
  )
}

Constructors

pub type MediaChannelFlag {
  MediaChannelRequiresTags
  MediaChannelHidesMediaDownloadOptions
}

Constructors

  • MediaChannelRequiresTags
  • MediaChannelHidesMediaDownloadOptions
pub type MediaGalleryItem {
  MediaGalleryItem(
    media: UnfurledMediaItem,
    description: option.Option(String),
    is_spoiler: Bool,
  )
}

Constructors

pub type Mentionable
pub type MentionableSlashCommandOption {
  MentionableSlashCommandOption(
    name: String,
    name_localizations: option.Option(dict.Dict(Locale, String)),
    description: String,
    description_localizations: option.Option(
      dict.Dict(Locale, String),
    ),
    is_required: Bool,
  )
}

Constructors

pub type Message {
  Message(
    id: Snowflake(Message),
    channel_id: Snowflake(Channel),
    author: User,
    content: String,
    sent_timestamp: timestamp.Timestamp,
    edited_timestamp: option.Option(timestamp.Timestamp),
    is_tts: Bool,
    mentions_everyone: Bool,
    mentioned_users: List(User),
    mentioned_roles_ids: List(Snowflake(Role)),
    attachments: List(MessageAttachment),
    embeds: List(MessageEmbed),
    reactions: List(MessageReaction),
    nonce: option.Option(MessageNonce),
    is_pinned: Bool,
    webhook_id: option.Option(Snowflake(Webhook)),
    type_: MessageType,
    application_id: option.Option(Snowflake(Application)),
    flags: List(MessageFlag),
    reference: option.Option(MessageReference),
    snapshots: List(MessageSnapshot),
    referenced_message: option.Option(Message),
    components: List(MessageComponent),
    interaction_metadata: option.Option(
      MessageInteractionMetadata,
    ),
    thread: option.Option(Thread),
    sticker_items: List(StickerItem),
    approximate_position_in_thread: option.Option(Int),
    role_subscription_purchase_notification: option.Option(
      RoleSubscriptionPurchaseNotification,
    ),
    poll: option.Option(Poll),
    call: option.Option(MessageCall),
  )
}

Constructors

  • Message(
      id: Snowflake(Message),
      channel_id: Snowflake(Channel),
      author: User,
      content: String,
      sent_timestamp: timestamp.Timestamp,
      edited_timestamp: option.Option(timestamp.Timestamp),
      is_tts: Bool,
      mentions_everyone: Bool,
      mentioned_users: List(User),
      mentioned_roles_ids: List(Snowflake(Role)),
      attachments: List(MessageAttachment),
      embeds: List(MessageEmbed),
      reactions: List(MessageReaction),
      nonce: option.Option(MessageNonce),
      is_pinned: Bool,
      webhook_id: option.Option(Snowflake(Webhook)),
      type_: MessageType,
      application_id: option.Option(Snowflake(Application)),
      flags: List(MessageFlag),
      reference: option.Option(MessageReference),
      snapshots: List(MessageSnapshot),
      referenced_message: option.Option(Message),
      components: List(MessageComponent),
      interaction_metadata: option.Option(MessageInteractionMetadata),
      thread: option.Option(Thread),
      sticker_items: List(StickerItem),
      approximate_position_in_thread: option.Option(Int),
      role_subscription_purchase_notification: option.Option(
        RoleSubscriptionPurchaseNotification,
      ),
      poll: option.Option(Poll),
      call: option.Option(MessageCall),
    )

    Arguments

    content

    If your app doesn’t have the MESSAGE_CONTENT privileged intent enabled, this will be an empty string.

    is_tts

    Whether the message is text-to-speech-enabled.

    attachments

    If your app doesn’t have the MESSAGE_CONTENT privileged intent enabled, this will be an empty list.

    embeds

    If your app doesn’t have the MESSAGE_CONTENT privileged intent enabled, this will be an empty list.

    nonce

    Used for verifying a message was sent.

    webhook_id

    If the message was generated by a webhook, this is its ID.

    application_id

    If the message is an interaction or application-owned webhook, this is its ID.

    reference

    Information regarding a crossposted message, channel follow add notification, pin notificatio, reply, etc.

    snapshots

    Snapshots of a forwarded message.

    referenced_message

    If this message is a reply or similar, this will be its parent message.

    components

    If your app doesn’t have the MESSAGE_CONTENT privileged intent enabled, this will be an empty list.

    interaction_metadata

    Sent if the message was sent as a result of an interaction

    thread

    Sent if the message was the one that started a thread.

    approximate_position_in_thread

    Only sent if the message was sent in a thread.

    role_subscription_purchase_notification

    If the message is a notification about a role subscription purchase, this will contain additional data about it.

    poll

    If your app doesn’t have the MESSAGE_CONTENT privileged intent enabled, this will be None.

    Also None if the message doesn’t have a poll :)

pub type MessageActionRow {
  MessageActionRow(id: Int, components: List(ActionRowComponent))
}

Constructors

pub type MessageAttachment {
  MessageAttachment(
    id: Snowflake(MessageAttachment),
    file_name: String,
    title: option.Option(String),
    description: option.Option(String),
    content_type: option.Option(String),
    size_bytes: Int,
    url: String,
    proxy_url: String,
    is_ephemeral: Bool,
    data: option.Option(MessageAttachmentData),
    flags: List(MessageAttachmentFlag),
  )
}

Constructors

pub type MessageAttachmentData {
  MessageAttachmentImage(ImageMessageAttachment)
  MessageAttachmentVideo(VideoMessageAttachment)
  MessageAttachmentAudio(AudioMessageAttachment)
  MessageAttachmentVoice(VoiceMessageAttachment)
  MessageAttachmentClip(ClipMessageAttachment)
}

Constructors

pub type MessageAttachmentFlag {
  MessageAttachmentIsThumbnail
  MessageAttachmentIsRemix
  MessageAttachmentIsSpoiler
  MessageAttachmentIsAnimated
}

Constructors

  • MessageAttachmentIsThumbnail
  • MessageAttachmentIsRemix

    The attachment is edited using the mobile-only “remix” feature

  • MessageAttachmentIsSpoiler
  • MessageAttachmentIsAnimated
pub type MessageButton {
  RegularMessageButton(RegularButton)
  LinkMessageButton(LinkButton)
  PremiumMessageButton(PremiumButton)
}

Constructors

pub type MessageCall {
  MessageCall(
    participants_ids: List(Snowflake(User)),
    ended_timestamp: option.Option(timestamp.Timestamp),
  )
}

Constructors

pub type MessageChannelSelect {
  MessageChannelSelect(
    id: Int,
    custom_id: String,
    placeholder: option.Option(String),
    default_channels: List(Snowflake(Channel)),
    channel_types: List(SelectChannelType),
    min_values: Int,
    max_values: Int,
    is_required: Bool,
  )
}

Constructors

pub type MessageCommand {
  MessageCommand(
    id: Snowflake(MessageCommand),
    command_id: Snowflake(Command),
    application_id: Snowflake(Application),
    guild_id: option.Option(Snowflake(Guild)),
    name: String,
    name_localizations: option.Option(dict.Dict(Locale, String)),
    required_permissions: option.Option(List(Permission)),
    is_nsfw: Bool,
    installation_types: List(CommandInstallationType),
    contexts: List(CommandContext),
    version: Snowflake(CommandVersion),
  )
}

Constructors

pub type MessageComponent {
  MessageActionRowComponent(MessageActionRow)
  MessageSectionComponent(MessageSection)
  MessageTextDisplayComponent(MessageTextDisplay)
  MessageMediaGalleryComponent(MessageMediaGallery)
  MessageFileComponent(MessageFile)
  MessageSeparatorComponent(MessageSeparator)
  MessageContainerComponent(MessageContainer)
}

Constructors

pub type MessageComponentInteraction {
  MessageComponentInteraction(
    id: Snowflake(Interaction),
    application_id: Snowflake(Application),
    invokement_data: InteractionInvokementData,
    channel_id: Snowflake(Channel),
    token: MessageComponentInteractionToken,
    interaction_token: InteractionToken,
    message: Message,
    application_permissions: List(Permission),
    invoking_user_locale: Locale,
    invoking_user_entitlements: List(Entitlement),
    context: InteractionContext,
    authorizing_installers: InteractionAuthorizingInstallers,
    component: ExecutedMessageComponent,
  )
}

Constructors

pub opaque type MessageComponentInteractionResponse
pub opaque type MessageComponentInteractionToken
pub type MessageContainer {
  MessageContainer(
    id: Int,
    components: List(ContainerComponent),
    accent_colour: option.Option(colour.Colour),
    is_spoiler: Bool,
  )
}

Constructors

pub type MessageEmbed {
  MessageEmbed(
    title: option.Option(String),
    type_: EmbedType,
    description: option.Option(String),
    url: option.Option(String),
    timestamp: option.Option(timestamp.Timestamp),
    colour: option.Option(colour.Colour),
    footer: option.Option(EmbedFooter),
    image: option.Option(EmbedImage),
    thumbnail: option.Option(EmbedImage),
    video: option.Option(EmbedVideo),
    author: option.Option(EmbedAuthor),
    fields: option.Option(List(EmbedField)),
  )
}

Constructors

pub type MessageFile {
  MessageFile(
    id: Int,
    media: UnfurledMediaItem,
    is_spoiler: Bool,
    file_name: String,
    size_bytes: Int,
  )
}

Constructors

  • MessageFile(
      id: Int,
      media: UnfurledMediaItem,
      is_spoiler: Bool,
      file_name: String,
      size_bytes: Int,
    )
pub type MessageFlag {
  MessageIsCrossposted
  MessageIsCrosspost
  MessageHasSuppressedEmbeds
  MessageSourceDeleted
  MessageIsUrgent
  MessageHasThread
  MessageIsEphemeral
  MessageIsLoading
  MessageFailedToMentionSomeRolesInThread
  MessageHasSuppressedNotifications
  MessageIsVoiceMessage
  MessageHasSnapshot
  MessageUsesComponentsV2
}

Constructors

  • MessageIsCrossposted
  • MessageIsCrosspost
  • MessageHasSuppressedEmbeds
  • MessageSourceDeleted

    The message came from a followed announcement channel, and the original message has been deleted.

  • MessageIsUrgent

    This message came from Discord’s urgent message system

  • MessageHasThread

    The message has an associated thread - its ID is the same as the message’s.

  • MessageIsEphemeral

    The message is only visible to its interaction’s invoker.

  • MessageIsLoading

    The message is an interaction response and the bot is “thinking”.

  • MessageFailedToMentionSomeRolesInThread
  • MessageHasSuppressedNotifications
  • MessageIsVoiceMessage
  • MessageHasSnapshot
  • MessageUsesComponentsV2
pub type MessageInteractionMetadata {
  MessageInteractionMetadata(
    interaction_id: Snowflake(Interaction),
    triggering_user: User,
    installed_guild_id: option.Option(Snowflake(Guild)),
    installed_user_id: option.Option(Snowflake(User)),
    original_response_message_id: option.Option(
      Snowflake(Message),
    ),
    target_user: option.Option(User),
    target_message_id: option.Option(Snowflake(Message)),
  )
}

Constructors

  • MessageInteractionMetadata(
      interaction_id: Snowflake(Interaction),
      triggering_user: User,
      installed_guild_id: option.Option(Snowflake(Guild)),
      installed_user_id: option.Option(Snowflake(User)),
      original_response_message_id: option.Option(Snowflake(Message)),
      target_user: option.Option(User),
      target_message_id: option.Option(Snowflake(Message)),
    )

    Arguments

    installed_guild_id

    If the interaction’s application was guild-installed, this will be the guild’s ID.

    installed_user_id

    If the interaction’s application was user-installed, this will be the user’s ID.

    original_response_message_id

    If this message is a follow-up message to an interaction, this will be its parent’s ID.

    target_user

    If the interaction was a user command invokement, this will be its target user.

    target_message_id

    If the interaction was a message command invokement, this will be its target message’s ID.

    Note: You can retrieve the target message from referenced_message field of the original message.

pub type MessageMediaGallery {
  MessageMediaGallery(id: Int, items: List(MediaGalleryItem))
}

Constructors

pub type MessageMentionableSelect {
  MessageMentionableSelect(
    id: Int,
    custom_id: String,
    placeholder: option.Option(String),
    default_users: List(Snowflake(User)),
    default_roles: List(Snowflake(Role)),
    min_values: Int,
    max_values: Int,
    is_required: Bool,
  )
}

Constructors

  • MessageMentionableSelect(
      id: Int,
      custom_id: String,
      placeholder: option.Option(String),
      default_users: List(Snowflake(User)),
      default_roles: List(Snowflake(Role)),
      min_values: Int,
      max_values: Int,
      is_required: Bool,
    )
pub type MessageNonce {
  IntMessageNonce(Int)
  StringMessageNonce(String)
}

Constructors

  • IntMessageNonce(Int)
  • StringMessageNonce(String)
pub type MessagePin {
  MessagePin(
    pinned_timestamp: timestamp.Timestamp,
    message: Message,
  )
}

Constructors

pub type MessageReaction {
  MessageReaction(
    count: Int,
    super_count: Int,
    normal_count: Int,
    current_user_reacted: Bool,
    current_user_super_reacted: Bool,
    emoji: Emoji,
    super_colours: List(colour.Colour),
  )
}

Constructors

  • MessageReaction(
      count: Int,
      super_count: Int,
      normal_count: Int,
      current_user_reacted: Bool,
      current_user_super_reacted: Bool,
      emoji: Emoji,
      super_colours: List(colour.Colour),
    )

    Arguments

    count

    Sum of all reactions (normal + super).

pub type MessageReactionEmoji {
  MessageReactionWithUnicodeEmoji(character: String)
  MessageReactionWithCustomEmoji(
    name: String,
    id: Snowflake(Emoji),
  )
}

Constructors

  • MessageReactionWithUnicodeEmoji(character: String)
  • MessageReactionWithCustomEmoji(
      name: String,
      id: Snowflake(Emoji),
    )

Information regarding a crossposted message, channel follow add notification, pin notification reply, etc.

pub type MessageReference {
  MessageReference(
    type_: MessageReferenceType,
    original_message_id: Snowflake(Message),
    original_channel_id: Snowflake(Channel),
    original_guild_id: option.Option(Snowflake(Guild)),
  )
}

Constructors

pub type MessageReferenceType {
  MessageReferenceIsReply
  MessageReferenceIsForward
}

Constructors

  • MessageReferenceIsReply
  • MessageReferenceIsForward
pub type MessageRoleSelect {
  MessageRoleSelect(
    id: Int,
    custom_id: String,
    placeholder: option.Option(String),
    default_roles: List(Snowflake(Role)),
    min_values: Int,
    max_values: Int,
    is_required: Bool,
  )
}

Constructors

  • MessageRoleSelect(
      id: Int,
      custom_id: String,
      placeholder: option.Option(String),
      default_roles: List(Snowflake(Role)),
      min_values: Int,
      max_values: Int,
      is_required: Bool,
    )
pub type MessageSection {
  MessageSection(
    id: Int,
    components: List(SectionComponent),
    accessory: SectionAccessory,
  )
}

Constructors

pub type MessageSeparator {
  MessageSeparator(
    id: Int,
    is_divider_visible: Bool,
    spacing: SeparatorSpacing,
  )
}

Constructors

  • MessageSeparator(
      id: Int,
      is_divider_visible: Bool,
      spacing: SeparatorSpacing,
    )
pub type MessageSnapshot {
  MessageSnapshot(
    type_: MessageType,
    content: String,
    embeds: List(MessageEmbed),
    attachments: List(MessageAttachment),
    sent_timestamp: timestamp.Timestamp,
    edited_timestamp: option.Option(timestamp.Timestamp),
    flags: List(MessageFlag),
    mentioned_users: List(User),
    mentioned_roles_ids: List(Snowflake(Role)),
    sticker_items: List(StickerItem),
    components: List(MessageComponent),
  )
}

Constructors

  • MessageSnapshot(
      type_: MessageType,
      content: String,
      embeds: List(MessageEmbed),
      attachments: List(MessageAttachment),
      sent_timestamp: timestamp.Timestamp,
      edited_timestamp: option.Option(timestamp.Timestamp),
      flags: List(MessageFlag),
      mentioned_users: List(User),
      mentioned_roles_ids: List(Snowflake(Role)),
      sticker_items: List(StickerItem),
      components: List(MessageComponent),
    )

    Arguments

    content

    If your app doesn’t have the MESSAGE_CONTENT privileged intent enabled, this will be an empty string.

    embeds

    If your app doesn’t have the MESSAGE_CONTENT privileged intent enabled, this will be an empty list.

    attachments

    If your app doesn’t have the MESSAGE_CONTENT privileged intent enabled, this will be an empty list.

    components

    If your app doesn’t have the MESSAGE_CONTENT privileged intent enabled, this will be an empty list.

pub type MessageStringSelect {
  MessageStringSelect(
    id: Int,
    custom_id: String,
    options: List(StringSelectOption),
    placeholder: option.Option(String),
    min_values: Int,
    max_values: Int,
    is_disabled: Bool,
  )
}

Constructors

  • MessageStringSelect(
      id: Int,
      custom_id: String,
      options: List(StringSelectOption),
      placeholder: option.Option(String),
      min_values: Int,
      max_values: Int,
      is_disabled: Bool,
    )
pub type MessageTextDisplay {
  MessageTextDisplay(id: Int, content: String)
}

Constructors

  • MessageTextDisplay(id: Int, content: String)
pub type MessageThumbnail {
  MessageThumbnail(
    id: Int,
    media: UnfurledMediaItem,
    description: option.Option(String),
    is_spoiler: Bool,
  )
}

Constructors

pub type MessageType {
  MessageIsNormalMessage
  MessageIsRecipientAddNotification
  MessageIsRecipientRemoveNotification
  MessageIsCallNotification
  MessageIsChannelNameChangeNotification
  MessageIsChannelIconChangeNotification
  MessageIsPinnedMessageNotification
  MessageIsUserJoinNotification
  MessageIsGuildBoostNotification
  MessageIsGuildBoostTier1Notification
  MessageIsGuildBoostTier2Notification
  MessageIsGuildBoostTier3Notification
  MessageIsChannelFollowAddedNotification
  MessageIsGuildDiscoveryDisqualificationNotification
  MessageIsGuildDiscoveryRequalificationNotification
  MessageIsGuildDiscoveryGracePeriodInitialWarning
  MessageIsGuildDiscoveryGracePeriodFinalWarning
  MessageIsThreadCreationNotification
  MessageIsReply
  MessageIsSlashCommand
  MessageIsThreadStarterMessage
  MessageIsGuildInviteReminder
  MessageIsContextMenuCommand
  MessageIsAutoModerationActionNotification
  MessageIsRoleSubscriptionPurchaseNotification
  MessageIsInteractionPremiumUpsell
  MessageIsStageStartNotification
  MessageIsStageEndNotification
  MessageIsNewStageSpeakerNotification
  MessageIsNewStageTopicNotification
  MessageIsGuildApplicationPremiumSubscriptionNotification
  MessageIsGuildIncidentAlertModeEnabledNotification
  MessageIsGuildIncidentAlertModeDisabledNotification
  MessageIsRaidReportNotification
  MessageIsFalseAlarmReportNotification
  MessageIsPurchaseNotification
  MessageIsPollResult
}

Constructors

  • MessageIsNormalMessage

    Deletable.

  • MessageIsRecipientAddNotification

    Not deletable.

  • MessageIsRecipientRemoveNotification

    Not deletable.

  • MessageIsCallNotification

    Not deletable.

  • MessageIsChannelNameChangeNotification

    Not deletable.

  • MessageIsChannelIconChangeNotification

    Not deletable.

  • MessageIsPinnedMessageNotification

    Deletable.

  • MessageIsUserJoinNotification

    Deletable.

  • MessageIsGuildBoostNotification

    Deletable.

  • MessageIsGuildBoostTier1Notification

    Deletable.

  • MessageIsGuildBoostTier2Notification

    Deletable.

  • MessageIsGuildBoostTier3Notification

    Deletable.

  • MessageIsChannelFollowAddedNotification

    Deletable.

  • MessageIsGuildDiscoveryDisqualificationNotification

    Deletable.

  • MessageIsGuildDiscoveryRequalificationNotification

    Deletable.

  • MessageIsGuildDiscoveryGracePeriodInitialWarning

    Deletable.

  • MessageIsGuildDiscoveryGracePeriodFinalWarning

    Deletable.

  • MessageIsThreadCreationNotification

    Deletable.

  • MessageIsReply

    Deletable.

  • MessageIsSlashCommand

    Deletable.

  • MessageIsThreadStarterMessage

    Not deletable.

  • MessageIsGuildInviteReminder

    Deletable.

  • MessageIsContextMenuCommand

    Deletable.

  • MessageIsAutoModerationActionNotification

    Deletable by members with the AllowManagingMessages permission.

  • MessageIsRoleSubscriptionPurchaseNotification

    Deletable.

  • MessageIsInteractionPremiumUpsell

    Deletable.

  • MessageIsStageStartNotification

    Deletable.

  • MessageIsStageEndNotification

    Deletable.

  • MessageIsNewStageSpeakerNotification

    Deletable.

  • MessageIsNewStageTopicNotification

    Deletable.

  • MessageIsGuildApplicationPremiumSubscriptionNotification

    Deletable.

  • MessageIsGuildIncidentAlertModeEnabledNotification

    Deletable.

  • MessageIsGuildIncidentAlertModeDisabledNotification

    Deletable.

  • MessageIsRaidReportNotification

    Deletable.

  • MessageIsFalseAlarmReportNotification

    Deletable.

  • MessageIsPurchaseNotification

    Deletable.

  • MessageIsPollResult

    Deletable.

pub type MessageUserSelect {
  MessageUserSelect(
    id: Int,
    custom_id: String,
    placeholder: option.Option(String),
    default_users: List(Snowflake(User)),
    min_values: Int,
    max_values: Int,
    is_required: Bool,
  )
}

Constructors

  • MessageUserSelect(
      id: Int,
      custom_id: String,
      placeholder: option.Option(String),
      default_users: List(Snowflake(User)),
      min_values: Int,
      max_values: Int,
      is_required: Bool,
    )
pub type ModalInteraction {
  ModalInteraction(
    id: Snowflake(Interaction),
    application_id: Snowflake(Application),
    invokement_data: InteractionInvokementData,
    token: ModalInteractionToken,
    interaction_token: InteractionToken,
    message: option.Option(Message),
    application_permissions: List(Permission),
    invoking_user_locale: Locale,
    invoking_user_entitlements: List(Entitlement),
    context: InteractionContext,
    authorizing_installers: InteractionAuthorizingInstallers,
    modal: SubmittedModal,
  )
}

Constructors

pub opaque type ModalInteractionResponse
pub opaque type ModalInteractionToken
pub opaque type ModifyAnnouncementChannel
pub opaque type ModifyCategoryChannel
pub opaque type ModifyCurrentApplication
pub type ModifyCurrentApplicationFlag {
  ModifyCurrentApplicationPresenceTemporaryPrivilegedIntent
  ModifyCurrentApplicationGuildMembersTemporaryPrivilegedIntent
  ModifyCurrentApplicationMessageContentTemporaryPrivilegedIntent
}

Constructors

  • ModifyCurrentApplicationPresenceTemporaryPrivilegedIntent

    Add/remove the presence temporary privileged intent.

    Does not apply to apps which were approved for this intent.

  • ModifyCurrentApplicationGuildMembersTemporaryPrivilegedIntent

    Add/remove the guild members temporary privileged intent.

    Does not apply to apps which were approved for this intent.

  • ModifyCurrentApplicationMessageContentTemporaryPrivilegedIntent

    Add/remove the message content temporary privileged intent.

    Does not apply to apps which were approved for this intent.

pub opaque type ModifyCurrentGuildMember
pub opaque type ModifyCurrentUser
pub opaque type ModifyForumChannel
pub opaque type ModifyGlobalMessageCommand
pub opaque type ModifyGlobalSlashCommand
pub opaque type ModifyGlobalUserCommand

Look into the (new_)modify_guild_* functions to use this type using a builder pattern.

pub opaque type ModifyGuild
pub opaque type ModifyGuildChannelPosition
pub opaque type ModifyGuildIncidentsData
pub opaque type ModifyGuildMember
pub opaque type ModifyGuildMessageCommand
pub opaque type ModifyGuildSlashCommand
pub opaque type ModifyGuildSoundboardSound
pub opaque type ModifyGuildSticker
pub opaque type ModifyGuildUserCommand
pub opaque type ModifyGuildWelcomeScreen
pub opaque type ModifyGuildWidgetSettings
pub opaque type ModifyInteractionResponseMessage
pub opaque type ModifyMediaChannel
pub opaque type ModifyMessage
pub type ModifyMessageAddFlag {
  ModifyMessageToSuppressEmbeds
  ModifyMessageToUseComponentsV2
}

Constructors

  • ModifyMessageToSuppressEmbeds
  • ModifyMessageToUseComponentsV2
pub type ModifyMessageRemoveFlag {
  ModifyMessageToNoLongerSuppressEmbeds
}

Constructors

  • ModifyMessageToNoLongerSuppressEmbeds
pub opaque type ModifyRole

See the move_role and delete_role_position functions.

pub opaque type ModifyRolePosition
pub opaque type ModifyStageChannel
pub opaque type ModifyTextChannel
pub opaque type ModifyThread
pub opaque type ModifyVoiceChannel
pub type Permission {
  AllowCreatingInstantInvites
  AllowKickingMembers
  AllowBanningMembers
  AdministratorPermission
  AllowManagingChannels
  AllowManagingGuild
  AllowAddingReactions
  AllowViewingAuditLog
  AllowPrioritySpeakingInVoiceChannels
  AllowStreamingInVoiceChannels
  AllowViewingChannels
  AllowSendingMessages
  AllowSendingTtsMessages
  AllowManagingMessages
  AutoEmbedLinksPermission
  AllowAttachingFiles
  AllowReadingMessageHistory
  AllowMentioningEveryone
  AllowUsingExternalEmojis
  AllowViewingGuildInsights
  AllowConnectingToVoiceChannels
  AllowSpeakingInVoiceChannels
  AllowMutingMembersInVoiceChannels
  AllowDeafeningMembersInVoiceChannels
  AllowMovingMembersBetweenVoiceChannels
  AllowUsingVoiceActivityDetection
  AllowChangingOwnNickname
  AllowManagingNicknames
  AllowManagingRoles
  AllowManagingWebhooks
  AllowManagingGuildExpressions
  AllowUsingCommands
  AllowRequestingToSpeakInStageChannels
  AllowManagingEvents
  AllowManagingThreads
  AllowCreatingPublicThreads
  AllowCreatingPrivateThreads
  AllowUsingExternalStickers
  AllowSendingMessagesInThreads
  AllowUsingEmbeddedActivities
  AllowModeratingMembers
  AllowViewingCreatorMonetizationAnalytics
  AllowUsingSoundboard
  AllowCreatingGuildExpressions
  AllowCreatingEvents
  AllowUsingExternalSoundboardSounds
  AllowSendingVoiceMessages
  AllowSettingVoiceChannelStatus
  AllowSendingPolls
  AllowUsingExternalApplications
  AllowPinningMessages
  AllowBypassingSlowmode
}

Constructors

  • AllowCreatingInstantInvites
  • AllowKickingMembers
  • AllowBanningMembers
  • AdministratorPermission

    Allows all permissions and bypasses channel permission overrides.

  • AllowManagingChannels

    Allows management and editing of channels

  • AllowManagingGuild

    Allows management and editing of the guild

  • AllowAddingReactions

    Allows adding new reactions to messages. Does not change the ability to react with an existing reaction.

  • AllowViewingAuditLog
  • AllowPrioritySpeakingInVoiceChannels
  • AllowStreamingInVoiceChannels
  • AllowViewingChannels

    Implicitly enabled by default.

  • AllowSendingMessages

    Implicitly enabled by default.

  • AllowSendingTtsMessages

    Allows sending text-to-speech messages, read out loud by default to all readers.

  • AllowManagingMessages

    Allows deleting others’ messages.

  • AutoEmbedLinksPermission

    Automatically shows embeds of links sent by the permission’s owner.

  • AllowAttachingFiles
  • AllowReadingMessageHistory
  • AllowMentioningEveryone

    Allows mentioning @everyone - everyone in the guild and @here - every online person in the guild.

  • AllowUsingExternalEmojis

    Allows using custom emojis from other servers.

  • AllowViewingGuildInsights
  • AllowConnectingToVoiceChannels
  • AllowSpeakingInVoiceChannels
  • AllowMutingMembersInVoiceChannels
  • AllowDeafeningMembersInVoiceChannels
  • AllowMovingMembersBetweenVoiceChannels
  • AllowUsingVoiceActivityDetection
  • AllowChangingOwnNickname
  • AllowManagingNicknames

    Allows modifying others’ nicknames.

  • AllowManagingRoles

    Allows modifying others’ roles.

  • AllowManagingWebhooks
  • AllowManagingGuildExpressions

    Allows editing and deleting the guild’s custom emojis, stickers and soundboard sounds.

  • AllowUsingCommands

    Allows using slash/context-menu commands.

  • AllowRequestingToSpeakInStageChannels
  • AllowManagingEvents

    Allows editing and deleting the guild’s scheduled events.

  • AllowManagingThreads

    Allows deleting and archiving threads, and viewing all public and private threads.

  • AllowCreatingPublicThreads

    Allows creating public and announcement threads.

  • AllowCreatingPrivateThreads
  • AllowUsingExternalStickers

    Allows using custom stickers from other guilds.

  • AllowSendingMessagesInThreads
  • AllowUsingEmbeddedActivities
  • AllowModeratingMembers

    Allows timing-out other members.

  • AllowViewingCreatorMonetizationAnalytics

    Allows viewing role subscription insights.

  • AllowUsingSoundboard
  • AllowCreatingGuildExpressions

    Allows creating custom emojis, stickers and soundboard sounds. Also allows editing and deleting the aforementioned expressions created by the permission’s owner.

  • AllowCreatingEvents

    Allows creating scheduled events. Also allows editing and deleting events created by the permission’s owner.

  • AllowUsingExternalSoundboardSounds

    Allows using soundboard sounds from other guilds.

  • AllowSendingVoiceMessages
  • AllowSettingVoiceChannelStatus
  • AllowSendingPolls
  • AllowUsingExternalApplications

    Allows user-installed applications to send public responses.

    When disabled, users will still be able to use their apps, but their responses will be ephemeral. This only applies to apps that are not installed at the guild level.

  • AllowPinningMessages
  • AllowBypassingSlowmode

Permission overwrites are used to grant/deny specific permissions to members (personally or per-role) in specific channels.

The order of importance for permission overwrites:

  1. User-based allow overwrites
  2. User-based deny overwrites
  3. Role-based allow overwrites
  4. Role-based deny overwrites
  5. @everyone allow overwrites
  6. @everyone deny overwrites
  7. Guild-level role permissions
  8. Guild-level @everyone permissions
pub type PermissionOverwrite {
  RolePermissionOverwrite(
    role_id: Snowflake(Role),
    allow: List(Permission),
    deny: List(Permission),
  )
  UserPermissionOverwrite(
    user_id: Snowflake(User),
    allow: List(Permission),
    deny: List(Permission),
  )
}

Constructors

pub type Poll {
  Poll(
    question: String,
    answers: List(PollAnswer),
    end_timestamp: timestamp.Timestamp,
    allows_multiselect: Bool,
    results: option.Option(PollResults),
  )
}

Constructors

pub type PollAnswer {
  PollAnswer(id: Int, text: String, emoji: option.Option(Emoji))
}

Constructors

pub type PollAnswerCount {
  PollAnswerCount(
    answer_id: Int,
    count: Int,
    current_user_voted: Bool,
  )
}

Constructors

  • PollAnswerCount(
      answer_id: Int,
      count: Int,
      current_user_voted: Bool,
    )
pub type PollResults {
  PollResults(
    is_finalized: Bool,
    answer_counts: List(PollAnswerCount),
  )
}

Constructors

  • PollResults(
      is_finalized: Bool,
      answer_counts: List(PollAnswerCount),
    )

    Arguments

    is_finalized

    Whether the votes have been precisely counted.

pub type PremiumButton {
  PremiumButton(
    id: Int,
    sku_id: Snowflake(Sku),
    is_disabled: Bool,
  )
}

Constructors

  • PremiumButton(id: Int, sku_id: Snowflake(Sku), is_disabled: Bool)
pub opaque type PruneGuild
pub opaque type RateLimitPerUser
pub type RegularButton {
  RegularButton(
    id: Int,
    style: RegularButtonStyle,
    label: option.Option(String),
    emoji: option.Option(ComponentEmoji),
    custom_id: String,
    is_disabled: Bool,
  )
}

Constructors

pub type RegularButtonStyle {
  PrimaryRegularButton
  SecondaryRegularButton
  SuccessRegularButton
  DangerRegularButton
}

Constructors

  • PrimaryRegularButton
  • SecondaryRegularButton
  • SuccessRegularButton
  • DangerRegularButton
pub type RequestedApplicationAssetFormat {
  RequestPngApplicationAsset
  RequestJpegApplicationAsset
  RequestWebpApplicationAsset
}

Constructors

  • RequestPngApplicationAsset
  • RequestJpegApplicationAsset
  • RequestWebpApplicationAsset
pub type RequestedApplicationCoverFormat {
  RequestPngApplicationCover
  RequestJpegApplicationCover
  RequestWebpApplicationCover
}

Constructors

  • RequestPngApplicationCover
  • RequestJpegApplicationCover
  • RequestWebpApplicationCover
pub type RequestedApplicationIconFormat {
  RequestPngApplicationIcon
  RequestJpegApplicationIcon
  RequestWebpApplicationIcon
}

Constructors

  • RequestPngApplicationIcon
  • RequestJpegApplicationIcon
  • RequestWebpApplicationIcon
pub type RequestedCustomEmojiFormat {
  RequestPngCustomEmoji
  RequestJpegCustomEmoji
  RequestWebpCustomEmoji
  RequestGifCustomEmoji
}

Constructors

  • RequestPngCustomEmoji
  • RequestJpegCustomEmoji
  • RequestWebpCustomEmoji

    Recommended format.

    Emojis can be uploaded as PNG, JPEG, WebP, GIF, or AVIF.

    Other formats don’t convert well to formats other than WebP.

  • RequestGifCustomEmoji

    Discouraged.

pub type RequestedDeveloperTeamFormat {
  RequestPngDeveloperTeam
  RequestJpegDeveloperTeam
  RequestWebpDeveloperTeam
}

Constructors

  • RequestPngDeveloperTeam
  • RequestJpegDeveloperTeam
  • RequestWebpDeveloperTeam
pub type RequestedGuildBannerFormat {
  RequestPngGuildBanner
  RequestJpegGuildBanner
  RequestWebpGuildBanner
  RequestGifGuildBanner
}

Constructors

  • RequestPngGuildBanner
  • RequestJpegGuildBanner
  • RequestWebpGuildBanner
  • RequestGifGuildBanner
pub type RequestedGuildDiscoverySplashFormat {
  RequestPngGuildDiscoverySplash
  RequestJpegGuildDiscoverySplash
  RequestWebpGuildDiscoverySplash
}

Constructors

  • RequestPngGuildDiscoverySplash
  • RequestJpegGuildDiscoverySplash
  • RequestWebpGuildDiscoverySplash
pub type RequestedGuildIconFormat {
  RequestPngGuildIcon
  RequestJpegGuildIcon
  RequestWebpGuildIcon
  RequestGifGuildIcon
}

Constructors

  • RequestPngGuildIcon
  • RequestJpegGuildIcon
  • RequestWebpGuildIcon
  • RequestGifGuildIcon
pub type RequestedGuildMemberAvatarFormat {
  RequestPngGuildMemberAvatar
  RequestJpegGuildMemberAvatar
  RequestWebpGuildMemberAvatar
  RequestGifGuildMemberAvatar
}

Constructors

  • RequestPngGuildMemberAvatar
  • RequestJpegGuildMemberAvatar
  • RequestWebpGuildMemberAvatar
  • RequestGifGuildMemberAvatar
pub type RequestedGuildMemberBannerFormat {
  RequestPngGuildMemberBanner
  RequestJpegGuildMemberBanner
  RequestWebpGuildMemberBanner
  RequestGifGuildMemberBanner
}

Constructors

  • RequestPngGuildMemberBanner
  • RequestJpegGuildMemberBanner
  • RequestWebpGuildMemberBanner
  • RequestGifGuildMemberBanner
pub type RequestedGuildSplashFormat {
  RequestPngGuildSplash
  RequestJpegGuildSplash
  RequestWebpGuildSplash
}

Constructors

  • RequestPngGuildSplash
  • RequestJpegGuildSplash
  • RequestWebpGuildSplash
pub type RequestedGuildTagBadgeFormat {
  RequestPngGuildTagBadge
  RequestJpegGuildTagBadge
  RequestWebpGuildTagBadge
}

Constructors

  • RequestPngGuildTagBadge
  • RequestJpegGuildTagBadge
  • RequestWebpGuildTagBadge

The number refers to the size of the larger side of a rectangle.

pub type RequestedImageSize {
  Request16xImage
  Request32xImage
  Request64xImage
  Request128xImage
  Request256xImage
  Request512xImage
  Request1024xImage
  Request2048xImage
  Request4096xImage
  RequestDefaultImage
}

Constructors

  • Request16xImage
  • Request32xImage
  • Request64xImage
  • Request128xImage
  • Request256xImage
  • Request512xImage
  • Request1024xImage
  • Request2048xImage
  • Request4096xImage
  • RequestDefaultImage
pub type RequestedScheduledEventCoverFormat {
  RequestPngScheduledEventCover
  RequestJpegScheduledEventCover
  RequestWebpScheduledEventCover
}

Constructors

  • RequestPngScheduledEventCover
  • RequestJpegScheduledEventCover
  • RequestWebpScheduledEventCover
pub type RequestedStickerFormat {
  RequestPngSticker
  RequestLottieSticker
  RequestGifSticker
}

Constructors

  • RequestPngSticker
  • RequestLottieSticker
  • RequestGifSticker
pub type RequestedStickerPackBannerFormat {
  RequestPngStickerPackBanner
  RequestJpegStickerPackBanner
  RequestWebpStickerPackBanner
}

Constructors

  • RequestPngStickerPackBanner
  • RequestJpegStickerPackBanner
  • RequestWebpStickerPackBanner
pub type RequestedUserAvatarFormat {
  RequestPngUserAvatar
  RequestJpegUserAvatar
  RequestWebpUserAvatar
  RequestGifUserAvatar
}

Constructors

  • RequestPngUserAvatar
  • RequestJpegUserAvatar
  • RequestWebpUserAvatar
  • RequestGifUserAvatar
pub type RequestedUserBannerFormat {
  RequestPngUserBanner
  RequestJpegUserBanner
  RequestWebpUserBanner
  RequestGifUserBanner
}

Constructors

  • RequestPngUserBanner
  • RequestJpegUserBanner
  • RequestWebpUserBanner
  • RequestGifUserBanner
pub type ResolvedAnnouncementChannel {
  ResolvedAnnouncementChannel(
    id: Snowflake(AnnouncementChannel),
    channel_id: Snowflake(Channel),
    guild_channel_id: Snowflake(GuildChannel),
    thread_creatable_channel_id: Snowflake(ThreadCreatableChannel),
    guild_id: option.Option(Snowflake(Guild)),
    position: Int,
    name: String,
    topic: option.Option(String),
    is_nsfw: Bool,
    last_message_id: option.Option(Snowflake(Message)),
    last_pin_timestamp: option.Option(timestamp.Timestamp),
    parent_id: option.Option(Snowflake(CategoryChannel)),
    invoking_user_permissions: List(Permission),
    current_application_permissions: List(Permission),
  )
}

Constructors

pub type ResolvedCategoryChannel {
  ResolvedCategoryChannel(
    id: Snowflake(CategoryChannel),
    channel_id: Snowflake(Channel),
    guild_channel_id: Snowflake(GuildChannel),
    guild_id: option.Option(Snowflake(Guild)),
    position: Int,
    name: String,
    invoking_user_permissions: List(Permission),
    current_application_permissions: List(Permission),
  )
}

Constructors

pub type ResolvedChannel {
  ResolvedChannelText(ResolvedTextChannel)
  ResolvedChannelVoice(ResolvedVoiceChannel)
  ResolvedChannelCategory(ResolvedCategoryChannel)
  ResolvedChannelAnnouncement(ResolvedAnnouncementChannel)
  ResolvedChannelStage(ResolvedStageChannel)
  ResolvedChannelForum(ResolvedForumChannel)
  ResolvedChannelMedia(ResolvedMediaChannel)
  ResolvedChannelDm(ResolvedDmChannel)
  ResolvedChannelThread(ResolvedThread)
}

Constructors

pub type ResolvedDmChannel {
  ResolvedDmChannel(
    id: Snowflake(DmChannel),
    channel_id: Snowflake(Channel),
    last_message_id: option.Option(Snowflake(Message)),
    last_pin_timestamp: option.Option(timestamp.Timestamp),
  )
}

Constructors

pub type ResolvedForumChannel {
  ResolvedForumChannel(
    id: Snowflake(ForumChannel),
    channel_id: Snowflake(Channel),
    guild_channel_id: Snowflake(GuildChannel),
    forum_like_channel_id: Snowflake(ForumLikeChannel),
    guild_id: option.Option(Snowflake(Guild)),
    position: Int,
    name: String,
    topic: option.Option(String),
    rate_limit_per_user: RateLimitPerUser,
    last_thread_id: option.Option(Snowflake(Thread)),
    parent_id: option.Option(Snowflake(CategoryChannel)),
    flags: List(ForumChannelFlag),
    invoking_user_permissions: List(Permission),
    current_application_permissions: List(Permission),
  )
}

Constructors

pub type ResolvedGuildMember {
  ResolvedGuildMember(
    nick: option.Option(String),
    avatar_hash: option.Option(ImageHash),
    banner_hash: option.Option(ImageHash),
    role_ids: List(Snowflake(Role)),
    joined_timestamp: timestamp.Timestamp,
    boosting_since: option.Option(timestamp.Timestamp),
    flags: List(GuildMemberFlag),
    is_pending: Bool,
    communication_disabled_until: option.Option(
      timestamp.Timestamp,
    ),
    avatar_decoration: option.Option(UserAvatarDecoration),
  )
}

Constructors

  • ResolvedGuildMember(
      nick: option.Option(String),
      avatar_hash: option.Option(ImageHash),
      banner_hash: option.Option(ImageHash),
      role_ids: List(Snowflake(Role)),
      joined_timestamp: timestamp.Timestamp,
      boosting_since: option.Option(timestamp.Timestamp),
      flags: List(GuildMemberFlag),
      is_pending: Bool,
      communication_disabled_until: option.Option(timestamp.Timestamp),
      avatar_decoration: option.Option(UserAvatarDecoration),
    )

    Arguments

    nick

    Guild-specific nickname.

    Is None when the member doesn’t have a guild-specific nickname.

    avatar_hash

    Guild-specific avatar hash.

    Is None if the member chose not to use a guild-specific avatar.

    banner_hash

    Guild-specific banner hash.

    Is None if the member chose not to use a guild-specific banner.

    is_pending

    Whether the member has not yet passed the membership screening requirements.

    communication_disabled_until

    When the member’s timeout will expire, returning their ability to communicate in the guild.

    IMPORTANT: the member is not timed out if this field is None or a time in the past.

    avatar_decoration

    Guild-specific avatar decoration.

    Is None if the member chose not to use guild-specific avatar decorations.

pub type ResolvedMediaChannel {
  ResolvedMediaChannel(
    id: Snowflake(MediaChannel),
    channel_id: Snowflake(Channel),
    guild_channel_id: Snowflake(GuildChannel),
    forum_like_channel_id: Snowflake(ForumLikeChannel),
    guild_id: option.Option(Snowflake(Guild)),
    position: Int,
    name: String,
    topic: option.Option(String),
    rate_limit_per_user: RateLimitPerUser,
    last_thread_id: option.Option(Snowflake(Thread)),
    flags: List(MediaChannelFlag),
    parent_id: option.Option(Snowflake(CategoryChannel)),
    invoking_user_permissions: List(Permission),
    current_application_permissions: List(Permission),
  )
}

Constructors

pub type ResolvedStageChannel {
  ResolvedStageChannel(
    id: Snowflake(StageChannel),
    channel_id: Snowflake(Channel),
    guild_channel_id: Snowflake(GuildChannel),
    voice_like_channel_id: Snowflake(VoiceLikeChannel),
    guild_id: option.Option(Snowflake(Guild)),
    position: Int,
    name: String,
    is_nsfw: Bool,
    last_message_id: option.Option(Snowflake(Message)),
    rate_limit_per_user: RateLimitPerUser,
    parent_id: option.Option(Snowflake(CategoryChannel)),
    invoking_user_permissions: List(Permission),
    current_application_permissions: List(Permission),
  )
}

Constructors

pub type ResolvedTextChannel {
  ResolvedTextChannel(
    id: Snowflake(TextChannel),
    channel_id: Snowflake(Channel),
    guild_channel_id: Snowflake(GuildChannel),
    thread_creatable_channel_id: Snowflake(ThreadCreatableChannel),
    guild_id: option.Option(Snowflake(Guild)),
    position: Int,
    name: String,
    topic: option.Option(String),
    is_nsfw: Bool,
    last_message_id: option.Option(Snowflake(Message)),
    rate_limit_per_user: RateLimitPerUser,
    last_pin_timestamp: option.Option(timestamp.Timestamp),
    parent_id: option.Option(Snowflake(CategoryChannel)),
    invoking_user_permissions: List(Permission),
    current_application_permissions: List(Permission),
  )
}

Constructors

pub type ResolvedThread {
  ResolvedThread(
    id: Snowflake(Thread),
    channel_id: Snowflake(Channel),
    guild_channel_id: Snowflake(GuildChannel),
    type_: ThreadType,
    guild_id: option.Option(Snowflake(Guild)),
    name: String,
    last_message_id: option.Option(Snowflake(Message)),
    rate_limit_per_user: RateLimitPerUser,
    parent_id: Snowflake(GuildChannel),
    is_archived: Bool,
    auto_archive_duration: ThreadAutoArchiveDuration,
    last_archive_status_change_at: timestamp.Timestamp,
    is_locked: Bool,
    created_at: option.Option(timestamp.Timestamp),
    flags: List(ThreadFlag),
    invoking_user_permissions: List(Permission),
    current_application_permissions: List(Permission),
  )
}

Constructors

  • ResolvedThread(
      id: Snowflake(Thread),
      channel_id: Snowflake(Channel),
      guild_channel_id: Snowflake(GuildChannel),
      type_: ThreadType,
      guild_id: option.Option(Snowflake(Guild)),
      name: String,
      last_message_id: option.Option(Snowflake(Message)),
      rate_limit_per_user: RateLimitPerUser,
      parent_id: Snowflake(GuildChannel),
      is_archived: Bool,
      auto_archive_duration: ThreadAutoArchiveDuration,
      last_archive_status_change_at: timestamp.Timestamp,
      is_locked: Bool,
      created_at: option.Option(timestamp.Timestamp),
      flags: List(ThreadFlag),
      invoking_user_permissions: List(Permission),
      current_application_permissions: List(Permission),
    )

    Arguments

    guild_id

    Is None in some gateway events.

    last_message_id

    Is None if there are no messages in the channel.

    rate_limit_per_user

    Represents he amount of time between a user has to wait between sending a message or creating a thread.

    Bots and members with the AllowBypassingSlowmode permission are exempt from slowmode.

    Rate limits per user must be between 0 and 21600 seconds (7.22 hours).

    auto_archive_duration

    Time of inactivity after which the thread will be automatically archived.

    last_archive_status_change_at

    Time when the thread’s archive status was last changed at.

    is_locked

    If a thread is locked, only users with the AllowManagingThreads permission will be able to unarchive it.

    created_at

    Is None if the thread was created before September 1st, 2022.

pub type ResolvedVoiceChannel {
  ResolvedVoiceChannel(
    id: Snowflake(VoiceChannel),
    channel_id: Snowflake(Channel),
    guild_channel_id: Snowflake(GuildChannel),
    voice_like_channel_id: Snowflake(VoiceLikeChannel),
    guild_id: option.Option(Snowflake(Guild)),
    position: Int,
    name: String,
    is_nsfw: Bool,
    last_message_id: option.Option(Snowflake(Message)),
    rate_limit_per_user: RateLimitPerUser,
    parent_id: option.Option(Snowflake(CategoryChannel)),
    invoking_user_permissions: List(Permission),
    current_application_permissions: List(Permission),
  )
}

Constructors

An error that is returned if something goes wrong using REST (HTTP) API calls. Examples include:

  • Discord responds with invalid UTF-8 -> ResponseNotValidUtf8
  • A Discord internal server error -> ReceivedUnsuccessfulStatusCode
  • A bad request (e.g. message content too long) -> ReceivedErrorResponse
  • A response decoding failure due to a breaking change with the Discord API -> CouldNotDecodeResponse
pub type RestError {
  ResponseNotValidUtf8(response.Response(BitArray))
  ReceivedUnsuccessfulStatusCode(response.Response(String))
  ReceivedErrorResponse(ErrorResponse)
  CouldNotDecodeResponse(json.DecodeError)
}

Constructors

pub type Role {
  Role(
    id: Snowflake(Role),
    mentionable_id: Snowflake(Mentionable),
    name: String,
    colours: RoleColours,
    is_hoisted: Bool,
    icon_hash: option.Option(ImageHash),
    unicode_emoji: option.Option(String),
    position: Int,
    permissions: List(Permission),
    is_integration_managed: Bool,
    is_mentionable: Bool,
    bot_id: option.Option(Snowflake(User)),
    integration_id: option.Option(Snowflake(GuildIntegration)),
    is_booster_role: Bool,
    subscription_listing_id: option.Option(Snowflake(Sku)),
    is_available_for_purchase: Bool,
    is_linked_role: Bool,
    flags: List(RoleFlag),
  )
}

Constructors

  • Role(
      id: Snowflake(Role),
      mentionable_id: Snowflake(Mentionable),
      name: String,
      colours: RoleColours,
      is_hoisted: Bool,
      icon_hash: option.Option(ImageHash),
      unicode_emoji: option.Option(String),
      position: Int,
      permissions: List(Permission),
      is_integration_managed: Bool,
      is_mentionable: Bool,
      bot_id: option.Option(Snowflake(User)),
      integration_id: option.Option(Snowflake(GuildIntegration)),
      is_booster_role: Bool,
      subscription_listing_id: option.Option(Snowflake(Sku)),
      is_available_for_purchase: Bool,
      is_linked_role: Bool,
      flags: List(RoleFlag),
    )

    Arguments

    is_hoisted

    Whether the role is pinned in the guild user list.

    position

    Position of this role in the hierarchy. Roles with the same position are sorted by ID.

    permissions

    Permissions given to members with this role.

    is_integration_managed

    Whether this role is managed by an integration. Example: All bots added to a guild are given an integration-managed role.

    is_mentionable

    Whether this role is mentionable in text channels.

    bot_id

    The ID of the bot user associated with this role. Is None if the role isn’t a bot’s role.

    integration_id

    The ID of the integration associated with this role. Is None if the role isn’t an integration’s role.

    is_booster_role

    Whether this role is the role automatically given to the guild’s boosters.

    subscription_listing_id

    The ID of the subscription SKU for this role. Is None if the role isn’t a subscription-based role.

    is_linked_role

    Whether this role is linked to a Discord connection. Learn more: https://support.discord.com/hc/en-us/articles/10388356626711-Connections-Linked-Roles-Admins

pub type RoleColours {
  RoleColours(
    primary_colour: colour.Colour,
    secondary_colour: option.Option(colour.Colour),
    tertiary_colour: option.Option(colour.Colour),
  )
}

Constructors

  • RoleColours(
      primary_colour: colour.Colour,
      secondary_colour: option.Option(colour.Colour),
      tertiary_colour: option.Option(colour.Colour),
    )

    Arguments

    primary_colour

    The primary colour of the role.

    secondary_colour

    The secondary colour of the role. If present, this will make the role colour a gradient between the provided colours. Can only be set to Some(colour) if the guild has the GuildCanUseEnhancedRoleColours feature.

    tertiary_colour

    The tertiary colour of the role. If present, this will turn the gradient into a holographic style. Can only be set to Some(colour) if the guild has the GuildCanUseEnhancedRoleColours feature.

    Note: When sending tertiary_colour, the API enforces the role colour to be a holographic style with the values:

    • primary_colour = 0xA9C9FF
    • secondary_colour = 0xFFBBEC
    • tertiary_colour = 0xFFC3A0
pub type RoleFlag {
  RoleCanBeSeletedInOnboardingPrompt
}

Constructors

  • RoleCanBeSeletedInOnboardingPrompt
pub type RoleSlashCommandOption {
  RoleSlashCommandOption(
    name: String,
    name_localizations: option.Option(dict.Dict(Locale, String)),
    description: String,
    description_localizations: option.Option(
      dict.Dict(Locale, String),
    ),
    is_required: Bool,
  )
}

Constructors

pub type RoleSubscriptionPurchaseNotification {
  RoleSubscriptionPurchaseNotification(
    listing_id: Snowflake(Sku),
    tier_name: String,
    total_months_subscribed: Int,
    is_renewal: Bool,
  )
}

Constructors

  • RoleSubscriptionPurchaseNotification(
      listing_id: Snowflake(Sku),
      tier_name: String,
      total_months_subscribed: Int,
      is_renewal: Bool,
    )

    Arguments

    total_months_subscribed

    Cumulative number of months the user has been subscribed for.

    is_renewal

    Whether the notification is for a renewal rather than a new purhase.

pub type ScheduledEvent {
  ScheduledEvent(
    id: Snowflake(ScheduledEvent),
    guild_id: Snowflake(Guild),
    location: ScheduledEventLocation,
    creator: option.Option(User),
    name: String,
    description: option.Option(String),
    scheduled_start_time: timestamp.Timestamp,
    status: ScheduledEventStatus,
    user_count: option.Option(Int),
    cover_image_hash: option.Option(ImageHash),
    recurrence_rule: option.Option(ScheduledEventRecurrenceRule),
  )
}

Constructors

pub type ScheduledEventLocation {
  ScheduledEventInStageChannel(
    channel_id: Snowflake(StageChannel),
    scheduled_end_time: option.Option(timestamp.Timestamp),
  )
  ScheduledEventInVoiceChannel(
    channel_id: Snowflake(VoiceChannel),
    scheduled_end_time: option.Option(timestamp.Timestamp),
  )
  ExternalScheduledEvent(
    location: String,
    scheduled_end_time: timestamp.Timestamp,
  )
}

Constructors

  • ScheduledEventInStageChannel(
      channel_id: Snowflake(StageChannel),
      scheduled_end_time: option.Option(timestamp.Timestamp),
    )

    Arguments

    scheduled_end_time

    The type of this field is dependent on the location, hence why you must first match on the location.

  • ScheduledEventInVoiceChannel(
      channel_id: Snowflake(VoiceChannel),
      scheduled_end_time: option.Option(timestamp.Timestamp),
    )

    Arguments

    scheduled_end_time

    The type of this field is dependent on the location, hence why you must first match on the location.

  • ExternalScheduledEvent(
      location: String,
      scheduled_end_time: timestamp.Timestamp,
    )

    Arguments

    location

    Where will the event be held?

    scheduled_end_time

    The type of this field is dependent on the location, hence why you must first match on the location.

Describes how often an event recurs.

Important! System limitations: https://docs.discord.com/developers/resources/guild-scheduled-event#system-limitations

pub type ScheduledEventRecurrenceRule {
  ScheduledEventRecurrenceRule(
    start: timestamp.Timestamp,
    end: option.Option(timestamp.Timestamp),
    frequency: ScheduledEventRecurrenceRuleFrequency,
    every_weekday: option.Option(List(weekday.Weekday)),
    every_nth_weekday: option.Option(
      List(ScheduledEventRecurrenceRuleNthWeekday),
    ),
    every_month: option.Option(List(calendar.Month)),
    every_month_day: option.Option(List(Int)),
    every_year_day: option.Option(List(Int)),
    count: option.Option(Int),
  )
}

Constructors

interval describes the spacing between events.

For example, ScheduledEventRecursWeekly(interval: 2) means “every two weeks”.

pub type ScheduledEventRecurrenceRuleFrequency {
  ScheduledEventRecursYearly(interval: Int)
  ScheduledEventRecursMonthly(interval: Int)
  ScheduledEventRecursWeekly(interval: Int)
  ScheduledEventRecursDaily(interval: Int)
}

Constructors

  • ScheduledEventRecursYearly(interval: Int)
  • ScheduledEventRecursMonthly(interval: Int)
  • ScheduledEventRecursWeekly(interval: Int)
  • ScheduledEventRecursDaily(interval: Int)
pub type ScheduledEventRecurrenceRuleNthWeekday {
  ScheduledEventRecurrenceRuleNthWeekday(
    n: Int,
    day: weekday.Weekday,
  )
}

Constructors

  • ScheduledEventRecurrenceRuleNthWeekday(
      n: Int,
      day: weekday.Weekday,
    )

    Arguments

    n

    On which week of the month should the event recur? (1-5)

    day

    On which day of the nth should the event recur?

pub type ScheduledEventStatus {
  ScheduledEventIsPlanned
  ScheduledEventIsActive
  ScheduledEventIsCompleted
  ScheduledEventIsCancelled
}

Constructors

  • ScheduledEventIsPlanned

    The event is planned to happen.

  • ScheduledEventIsActive

    The event is happening.

  • ScheduledEventIsCompleted

    The event has happened.

  • ScheduledEventIsCancelled

    The event was cancelled.

pub type SectionAccessory {
  SectionButton(MessageButton)
  SectionThumbnail(MessageThumbnail)
}

Constructors

pub type SectionComponent {
  SectionTextDisplay(MessageTextDisplay)
}

Constructors

pub type SelectChannelType {
  SelectTextChannels
  SelectDmChannels
  SelectVoiceChannels
  SelectCategoryChannels
  SelectAnnouncementChannels
  SelectAnnouncementThreads
  SelectPublicThreads
  SelectPrivateThreads
  SelectStageChannels
  SelectForumChannels
  SelectMediaChannels
}

Constructors

  • SelectTextChannels
  • SelectDmChannels
  • SelectVoiceChannels
  • SelectCategoryChannels
  • SelectAnnouncementChannels
  • SelectAnnouncementThreads
  • SelectPublicThreads
  • SelectPrivateThreads
  • SelectStageChannels
  • SelectForumChannels
  • SelectMediaChannels
pub type SeparatorSpacing {
  SmallSeparatorSpacing
  LargeSeparatorSpacing
}

Constructors

  • SmallSeparatorSpacing
  • LargeSeparatorSpacing

A SKU represents premium offerings that applications sell through Discord.

pub type Sku {
  Sku(
    id: Snowflake(Sku),
    type_: SkuType,
    application_id: Snowflake(Application),
    name: String,
    slug: String,
    flags: List(SkuFlag),
  )
}

Constructors

pub type SkuFlag {
  SkuIsAvailable
  SkuIsGuildSubscription
  SkuIsUserSubscription
}

Constructors

  • SkuIsAvailable

    The SKU is available for purchase

  • SkuIsGuildSubscription

    The SKU is a subscription purchased by a user and applied to a single guild.

    Everyone in that server gets premium benefits.

  • SkuIsUserSubscription

    The SKU is a subscription purchased by a user and applied to themselves.

    They get premium benefits in all guilds.

pub type SkuType {
  DurableSku
  ConsumableSku
  SubscriptionSku
  SubscriptionGroupSku
}

Constructors

  • DurableSku

    A durable one-time purchase

  • ConsumableSku

    A consumable one-time-purchase

  • SubscriptionSku
  • SubscriptionGroupSku

    An internal SKU used by Discord in their secret programs… for all intents and purposes, Subscription Group SKUs don’t exist.

pub type SlashCommand {
  SlashCommand(
    id: Snowflake(SlashCommand),
    command_id: Snowflake(Command),
    application_id: Snowflake(Application),
    guild_id: option.Option(Snowflake(Guild)),
    name: String,
    name_localizations: option.Option(dict.Dict(Locale, String)),
    description: String,
    description_localizations: option.Option(
      dict.Dict(Locale, String),
    ),
    options: List(SlashCommandOption),
    required_permissions: option.Option(List(Permission)),
    is_nsfw: Bool,
    installation_types: List(CommandInstallationType),
    contexts: List(CommandContext),
    version: Snowflake(CommandVersion),
  )
}

Constructors

pub type SlashCommandOption {
  SlashCommandOptionSubCommand(SubCommandSlashCommandOption)
  SlashCommandOptionSubCommandGroup(
    SubCommandGroupSlashCommandOption,
  )
  SlashCommandOptionString(StringSlashCommandOption)
  SlashCommandOptionInt(IntSlashCommandOption)
  SlashCommandOptionFloat(FloatSlashCommandOption)
  SlashCommandOptionBool(BoolSlashCommandOption)
  SlashCommandOptionUser(UserSlashCommandOption)
  SlashCommandOptionChannel(ChannelSlashCommandOption)
  SlashCommandOptionRole(RoleSlashCommandOption)
  SlashCommandOptionMentionable(MentionableSlashCommandOption)
  SlashCommandOptionAttachment(AttachmentSlashCommandOption)
}

Constructors

A snowflake is another name for an ID.

It is possible to retrieve an object’s creation date & time from its snowflake.

pub opaque type Snowflake(a)
pub type SoundboardSound {
  SoundboardSound(
    name: String,
    id: Snowflake(SoundboardSound),
    volume: Float,
    emoji: option.Option(SoundboardSoundEmoji),
    guild_id: option.Option(Snowflake(Guild)),
    is_available: Bool,
    creator: option.Option(User),
  )
}

Constructors

pub type SoundboardSoundContentType {
  Mp3SoundboardSound
  OggSoundboardSound
}

Constructors

  • Mp3SoundboardSound
  • OggSoundboardSound
pub type SoundboardSoundEmoji {
  UnicodeSoundboardSoundEmoji(character: String)
  CustomSoundboardSoundEmoji(id: Snowflake(Emoji))
}

Constructors

  • UnicodeSoundboardSoundEmoji(character: String)
  • CustomSoundboardSoundEmoji(id: Snowflake(Emoji))
pub type StageChannel {
  StageChannel(
    id: Snowflake(StageChannel),
    channel_id: Snowflake(Channel),
    guild_channel_id: Snowflake(GuildChannel),
    voice_like_channel_id: Snowflake(VoiceLikeChannel),
    permission_overwrites: List(PermissionOverwrite),
    guild_id: option.Option(Snowflake(Guild)),
    position: Int,
    name: String,
    is_nsfw: Bool,
    last_message_id: option.Option(Snowflake(Message)),
    bitrate: Int,
    user_limit: option.Option(Int),
    rate_limit_per_user: RateLimitPerUser,
    rtc_region_id: option.Option(String),
    video_quality_mode: VideoQualityMode,
    parent_id: option.Option(Snowflake(CategoryChannel)),
  )
}

Constructors

A stage instance is an ongoing event in a stage channel.

pub type StageInstance {
  StageInstance(
    id: Snowflake(StageInstance),
    guild_id: Snowflake(Guild),
    channel_id: Snowflake(Channel),
    guild_channel_id: Snowflake(GuildChannel),
    stage_channel_id: Snowflake(StageChannel),
    voice_like_channel_id: Snowflake(VoiceLikeChannel),
    topic: String,
    scheduled_event_id: option.Option(Snowflake(ScheduledEvent)),
  )
}

Constructors

pub type StandardSticker {
  StandardSticker(
    id: Snowflake(StandardSticker),
    sticker_id: Snowflake(Sticker),
    pack_id: Snowflake(StickerPack),
    name: String,
    description: option.Option(String),
    tags: String,
    format_type: StickerFormatType,
    sort_value: option.Option(Int),
  )
}

Constructors

  • StandardSticker(
      id: Snowflake(StandardSticker),
      sticker_id: Snowflake(Sticker),
      pack_id: Snowflake(StickerPack),
      name: String,
      description: option.Option(String),
      tags: String,
      format_type: StickerFormatType,
      sort_value: option.Option(Int),
    )

    Arguments

    pack_id

    ID of the pack from which this sticker comes from.

    description

    Is None if the sticker doesn’t have a description.

    tags

    Auto-complete/suggestion tags (keywords).

    sort_value

    A value used to sort more important stickers in the client. If None, sorted alphabetically. (I assume)

pub type Sticker {
  StickerStandardType(StandardSticker)
  StickerGuildType(GuildSticker)
}

Constructors

  • StickerStandardType(StandardSticker)

    Stickers available on all guilds to every user.

  • StickerGuildType(GuildSticker)

    Stickers available:

    • in the guild of registratrion for that guild’s members
    • in all guilds for Nitro subscribers who are also members of the guild of registration
pub type StickerFormatType {
  PngSticker
  ApngSticker
  LottieSticker
  GifSticker
}

Constructors

  • PngSticker
  • ApngSticker
  • LottieSticker
  • GifSticker

A partial representation of a sticker.

pub type StickerItem {
  StickerItem(
    id: Snowflake(Sticker),
    name: String,
    format_type: StickerFormatType,
  )
}

Constructors

pub type StickerPack {
  StickerPack(
    id: Snowflake(StickerPack),
    stickers: List(StandardSticker),
    name: String,
    sku_id: Snowflake(Sku),
    cover_sticker_id: option.Option(Snowflake(StandardSticker)),
    description: String,
    banner_id: option.Option(Snowflake(StickerPackBanner)),
  )
}

Constructors

A constructorless type for the StickerPack type as a Snowflake helper.

Used only to download the image of the sticker pack banner.

pub type StickerPackBanner
pub type StringSelectOption {
  StringSelectOption(
    label: String,
    value: String,
    description: option.Option(String),
    emoji: option.Option(ComponentEmoji),
    is_default_selected: Bool,
  )
}

Constructors

  • StringSelectOption(
      label: String,
      value: String,
      description: option.Option(String),
      emoji: option.Option(ComponentEmoji),
      is_default_selected: Bool,
    )

    Arguments

    label

    User-facing name.

    value

    Dev-facing value.

    description

    Max 100 characters.

    is_default_selected

    Whether the option is selected by default.

pub type StringSlashCommandOption {
  StringSlashCommandOption(
    name: String,
    name_localizations: option.Option(dict.Dict(Locale, String)),
    description: String,
    description_localizations: option.Option(
      dict.Dict(Locale, String),
    ),
    is_required: Bool,
    choices: List(StringSlashCommandOptionChoice),
    min_length: option.Option(Int),
    max_length: option.Option(Int),
    is_autocomplete_enabled: Bool,
  )
}

Constructors

pub type StringSlashCommandOptionChoice {
  StringSlashCommandOptionChoice(
    name: String,
    name_localizations: option.Option(dict.Dict(Locale, String)),
    value: String,
  )
}

Constructors

pub type SubCommandGroupOption {
  SubCommandGroupOptionSubCommand(SubCommandSlashCommandOption)
  SubCommandGroupOptionSubCommandGroup(
    SubCommandGroupSlashCommandOption,
  )
}

Constructors

pub type SubCommandGroupSlashCommandOption {
  SubCommandGroupSlashCommandOption(
    name: String,
    name_localizations: option.Option(dict.Dict(Locale, String)),
    description: String,
    description_localizations: option.Option(
      dict.Dict(Locale, String),
    ),
    options: List(SubCommandGroupOption),
  )
}

Constructors

pub type SubCommandOption {
  SubCommandOptionString(StringSlashCommandOption)
  SubCommandOptionInt(IntSlashCommandOption)
  SubCommandOptionFloat(FloatSlashCommandOption)
  SubCommandOptionBool(BoolSlashCommandOption)
  SubCommandOptionUser(UserSlashCommandOption)
  SubCommandOptionChannel(ChannelSlashCommandOption)
  SubCommandOptionRole(RoleSlashCommandOption)
  SubCommandOptionMentionable(MentionableSlashCommandOption)
  SubCommandOptionAttachment(AttachmentSlashCommandOption)
}

Constructors

pub type SubCommandSlashCommandOption {
  SubCommandSlashCommandOption(
    name: String,
    name_localizations: option.Option(dict.Dict(Locale, String)),
    description: String,
    description_localizations: option.Option(
      dict.Dict(Locale, String),
    ),
    options: List(SubCommandOption),
  )
}

Constructors

pub type SubmittedLabelComponent {
  SubmittedLabelStringSelectComponent(SubmittedModalStringSelect)
  SubmittedLabelTextInputComponent(SubmittedModalTextInput)
  SubmittedLabelUserSelectComponent(SubmittedModalUserSelect)
  SubmittedLabelRoleSelectComponent(SubmittedModalRoleSelect)
  SubmittedLabelMentionableSelectComponent(
    SubmittedModalMentionableSelect,
  )
  SubmittedLabelChannelSelectComponent(
    SubmittedModalChannelSelect,
  )
  SubmittedLabelFileUploadComponent(SubmittedModalFileUpload)
  SubmittedLabelRadioGroupComponent(SubmittedModalRadioGroup)
  SubmittedLabelCheckboxGroupComponent(
    SubmittedModalCheckboxGroup,
  )
  SubmittedLabelCheckboxComponent(SubmittedModalCheckbox)
}

Constructors

pub type SubmittedModal {
  SubmittedModal(
    custom_id: String,
    components: List(SubmittedModalComponent),
    resolved_objects: InteractionResolvedObjects,
  )
}

Constructors

pub type SubmittedModalChannelSelect {
  SubmittedModalChannelSelect(
    id: Int,
    custom_id: String,
    submitted_channels_ids: List(Snowflake(Channel)),
  )
}

Constructors

  • SubmittedModalChannelSelect(
      id: Int,
      custom_id: String,
      submitted_channels_ids: List(Snowflake(Channel)),
    )

    Arguments

    submitted_channels_ids

    Use the SubmittedModal’s resolved_objects field to get the channels themselves.

pub type SubmittedModalCheckbox {
  SubmittedModalCheckbox(
    id: Int,
    custom_id: String,
    is_checked: Bool,
  )
}

Constructors

  • SubmittedModalCheckbox(
      id: Int,
      custom_id: String,
      is_checked: Bool,
    )

    Arguments

    is_checked

    Whether the user selected the checkbox

pub type SubmittedModalCheckboxGroup {
  SubmittedModalCheckboxGroup(
    id: Int,
    custom_id: String,
    submitted_values: List(String),
  )
}

Constructors

  • SubmittedModalCheckboxGroup(
      id: Int,
      custom_id: String,
      submitted_values: List(String),
    )
pub type SubmittedModalComponent {
  SubmittedModalLabelComponent(SubmittedModalLabel)
  SubmittedModalTextDisplayComponent(SubmittedModalTextDisplay)
}

Constructors

pub type SubmittedModalFileUpload {
  SubmittedModalFileUpload(
    id: Int,
    custom_id: String,
    submitted_attachments_ids: List(Snowflake(MessageAttachment)),
  )
}

Constructors

  • SubmittedModalFileUpload(
      id: Int,
      custom_id: String,
      submitted_attachments_ids: List(Snowflake(MessageAttachment)),
    )

    Arguments

    submitted_attachments_ids

    Use the SubmittedModal’s resolved_objects field to get the attachments themselves.

pub type SubmittedModalLabel {
  SubmittedModalLabel(
    id: Int,
    component: SubmittedLabelComponent,
  )
}

Constructors

pub type SubmittedModalMentionableSelect {
  SubmittedModalMentionableSelect(
    id: Int,
    custom_id: String,
    submitted_mentionables_ids: List(Snowflake(Mentionable)),
  )
}

Constructors

  • SubmittedModalMentionableSelect(
      id: Int,
      custom_id: String,
      submitted_mentionables_ids: List(Snowflake(Mentionable)),
    )

    Arguments

    submitted_mentionables_ids

    Use the SubmittedModal’s resolved_objects field to get the mentionables themselves.

pub type SubmittedModalRadioGroup {
  SubmittedModalRadioGroup(
    id: Int,
    custom_id: String,
    submitted_value: option.Option(String),
  )
}

Constructors

  • SubmittedModalRadioGroup(
      id: Int,
      custom_id: String,
      submitted_value: option.Option(String),
    )
pub type SubmittedModalRoleSelect {
  SubmittedModalSelect(
    id: Int,
    custom_id: String,
    submitted_roles_ids: List(Snowflake(Role)),
  )
}

Constructors

  • SubmittedModalSelect(
      id: Int,
      custom_id: String,
      submitted_roles_ids: List(Snowflake(Role)),
    )

    Arguments

    submitted_roles_ids

    Use the SubmittedModal’s resolved_objects field to get the roles themselves.

pub type SubmittedModalStringSelect {
  SubmittedModalStringSelect(
    id: Int,
    custom_id: String,
    submitted_values: List(String),
  )
}

Constructors

  • SubmittedModalStringSelect(
      id: Int,
      custom_id: String,
      submitted_values: List(String),
    )
pub type SubmittedModalTextDisplay {
  SubmittedModalTextDisplay(id: Int)
}

Constructors

  • SubmittedModalTextDisplay(id: Int)
pub type SubmittedModalTextInput {
  SubmittedModalTextInput(
    id: Int,
    custom_id: String,
    submitted_text: String,
  )
}

Constructors

  • SubmittedModalTextInput(
      id: Int,
      custom_id: String,
      submitted_text: String,
    )
pub type SubmittedModalUserSelect {
  SubmittedModalUserSelect(
    id: Int,
    custom_id: String,
    submitted_users_ids: List(Snowflake(User)),
  )
}

Constructors

  • SubmittedModalUserSelect(
      id: Int,
      custom_id: String,
      submitted_users_ids: List(Snowflake(User)),
    )

    Arguments

    submitted_users_ids

    Use the SubmittedModal’s resolved_objects field to get the users themselves.

A “subscription” is a user making recurring payments for at least one SKU.

Successful subscriptions grant access to the SKU’s entitlements.

pub type Subscription {
  Subscription(
    id: Snowflake(Subscription),
    user_id: Snowflake(User),
    sku_ids: List(Snowflake(Sku)),
    entitlement_ids: List(Snowflake(Entitlement)),
    renewal_sku_ids: List(Snowflake(Sku)),
    current_period_start: timestamp.Timestamp,
    current_period_end: timestamp.Timestamp,
    status: SubscriptionStatus,
    canceled_timestamp: option.Option(timestamp.Timestamp),
  )
}

Constructors

pub type SubscriptionStatus {
  SubscriptionIsActive
  SubscriptionIsInactive
  SubscriptionIsEnding
}

Constructors

  • SubscriptionIsActive

    The subscription is active and scheduled to renew.

  • SubscriptionIsInactive

    The subscription is not being charged.

  • SubscriptionIsEnding

    The subscription is active but won’t renew.

pub type TextChannel {
  TextChannel(
    id: Snowflake(TextChannel),
    channel_id: Snowflake(Channel),
    guild_channel_id: Snowflake(GuildChannel),
    thread_creatable_channel_id: Snowflake(ThreadCreatableChannel),
    permission_overwrites: List(PermissionOverwrite),
    guild_id: option.Option(Snowflake(Guild)),
    position: Int,
    name: String,
    topic: option.Option(String),
    is_nsfw: Bool,
    last_message_id: option.Option(Snowflake(Message)),
    rate_limit_per_user: RateLimitPerUser,
    last_pin_timestamp: option.Option(timestamp.Timestamp),
    default_thread_auto_archive_duration: ThreadAutoArchiveDuration,
    default_thread_rate_limit_per_user: RateLimitPerUser,
    parent_id: option.Option(Snowflake(CategoryChannel)),
  )
}

Constructors

pub type TextInputStyle {
  ShortTextInput
  ParagraphTextInput
}

Constructors

  • ShortTextInput

    Single-line input.

  • ParagraphTextInput

    Multi-line input.

pub type Thread {
  Thread(
    id: Snowflake(Thread),
    channel_id: Snowflake(Channel),
    guild_channel_id: Snowflake(GuildChannel),
    type_: ThreadType,
    guild_id: option.Option(Snowflake(Guild)),
    name: String,
    last_message_id: option.Option(Snowflake(Message)),
    rate_limit_per_user: RateLimitPerUser,
    parent_id: Snowflake(GuildChannel),
    message_count: Int,
    approximate_member_count: Int,
    owner_id: Snowflake(User),
    is_archived: Bool,
    auto_archive_duration: ThreadAutoArchiveDuration,
    last_archive_status_change_at: timestamp.Timestamp,
    is_locked: Bool,
    created_at: option.Option(timestamp.Timestamp),
    flags: List(ThreadFlag),
    total_message_count: Int,
    applied_tags_ids: List(Snowflake(ForumTag)),
  )
}

Constructors

  • Thread(
      id: Snowflake(Thread),
      channel_id: Snowflake(Channel),
      guild_channel_id: Snowflake(GuildChannel),
      type_: ThreadType,
      guild_id: option.Option(Snowflake(Guild)),
      name: String,
      last_message_id: option.Option(Snowflake(Message)),
      rate_limit_per_user: RateLimitPerUser,
      parent_id: Snowflake(GuildChannel),
      message_count: Int,
      approximate_member_count: Int,
      owner_id: Snowflake(User),
      is_archived: Bool,
      auto_archive_duration: ThreadAutoArchiveDuration,
      last_archive_status_change_at: timestamp.Timestamp,
      is_locked: Bool,
      created_at: option.Option(timestamp.Timestamp),
      flags: List(ThreadFlag),
      total_message_count: Int,
      applied_tags_ids: List(Snowflake(ForumTag)),
    )

    Arguments

    guild_id

    Is None in some gateway events.

    last_message_id

    Is None if there are no messages in the channel.

    rate_limit_per_user

    Represents he amount of time between a user has to wait between sending a message or creating a thread.

    Bots and members with the AllowBypassingSlowmode permission are exempt from slowmode.

    Rate limits per user must be between 0 and 21600 seconds (7.22 hours).

    message_count

    Number of messages in the thread, not including the initial message or deleted messages.

    Inaccurate for threads created before July 1st, 2022 if they have more than 50 messages.

    approximate_member_count

    Stops counting at 50.

    owner_id

    OP’s ID.

    auto_archive_duration

    Time of inactivity after which the thread will be automatically archived.

    last_archive_status_change_at

    Time when the thread’s archive status was last changed at.

    is_locked

    If a thread is locked, only users with the AllowManagingThreads permission will be able to unarchive it.

    created_at

    Is None if the thread was created before September 1st, 2022.

    total_message_count

    Similar to message_count, except it won’t decrement when a message is deleted.

    applied_tags_ids

    IDs of the tags that are applied to this thread.

pub type ThreadAutoArchiveDuration {
  ArchiveThreadAfter1Hour
  ArchiveThreadAfter1Day
  ArchiveThreadAfter3Days
  ArchiveThreadAfter7Days
}

Constructors

  • ArchiveThreadAfter1Hour
  • ArchiveThreadAfter1Day
  • ArchiveThreadAfter3Days
  • ArchiveThreadAfter7Days

A channel where you can create threads - text and announcement channels.

Forum and media channels have their own type: ForumLikeChannel

pub type ThreadCreatableChannel
pub type ThreadFlag {
  ThreadIsPinned
}

Constructors

  • ThreadIsPinned

    The thread is pinned on top of its parent Forum or Media channel.

pub type ThreadMember {
  ThreadMember(
    thread_id: Snowflake(Thread),
    user_id: Snowflake(User),
    joined_at: timestamp.Timestamp,
  )
}

Constructors

pub type ThreadType {
  AnnouncementThread
  PublicThread
  PrivateThread(is_invitable: Bool)
}

Constructors

  • AnnouncementThread
  • PublicThread
  • PrivateThread(is_invitable: Bool)

An authentication token, required to identify the user (bot) making requests. See bot for creating bot tokens.

In the future, this will be extended to also support OAuth2 bearer tokens.

pub opaque type Token

Represents an offline guild, or a guild whose information has not been provided through the Guild Create events during the gateway connection initiation.

pub type UnavailableGuild {
  UnavailableGuild(id: Snowflake(Guild), is_unavailable: Bool)
}

Constructors

pub type UnfurledMediaItem {
  UnfurledMediaItem(
    url: String,
    proxy_url: String,
    content_type: String,
    flags: List(UnfurledMediaItemFlag),
    metadata: option.Option(UnfurledMediaItemMetadata),
    attachment_id: option.Option(Snowflake(MessageAttachment)),
  )
}

Constructors

pub type UnfurledMediaItemFlag {
  UnfurledMediaItemIsAnimated
}

Constructors

  • UnfurledMediaItemIsAnimated
pub type UnfurledMediaItemMetadata {
  UnfurledMediaItemMetadata(
    height: Int,
    width: Int,
    placeholder: String,
    placeholder_version: Int,
  )
}

Constructors

  • UnfurledMediaItemMetadata(
      height: Int,
      width: Int,
      placeholder: String,
      placeholder_version: Int,
    )

    Arguments

    height

    In pixels.

    width

    In pixels.

    placeholder

    Thumbhash representation of a placeholder.

    placeholder_version

    Thumbhash version.

pub type User {
  User(
    id: Snowflake(User),
    mentionable_id: Snowflake(Mentionable),
    username: String,
    discriminator: String,
    global_name: option.Option(String),
    avatar_hash: option.Option(ImageHash),
    is_bot: Bool,
    is_system: Bool,
    has_mfa_enabled: option.Option(Bool),
    banner_hash: option.Option(ImageHash),
    accent_colour: option.Option(colour.Colour),
    locale: option.Option(Locale),
    flags: List(UserFlag),
    premium_type: option.Option(UserPremiumType),
    public_flags: List(UserFlag),
    avatar_decoration: option.Option(UserAvatarDecoration),
    collectibles: option.Option(UserCollectibles),
    primary_guild: option.Option(UserPrimaryGuild),
  )
}

Constructors

  • User(
      id: Snowflake(User),
      mentionable_id: Snowflake(Mentionable),
      username: String,
      discriminator: String,
      global_name: option.Option(String),
      avatar_hash: option.Option(ImageHash),
      is_bot: Bool,
      is_system: Bool,
      has_mfa_enabled: option.Option(Bool),
      banner_hash: option.Option(ImageHash),
      accent_colour: option.Option(colour.Colour),
      locale: option.Option(Locale),
      flags: List(UserFlag),
      premium_type: option.Option(UserPremiumType),
      public_flags: List(UserFlag),
      avatar_decoration: option.Option(UserAvatarDecoration),
      collectibles: option.Option(UserCollectibles),
      primary_guild: option.Option(UserPrimaryGuild),
    )

    Arguments

    discriminator

    Mostly deprecated. Only bots have discriminators nowadays.

    Users will very likely have their discriminator set to 0.

    Used in the past when usernames weren’t user-specific.

    Doesn’t include the # prefix.

    global_name

    Also called a display name.

    Is None when the user doesn’t have a global name, and rather uses their username as their display name.

    avatar_hash

    Is None when the user uses a default avatar.

    is_bot

    Whether the user is a bot user.

    is_system

    Whether the user is Discord’s official system account.

    has_mfa_enabled

    Is None if it isn’t known whether the user has enabled MFA.

    MFA = multi-factor authentication.

    banner_hash

    Is None when the user doesn’t use a custom banner.

    accent_colour

    The user’s banner accent colour in RGB hexadecimal format.

    Is None when the user uses a default color based on avatar.

    locale

    The user’s chosen locale.

    Discord hasn’t disclosed when this field could be None.

    premium_type

    Is None if the user’s premium type isn’t known.

    public_flags

    Publicly visible flags - aka Discord badges.

    Visible in the top right corner of a person’s profile in the apps.

    primary_guild

    Is None if the user never had a primary guild.

pub type UserAvatarDecoration {
  UserAvatarDecoration(hash: ImageHash, sku_id: Snowflake(Sku))
}

Constructors

pub type UserCollectibles {
  UserCollectibles(nameplate: option.Option(UserNameplate))
}

Constructors

pub type UserCommand {
  UserCommand(
    id: Snowflake(UserCommand),
    command_id: Snowflake(Command),
    application_id: Snowflake(Application),
    guild_id: option.Option(Snowflake(Guild)),
    name: String,
    name_localizations: option.Option(dict.Dict(Locale, String)),
    required_permissions: option.Option(List(Permission)),
    is_nsfw: Bool,
    installation_types: List(CommandInstallationType),
    contexts: List(CommandContext),
    version: Snowflake(CommandVersion),
  )
}

Constructors

pub type UserFlag {
  UserIsStaff
  UserIsDiscordPartner
  UserIsHypesquadEventsMember
  UserIsBugHunterLevel1
  UserBelongsToHypesquadBravery
  UserBelongsToHypesquadBrilliance
  UserBelongsToHypesquadBalance
  UserIsPremiumEarlySupporter
  UserIsTeamPseudoUser
  UserIsBugHunterLevel2
  UserIsVerifiedBot
  UserIsVerifiedDeveloper
  UserIsCertifiedModerator
  BotUsesHttpInteractions
  UserIsActiveDeveloper
}

Constructors

  • UserIsStaff

    Given to official Discord staff.

  • UserIsDiscordPartner

    Given to partnered guild owners.

  • UserIsHypesquadEventsMember

    Given to participants of Hypesquad events.

  • UserIsBugHunterLevel1

    Given to Discord Bug Hunters, first level of the badge.

  • UserBelongsToHypesquadBravery
  • UserBelongsToHypesquadBrilliance
  • UserBelongsToHypesquadBalance
  • UserIsPremiumEarlySupporter

    Given to “early Nitro supporters”.

  • UserIsTeamPseudoUser

    The user is actually a development team.

  • UserIsBugHunterLevel2

    Given to Discord Bug Hunters, second level of the badge.

  • UserIsVerifiedBot

    Given to verified bot users.

  • UserIsVerifiedDeveloper

    Given to early verified bot developers. No longer obtainable.

  • UserIsCertifiedModerator

    Given to people who passed the Discord Certified Moderator course.

  • BotUsesHttpInteractions

    The bot only uses HTTP webhook interaction and is shown in the online member list.

  • UserIsActiveDeveloper

    Given to active developers. No longer obtainable.

A nameplate is a decoration around a user’s Direct Messages / online member list view tab.

pub type UserNameplate {
  UserNameplate(
    sku_id: Snowflake(Sku),
    hash: ImageHash,
    label: String,
    palette: UserNameplatePalette,
  )
}

Constructors

pub type UserNameplatePalette {
  CrimsonUserNameplate
  BerryUserNameplate
  SkyUserNameplate
  TealUserNameplate
  ForestUserNameplate
  BubbleGumUserNameplate
  VioletUserNameplate
  CobaltUserNameplate
  CloverUserNameplate
  LemonUserNameplate
  WhiteUserNameplate
}

Constructors

  • CrimsonUserNameplate
  • BerryUserNameplate
  • SkyUserNameplate
  • TealUserNameplate
  • ForestUserNameplate
  • BubbleGumUserNameplate
  • VioletUserNameplate
  • CobaltUserNameplate
  • CloverUserNameplate
  • LemonUserNameplate
  • WhiteUserNameplate

Describes what level of a Nitro subscription a user has.

pub type UserPremiumType {
  UserHasNoPremiumSubscription
  UserHasNitroClassic
  UserHasNitro
  UserHasNitroBasic
}

Constructors

  • UserHasNoPremiumSubscription
  • UserHasNitroClassic
  • UserHasNitro
  • UserHasNitroBasic
pub type UserPrimaryGuild {
  ActiveUserPrimaryGuild(
    id: Snowflake(Guild),
    tag: String,
    badge_hash: ImageHash,
  )
  AutomaticallyClearedUserPrimaryGuild
  ManuallyClearedUserPrimaryGuild
}

Constructors

  • ActiveUserPrimaryGuild(
      id: Snowflake(Guild),
      tag: String,
      badge_hash: ImageHash,
    )

    A user actively has a primary guild tag.

  • AutomaticallyClearedUserPrimaryGuild

    The user’s primary guild was cleared by Discord because the guild became ineligible for guild tags.

  • ManuallyClearedUserPrimaryGuild

    The user manually removed their guild tag.

pub type UserSlashCommandOption {
  UserSlashCommandOption(
    name: String,
    name_localizations: option.Option(dict.Dict(Locale, String)),
    description: String,
    description_localizations: option.Option(
      dict.Dict(Locale, String),
    ),
    is_required: Bool,
  )
}

Constructors

pub type UserStatus {
  UserIsOnline
  UserIsNotToBeDisturbed
  UserIsIdle
  UserIsInvisible
  UserIsOffline
}

Constructors

  • UserIsOnline

    Green circle icon displayed in the client.

  • UserIsNotToBeDisturbed

    Red do-not-disturb icon displayed in the client.

  • UserIsIdle

    Yellow crescent moon icon displayed in the client.

  • UserIsInvisible

    Looks offline in the client, is actually online.

    Gray empty circle icon displayed in the client.

  • UserIsOffline

    Gray empty circle icon displayed in the client.

pub type VideoMessageAttachment {
  VideoMessageAttachment(
    height: Int,
    width: Int,
    placeholder: String,
    placeholder_version: Int,
    duration: duration.Duration,
  )
}

Constructors

  • VideoMessageAttachment(
      height: Int,
      width: Int,
      placeholder: String,
      placeholder_version: Int,
      duration: duration.Duration,
    )

    Arguments

    height

    In pixels.

    width

    In pixels.

    placeholder

    Thumbhash representation of a placeholder.

    placeholder_version

    Thumbhash version.

pub type VideoQualityMode {
  AutomaticVideoQuality
  HdVideoQuality
}

Constructors

  • AutomaticVideoQuality
  • HdVideoQuality

    720p

pub type VoiceChannel {
  VoiceChannel(
    id: Snowflake(VoiceChannel),
    channel_id: Snowflake(Channel),
    guild_channel_id: Snowflake(GuildChannel),
    voice_like_channel_id: Snowflake(VoiceLikeChannel),
    permission_overwrites: List(PermissionOverwrite),
    guild_id: option.Option(Snowflake(Guild)),
    position: Int,
    name: String,
    is_nsfw: Bool,
    last_message_id: option.Option(Snowflake(Message)),
    bitrate: Int,
    user_limit: option.Option(Int),
    rate_limit_per_user: RateLimitPerUser,
    rtc_region_id: option.Option(String),
    video_quality_mode: VideoQualityMode,
    parent_id: option.Option(Snowflake(CategoryChannel)),
  )
}

Constructors

pub type VoiceLikeChannel
pub type VoiceMessageAttachment {
  VoiceMessageAttachment(
    duration: duration.Duration,
    waveform: BitArray,
  )
}

Constructors

pub type VoiceRegion {
  VoiceRegion(
    id: String,
    name: String,
    is_optimal: Bool,
    is_deprecated: Bool,
    is_custom: Bool,
  )
}

Constructors

  • VoiceRegion(
      id: String,
      name: String,
      is_optimal: Bool,
      is_deprecated: Bool,
      is_custom: Bool,
    )

    Arguments

    is_optimal

    Whether the region is the closest one to the current user.

    is_deprecated

    Avoid connecting to deprecated regions.

    is_custom

    Whether the region is a custom one (used for Discord events)

pub type VoiceState {
  VoiceState(
    guild_id: Snowflake(Guild),
    channel_id: option.Option(Snowflake(Channel)),
    guild_channel_id: option.Option(Snowflake(GuildChannel)),
    voice_like_channel_id: option.Option(
      Snowflake(VoiceLikeChannel),
    ),
    user_id: Snowflake(User),
    guild_member: GuildMember,
    session_id: String,
    is_guild_deafened: Bool,
    is_guild_muted: Bool,
    is_self_deafened: Bool,
    is_self_muted: Bool,
    is_streaming: Bool,
    is_sharing_camera: Bool,
    is_suppressed: Bool,
    request_to_speak_timestamp: option.Option(timestamp.Timestamp),
  )
}

Constructors

  • VoiceState(
      guild_id: Snowflake(Guild),
      channel_id: option.Option(Snowflake(Channel)),
      guild_channel_id: option.Option(Snowflake(GuildChannel)),
      voice_like_channel_id: option.Option(
        Snowflake(VoiceLikeChannel),
      ),
      user_id: Snowflake(User),
      guild_member: GuildMember,
      session_id: String,
      is_guild_deafened: Bool,
      is_guild_muted: Bool,
      is_self_deafened: Bool,
      is_self_muted: Bool,
      is_streaming: Bool,
      is_sharing_camera: Bool,
      is_suppressed: Bool,
      request_to_speak_timestamp: option.Option(timestamp.Timestamp),
    )

    Arguments

    channel_id

    Is None when the user is not connected to any channel.

    guild_channel_id

    Is None when the user is not connected to any channel.

    voice_like_channel_id

    Is None when the user is not connected to any channel.

    is_suppressed

    For stage channels with an active instance, whether the user’s request to speak was denied.

    request_to_speak_timestamp

    For stage channels with an active instance, when the user requested to speak.

pub type Webhook

Values

pub fn action_row_component_decoder() -> decode.Decoder(
  ActionRowComponent,
)
pub fn add_member_to_thread_request(
  token token: Token,
  thread_with_id thread_id: Snowflake(Thread),
  member_with_id member_id: Snowflake(User),
) -> request.Request(String)

The thread mustn’t be archived.

Requires the ability to send messages in the thread.

pub fn add_member_to_thread_response(
  response: response.Response(String),
) -> Result(Nil, RestError)
pub fn add_role_to_guild_member_request(
  token token: Token,
  in_guild_with_id guild_id: Snowflake(Guild),
  to_member_with_id user_id: Snowflake(User),
  role_with_id role_id: Snowflake(Role),
  reason reason: option.Option(String),
) -> request.Request(String)

Requires the AllowManagingRoles permission.

pub fn add_role_to_guild_member_response(
  response: response.Response(String),
) -> Result(Nil, RestError)
pub fn afk_timeout_decoder() -> decode.Decoder(AfkTimeout)
pub fn afk_timeout_to_json(afk_timeout: AfkTimeout) -> json.Json
pub fn allowed_message_mentions_to_json(
  mentions: List(AllowedMessageMention),
) -> json.Json
pub fn announcement_channel_decoder() -> decode.Decoder(
  AnnouncementChannel,
)
pub fn application_decoder() -> decode.Decoder(Application)
pub fn application_emoji_decoder() -> decode.Decoder(
  ApplicationEmoji,
)
pub fn application_installation_settings_to_json(
  application_installation_settings: ApplicationInstallationSettings,
) -> json.Json
pub fn application_owner_decoder() -> decode.Decoder(
  ApplicationOwner,
)
pub fn archive_thread(modify: ModifyThread) -> ModifyThread
pub fn attachment_slash_command_option_to_json(
  option: AttachmentSlashCommandOption,
) -> json.Json
pub fn audio_message_attachment_decoder() -> decode.Decoder(
  AudioMessageAttachment,
)
pub fn autocomplete_request_command_option_decoder() -> decode.Decoder(
  Result(AutocompleteRequestCommandOption, Nil),
)
pub fn autocomplete_request_command_options_decoder() -> decode.Decoder(
  List(AutocompleteRequestCommandOption),
)
pub fn autocomplete_request_interaction_response_to_json(
  response: AutocompleteRequestInteractionResponse,
) -> json.Json
pub fn autocomplete_request_sub_command_option_decoder() -> decode.Decoder(
  Result(AutocompleteRequestSubCommandOption, Nil),
)
pub fn autocomplete_request_sub_command_options_decoder() -> decode.Decoder(
  List(AutocompleteRequestSubCommandOption),
)
pub fn ban_guild_member_request(
  token token: Token,
  with_id user_id: Snowflake(User),
  from_guild_with_id guild_id: Snowflake(Guild),
  delete_messages_since delete_messages_since: option.Option(
    duration.Duration,
  ),
  reason reason: option.Option(String),
) -> request.Request(String)

Requires the AllowBanningMembers permission.

delete_messages_since will delete the messages the user has sent in the guild that are at most 7 days old.

pub fn ban_guild_member_response(
  response: response.Response(String),
) -> Result(Nil, RestError)
pub fn base64_decoder() -> decode.Decoder(BitArray)
pub fn bool_slash_command_option_decoder() -> decode.Decoder(
  BoolSlashCommandOption,
)
pub fn bool_slash_command_option_to_json(
  option: BoolSlashCommandOption,
) -> json.Json
pub fn bot(token: String) -> Token

Creates a token object for a bot.

pub fn bulk_delete_messages_request(
  token token: Token,
  in_channel_with_id channel_id: Snowflake(GuildChannel),
  message_ids message_ids: List(Snowflake(Message)),
  reason reason: option.Option(String),
) -> request.Request(String)

Any messages older than 2 weeks will be rejected by Discord.

You must provide between 2 and 100 messages.

Requires the AllowManagingMessages permission.

pub fn bulk_delete_messages_response(
  response: response.Response(String),
) -> Result(Nil, RestError)
pub fn bulk_guild_ban_request(
  token token: Token,
  users_with_ids user_ids: List(Snowflake(User)),
  from_guild_with_id guild_id: Snowflake(Guild),
  delete_messages_since delete_messages_since: option.Option(
    duration.Duration,
  ),
  reason reason: option.Option(String),
) -> request.Request(String)

Requires the AllowBanningMembers and AllowManagingGuild permissions.

pub fn bulk_guild_ban_response(
  response: response.Response(String),
) -> Result(BulkGuildBanResponse, RestError)
pub fn bulk_guild_ban_response_decoder() -> decode.Decoder(
  BulkGuildBanResponse,
)
pub fn bulk_overwrite_global_commands() -> BulkOverwriteGlobalCommands
pub fn bulk_overwrite_global_commands_request(
  token token: Token,
  current_application_id application_id: Snowflake(Application),
  using bulk_overwrite: BulkOverwriteGlobalCommands,
) -> request.Request(String)
pub fn bulk_overwrite_global_commands_to_json(
  bulk_overwrite: BulkOverwriteGlobalCommands,
) -> json.Json
pub fn bulk_overwrite_global_message_commands(
  bulk_overwrite: BulkOverwriteGlobalCommands,
  new message_commands: List(CreateGlobalMessageCommand),
) -> BulkOverwriteGlobalCommands
pub fn bulk_overwrite_global_slash_commands(
  bulk_overwrite: BulkOverwriteGlobalCommands,
  new slash_commands: List(CreateGlobalSlashCommand),
) -> BulkOverwriteGlobalCommands
pub fn bulk_overwrite_global_user_commands(
  bulk_overwrite: BulkOverwriteGlobalCommands,
  new user_commands: List(CreateGlobalUserCommand),
) -> BulkOverwriteGlobalCommands
pub fn bulk_overwrite_guild_commands() -> BulkOverwriteGuildCommands
pub fn bulk_overwrite_guild_commands_request(
  token token: Token,
  current_application_id application_id: Snowflake(Application),
  guild_id guild_id: Snowflake(Guild),
  using bulk_overwrite: BulkOverwriteGuildCommands,
) -> request.Request(String)
pub fn bulk_overwrite_guild_commands_to_json(
  bulk_overwrite: BulkOverwriteGuildCommands,
) -> json.Json
pub fn bulk_overwrite_guild_message_commands(
  bulk_overwrite: BulkOverwriteGuildCommands,
  new message_commands: List(CreateGuildMessageCommand),
) -> BulkOverwriteGuildCommands
pub fn bulk_overwrite_guild_slash_commands(
  bulk_overwrite: BulkOverwriteGuildCommands,
  new slash_commands: List(CreateGuildSlashCommand),
) -> BulkOverwriteGuildCommands
pub fn bulk_overwrite_guild_user_commands(
  bulk_overwrite: BulkOverwriteGuildCommands,
  new user_commands: List(CreateGuildUserCommand),
) -> BulkOverwriteGuildCommands
pub fn bulk_ovewrite_global_commands_response(
  response: response.Response(String),
) -> Result(List(Command), RestError)
pub fn bulk_ovewrite_guild_commands_response(
  response: response.Response(String),
) -> Result(List(Command), RestError)
pub fn category_channel_decoder() -> decode.Decoder(
  CategoryChannel,
)
pub fn channel_decoder() -> decode.Decoder(Channel)
pub fn channel_select_default_value_to_json(
  id: Snowflake(Channel),
) -> json.Json
pub fn channel_slash_command_option_to_json(
  option: ChannelSlashCommandOption,
) -> json.Json
pub fn clip_message_attachment_decoder() -> decode.Decoder(
  ClipMessageAttachment,
)
pub fn colour_to_json(colour: colour.Colour) -> json.Json
pub fn command_context_to_json(
  context: CommandContext,
) -> json.Json
pub fn command_decoder() -> decode.Decoder(Command)
pub fn command_installation_type_to_json(
  type_: CommandInstallationType,
) -> json.Json
pub fn command_interaction_decoder() -> decode.Decoder(
  CommandInteraction,
)
pub fn command_interaction_response_to_json(
  response: CommandInteractionResponse,
) -> json.Json
pub fn component_emoji_to_json(
  emoji: ComponentEmoji,
) -> json.Json
pub fn consume_entitlement_request(
  token token: Token,
  current_application_id application_id: Snowflake(Application),
  entitlement_with_id entitlement_id: Snowflake(Entitlement),
) -> request.Request(String)

Marks the entitlement as consumed by the user.

Only for one-time consumable SKUs.

You have to provide the current application’s ID. Sorry, I don’t make the rules :/

pub fn consume_entitlement_response(
  response: response.Response(String),
) -> Result(Nil, RestError)
pub fn container_component_decoder() -> decode.Decoder(
  ContainerComponent,
)
pub fn convert_announcement_channel_to_text_channel(
  modify: ModifyAnnouncementChannel,
) -> ModifyAnnouncementChannel
pub fn convert_text_channel_to_announcement_channel(
  modify: ModifyTextChannel,
) -> ModifyTextChannel

Requires the guild to have the GuildCanCreateAnnouncementChannels feature.

pub fn create_action_row_component_to_json(
  component: CreateActionRowComponent,
) -> json.Json
pub fn create_announcement_channel_to_json(
  create: CreateAnnouncementChannel,
) -> json.Json
pub fn create_category_channel_to_json(
  create: CreateCategoryChannel,
) -> json.Json
pub fn create_checkbox_group_option_to_json(
  create: CreateCheckboxGroupOption,
) -> json.Json
pub fn create_container_component_to_json(
  component: CreateContainerComponent,
) -> json.Json
pub fn create_embed_author_to_json(
  create: CreateEmbedAuthor,
) -> json.Json
pub fn create_embed_field_to_json(
  create: CreateEmbedField,
) -> json.Json
pub fn create_embed_footer_to_json(
  create: CreateEmbedFooter,
) -> json.Json
pub fn create_embed_image_to_json(
  create: CreateEmbedImage,
) -> json.Json
pub fn create_forum_channel_to_json(
  create: CreateForumChannel,
) -> json.Json
pub fn create_forum_like_thread_message_embed_to_json(
  create: CreateForumLikeThreadMessageEmbed,
) -> json.Json
pub fn create_forum_like_thread_message_to_json(
  create: CreateForumLikeThreadMessage,
) -> json.Json
pub fn create_forum_like_thread_to_json(
  create: CreateForumLikeThread,
) -> json.Json
pub fn create_global_message_command_to_json(
  create: CreateGlobalMessageCommand,
) -> json.Json
pub fn create_global_slash_command_to_json(
  create: CreateGlobalSlashCommand,
) -> json.Json
pub fn create_global_user_command_to_json(
  create: CreateGlobalUserCommand,
) -> json.Json
pub fn create_guild_channel_invite_to_json(
  create: CreateGuildChannelInvite,
) -> json.Json
pub fn create_guild_message_command_to_json(
  create: CreateGuildMessageCommand,
) -> json.Json
pub fn create_guild_slash_command_to_json(
  create: CreateGuildSlashCommand,
) -> json.Json
pub fn create_guild_soundboard_sound_to_json(
  create: CreateGuildSoundboardSound,
) -> json.Json
pub fn create_guild_user_command_to_json(
  create: CreateGuildUserCommand,
) -> json.Json
pub fn create_link_button_to_json(
  create: CreateLinkButton,
) -> json.Json
pub fn create_media_channel_to_json(
  create: CreateMediaChannel,
) -> json.Json
pub fn create_media_gallery_item_to_json(
  create: CreateMediaGalleryItem,
) -> json.Json
pub fn create_message_action_row_to_json(
  create: CreateMessageActionRow,
) -> json.Json
pub fn create_message_attachment_to_json(
  create: CreateMessageAttachment,
  idx: Int,
) -> json.Json
pub fn create_message_attachments_to_json(
  attachments: option.Option(List(CreateMessageAttachment)),
) -> Result(#(String, json.Json), Nil)
pub fn create_message_button_to_json(
  button: CreateMessageButton,
) -> json.Json
pub fn create_message_channel_select_to_json(
  create: CreateMessageChannelSelect,
) -> json.Json
pub fn create_message_component_to_json(
  component: CreateMessageComponent,
) -> json.Json
pub fn create_message_container_to_json(
  create: CreateMessageContainer,
) -> json.Json
pub fn create_message_embed_to_json(
  create: CreateMessageEmbed,
) -> json.Json
pub fn create_message_file_to_json(
  create: CreateMessageFile,
) -> json.Json
pub fn create_message_media_gallery_to_json(
  create: CreateMessageMediaGallery,
) -> json.Json
pub fn create_message_mentionable_select_to_json(
  create: CreateMessageMentionableSelect,
) -> json.Json
pub fn create_message_reference_to_json(
  create: CreateMessageReference,
) -> json.Json
pub fn create_message_role_select_to_json(
  create: CreateMessageRoleSelect,
) -> json.Json
pub fn create_message_section_to_json(
  create: CreateMessageSection,
) -> json.Json
pub fn create_message_separator_to_json(
  create: CreateMessageSeparator,
) -> json.Json
pub fn create_message_string_select_to_json(
  create: CreateMessageStringSelect,
) -> json.Json
pub fn create_message_text_display_to_json(
  create: CreateMessageTextDisplay,
) -> json.Json
pub fn create_message_thumbnail_to_json(
  create: CreateMessageThumbnail,
) -> json.Json
pub fn create_message_to_json(create: CreateMessage) -> json.Json
pub fn create_message_user_select_to_json(
  create: CreateMessageUserSelect,
) -> json.Json
pub fn create_modal_channel_select_to_json(
  create: CreateModalChannelSelect,
) -> json.Json
pub fn create_modal_checkbox_group_to_json(
  create: CreateModalCheckboxGroup,
) -> json.Json
pub fn create_modal_checkbox_to_json(
  create: CreateModalCheckbox,
) -> json.Json
pub fn create_modal_component_to_json(
  create: CreateModalComponent,
) -> json.Json
pub fn create_modal_file_upload_to_json(
  create: CreateModalFileUpload,
) -> json.Json
pub fn create_modal_label_component_to_json(
  create: CreateModalLabelComponent,
) -> json.Json
pub fn create_modal_label_to_json(
  create: CreateModalLabel,
) -> json.Json
pub fn create_modal_mentionable_select_to_json(
  create: CreateModalMentionableSelect,
) -> json.Json
pub fn create_modal_radio_group_to_json(
  create: CreateModalRadioGroup,
) -> json.Json
pub fn create_modal_role_select_to_json(
  create: CreateModalRoleSelect,
) -> json.Json
pub fn create_modal_string_select_to_json(
  create: CreateModalStringSelect,
) -> json.Json
pub fn create_modal_text_display_to_json(
  create: CreateModalTextDisplay,
) -> json.Json
pub fn create_modal_text_input_to_json(
  create: CreateModalTextInput,
) -> json.Json
pub fn create_modal_user_select_to_json(
  create: CreateModalUserSelect,
) -> json.Json
pub fn create_poll_answer_emoji_to_json(
  create: CreatePollAnswerEmoji,
) -> json.Json
pub fn create_poll_answer_to_json(
  create: CreatePollAnswer,
) -> json.Json
pub fn create_poll_to_json(create: CreatePoll) -> json.Json
pub fn create_premium_button_to_json(
  create: CreatePremiumButton,
) -> json.Json
pub fn create_radio_group_option_to_json(
  create: CreateRadioGroupOption,
) -> json.Json
pub fn create_regular_button_to_json(
  create: CreateRegularButton,
) -> json.Json
pub fn create_role_to_json(create: CreateRole) -> json.Json
pub fn create_section_accessory_to_json(
  accessory: CreateSectionAccessory,
) -> json.Json
pub fn create_section_component_to_json(
  component: CreateSectionComponent,
) -> json.Json
pub fn create_stage_channel_to_json(
  create: CreateStageChannel,
) -> json.Json
pub fn create_stage_instance_to_json(
  create: CreateStageInstance,
) -> json.Json
pub fn create_text_channel_to_json(
  create: CreateTextChannel,
) -> json.Json
pub fn create_thread_from_message_to_json(
  create: CreateThreadFromMessage,
) -> json.Json
pub fn create_thread_to_json(create: CreateThread) -> json.Json
pub fn create_unfurled_media_item_to_json(
  create: CreateUnfurledMediaItem,
) -> json.Json
pub fn create_voice_channel_to_json(
  create: CreateVoiceChannel,
) -> json.Json
pub fn crosspost_message_request(
  token token: Token,
  from_channel_with_id channel_id: Snowflake(AnnouncementChannel),
  message_with_id message_id: Snowflake(Message),
) -> request.Request(String)

Crossposts a message from an announcement channel to all its followers.

Required permissions in the announcement channel:

  • AllowSendingMessages - for the current user’s messages
  • AllowManagingMessages - for all other messages
pub fn crosspost_message_response(
  response: response.Response(String),
) -> Result(Message, RestError)
pub fn custom_emoji_decoder() -> decode.Decoder(CustomEmoji)
pub fn deafen_guild_member(
  modify: ModifyGuildMember,
) -> ModifyGuildMember

Requires the AllowDeafeningMembersInVoiceChannels permission.

Denies the user’s permission to listen and speak in all the guild’s voice channels.

Will return a bad request if the user is not in a voice channel.

pub fn default_forum_reaction_decoder() -> decode.Decoder(
  DefaultForumReaction,
)
pub fn default_forum_reaction_to_json(
  reaction: DefaultForumReaction,
) -> json.Json
pub fn defer_command_interaction_response(
  is_response_ephemeral is_ephemeral: Bool,
) -> CommandInteractionResponse

Gives you 15 minutes while the bot is displaying a “thinking” state.

Modify the original interaction response to stop the “thinking” state.

pub fn defer_message_component_interaction_message_response(
  is_ephemeral is_ephemeral: Bool,
) -> MessageComponentInteractionResponse

Responds by replying to the original component’s message with a “thinking” state.

Gives you 15 minutes to edit the response, will create a reply message after editing.

pub fn defer_message_component_interaction_message_update_response() -> MessageComponentInteractionResponse

Responds by acknowledging the interaction and pledging to edit the original message within 15 minutes.

pub fn defer_modal_interaction_response(
  is_ephemeral is_ephemeral: Bool,
) -> ModalInteractionResponse
pub fn delete_channel_request(
  token token: Token,
  channel_with_id id: Snowflake(Channel),
  reason reason: option.Option(String),
) -> request.Request(String)

Behavior:

  • guild channels - will permanently and irreversibly delete the channel; requires the AllowManagingChannels permission
    • category channels - will not delete the child channels, their parent_id property will be deleted
    • community-specific (rules & community updates) channels - cannot be deleted
  • threads - will permanently and irreversibly delete the thread; requires the AllowManagingThreads permission
  • DM channels - will close the channel; the channel can be re-opened by opening a DM with the recipient once again
pub fn delete_channel_response(
  response: response.Response(String),
) -> Result(Nil, RestError)
pub fn delete_current_application_cover_image(
  modify: ModifyCurrentApplication,
) -> ModifyCurrentApplication
pub fn delete_current_guild_member_avatar(
  modify: ModifyCurrentGuildMember,
) -> ModifyCurrentGuildMember

Modifies your per-guild avatar.

pub fn delete_current_guild_member_banner(
  modify: ModifyCurrentGuildMember,
) -> ModifyCurrentGuildMember

Modifies your per-guild banner.

pub fn delete_current_guild_member_bio(
  modify: ModifyCurrentGuildMember,
) -> ModifyCurrentGuildMember

Deletes your per-guild bio.

pub fn delete_current_guild_member_nick(
  modify: ModifyCurrentGuildMember,
) -> ModifyCurrentGuildMember

Requires the AllowChangingOwnNickname permission.

pub fn delete_current_user_avatar(
  modify: ModifyCurrentUser,
) -> ModifyCurrentUser
pub fn delete_current_user_banner(
  modify: ModifyCurrentUser,
) -> ModifyCurrentUser
pub fn delete_current_user_message_reaction_request(
  token token: Token,
  in_channel_with_id channel_id: Snowflake(Channel),
  from_message_with_id message_id: Snowflake(Message),
  emoji emoji: MessageReactionEmoji,
) -> request.Request(String)
pub fn delete_current_user_message_reaction_response(
  response: response.Response(String),
) -> Result(Nil, RestError)
pub fn delete_forum_channel_rate_limit_per_user(
  modify: ModifyForumChannel,
) -> ModifyForumChannel
pub fn delete_forum_channel_topic(
  modify: ModifyForumChannel,
) -> ModifyForumChannel
pub fn delete_global_command_request(
  token token: Token,
  current_application_id application_id: Snowflake(Application),
  command_with_id command_id: Snowflake(Command),
) -> request.Request(String)
pub fn delete_global_command_response(
  response: response.Response(String),
) -> Result(Nil, RestError)
pub fn delete_global_message_command_name_localizations(
  modify: ModifyGlobalMessageCommand,
) -> ModifyGlobalMessageCommand
pub fn delete_global_message_command_required_permissions(
  modify: ModifyGlobalMessageCommand,
) -> ModifyGlobalMessageCommand

Enables the command for everyone.

pub fn delete_global_slash_command_description_localizations(
  modify: ModifyGlobalSlashCommand,
) -> ModifyGlobalSlashCommand
pub fn delete_global_slash_command_name_localizations(
  modify: ModifyGlobalSlashCommand,
) -> ModifyGlobalSlashCommand
pub fn delete_global_slash_command_required_permissions(
  modify: ModifyGlobalSlashCommand,
) -> ModifyGlobalSlashCommand

Enables the command for everyone.

pub fn delete_global_user_command_name_localizations(
  modify: ModifyGlobalUserCommand,
) -> ModifyGlobalUserCommand
pub fn delete_global_user_command_required_permissions(
  modify: ModifyGlobalUserCommand,
) -> ModifyGlobalUserCommand

Enables the command for everyone.

pub fn delete_guild_command_request(
  token token: Token,
  current_application_id application_id: Snowflake(Application),
  guild_id guild_id: Snowflake(Guild),
  command_with_id command_id: Snowflake(Command),
) -> request.Request(String)
pub fn delete_guild_command_response(
  response: response.Response(String),
) -> Result(Nil, RestError)
pub fn delete_guild_discovery_splash(
  modify: ModifyGuild,
) -> ModifyGuild
pub fn delete_guild_integration_request(
  token token: Token,
  with_id integration_id: Snowflake(GuildIntegration),
  from_guild_with_id guild_id: Snowflake(Guild),
  reason reason: option.Option(String),
) -> request.Request(String)

Requires the AllowManagingGuild permission.

Deletes any associated webhooks and kicks the associated bot (if there is one).

pub fn delete_guild_integration_response(
  response: response.Response(String),
) -> Result(Nil, RestError)
pub fn delete_guild_message_command_name_localizations(
  modify: ModifyGuildMessageCommand,
) -> ModifyGuildMessageCommand
pub fn delete_guild_message_command_required_permissions(
  modify: ModifyGuildMessageCommand,
) -> ModifyGuildMessageCommand

Enables the command for everyone.

pub fn delete_guild_slash_command_description_localizations(
  modify: ModifyGuildSlashCommand,
) -> ModifyGuildSlashCommand
pub fn delete_guild_slash_command_name_localizations(
  modify: ModifyGuildSlashCommand,
) -> ModifyGuildSlashCommand
pub fn delete_guild_slash_command_required_permissions(
  modify: ModifyGuildSlashCommand,
) -> ModifyGuildSlashCommand

Enables the command for everyone.

pub fn delete_guild_soundboard_sound_request(
  token token: Token,
  in_guild_with_id guild_id: Snowflake(Guild),
  sound_with_id sound_id: Snowflake(SoundboardSound),
  reason reason: option.Option(String),
) -> request.Request(String)

If the sound was created by the current user, requires the AllowCreatingGuildExpressions or AllowManagingGuildExpressions permission.

For all other sounds, requires the AllowManagingGuildExpressions permission.

pub fn delete_guild_soundboard_sound_response(
  response: response.Response(String),
) -> Result(Nil, RestError)
pub fn delete_guild_sticker_description(
  modify: ModifyGuildSticker,
) -> ModifyGuildSticker
pub fn delete_guild_sticker_request(
  token token: Token,
  in_guild_with_id guild_id: Snowflake(Guild),
  sticker_with_id sticker_id: Snowflake(GuildSticker),
  reason reason: option.Option(String),
) -> request.Request(String)

Required permissions:

  • for stickers created by the current user - AllowCreatingGuildExpressions or AllowManagingGuildExpressions
  • for other stickers - AllowManagingGuildExpressions
pub fn delete_guild_sticker_response(
  response: response.Response(String),
) -> Result(Nil, RestError)
pub fn delete_guild_user_command_name_localizations(
  modify: ModifyGuildUserCommand,
) -> ModifyGuildUserCommand
pub fn delete_guild_user_command_required_permissions(
  modify: ModifyGuildUserCommand,
) -> ModifyGuildUserCommand

Enables the command for everyone.

pub fn delete_guild_welcome_screen_description(
  modify: ModifyGuildWelcomeScreen,
) -> ModifyGuildWelcomeScreen
pub fn delete_interaction_response_followup_message_request(
  token token: Token,
  current_application_id application_id: Snowflake(Application),
  interaction_token interaction_token: InteractionToken,
  message_id message_id: Snowflake(Message),
) -> request.Request(String)
pub fn delete_interaction_response_followup_message_response(
  response: response.Response(String),
) -> Result(Nil, RestError)
pub fn delete_invite_request(
  token token: Token,
  invite_with_code code: String,
  reason reason: option.Option(String),
) -> request.Request(String)

Requirements:

  • for a channel invite - AllowManagingChannels in that channel
  • for any invite - AllowManagingGuild
pub fn delete_invite_response(
  response: response.Response(String),
) -> Result(Invite, RestError)
pub fn delete_media_channel_rate_limit_per_user(
  modify: ModifyMediaChannel,
) -> ModifyMediaChannel
pub fn delete_media_channel_topic(
  modify: ModifyMediaChannel,
) -> ModifyMediaChannel
pub fn delete_message_emoji_reactions_request(
  token token: Token,
  in_channel_with_id channel_id: Snowflake(Channel),
  from_message_with_id message_id: Snowflake(Message),
  emoji emoji: MessageReactionEmoji,
) -> request.Request(String)

Deletes all the reactions for a given messages from a message.

Requires the AllowManagingMessages permission.

pub fn delete_message_emoji_reactions_response(
  response: response.Response(String),
) -> Result(Nil, RestError)
pub fn delete_message_reaction_request(
  token token: Token,
  in_channel_with_id channel_id: Snowflake(Channel),
  from_message_with_id message_id: Snowflake(Message),
  by_user_with_id user_id: Snowflake(User),
  emoji emoji: MessageReactionEmoji,
) -> request.Request(String)

Requires the AllowManagingMessages permission.

pub fn delete_message_reaction_response(
  response: response.Response(String),
) -> Result(Nil, RestError)
pub fn delete_message_reactions_request(
  token token: Token,
  in_channel_with_id channel_id: Snowflake(Channel),
  message_with_id message_id: Snowflake(Message),
) -> request.Request(String)

Removes all reactions from a message.

Requires the AllowManagingMessages permission.

pub fn delete_message_reactions_response(
  response: response.Response(String),
) -> Result(Nil, RestError)
pub fn delete_message_request(
  token token: Token,
  in_channel_with_id channel_id: Snowflake(Channel),
  message_with_id message_id: Snowflake(Message),
  reason reason: option.Option(String),
) -> request.Request(String)

Deleting others’ messages requires the AllowManagingMessages permission.

pub fn delete_message_response(
  response: response.Response(String),
) -> Result(Nil, RestError)
pub fn delete_original_interaction_response_request(
  token token: Token,
  current_application_id application_id: Snowflake(Application),
  interaction_token interaction_token: InteractionToken,
) -> request.Request(String)
pub fn delete_original_interaction_response_response(
  response: response.Response(String),
) -> Result(Nil, RestError)
pub fn delete_role_colours(modify: ModifyRole) -> ModifyRole
pub fn delete_role_position(
  of_role_with_id id: Snowflake(Role),
) -> ModifyRolePosition

Deleting a role’s position makes it lower than any role with a position.

Roles with the same position are sorted by ID.

pub fn delete_role_request(
  token token: Token,
  with_id role_id: Snowflake(Role),
  from_guild_with_id guild_id: Snowflake(Guild),
  reason reason: option.Option(String),
) -> request.Request(String)

Requires the AllowManagingRoles permission.

pub fn delete_role_response(
  response: response.Response(String),
) -> Result(Nil, RestError)
pub fn delete_role_unicode_emoji(
  modify: ModifyRole,
) -> ModifyRole
pub fn delete_stage_channel_rate_limit_per_user(
  modify: ModifyStageChannel,
) -> ModifyStageChannel
pub fn delete_stage_instance_request(
  token token: Token,
  in_channel_with_id channel_id: Snowflake(StageChannel),
) -> request.Request(String)
pub fn delete_stage_instance_response(
  response: response.Response(String),
) -> Result(Nil, RestError)
pub fn delete_text_channel_rate_limit_per_user(
  modify: ModifyTextChannel,
) -> ModifyTextChannel

AKA remove slowmode.

pub fn delete_text_channel_topic(
  modify: ModifyTextChannel,
) -> ModifyTextChannel
pub fn delete_voice_channel_rate_limit_per_user(
  modify: ModifyVoiceChannel,
) -> ModifyVoiceChannel
pub fn developer_team_member_decoder() -> decode.Decoder(
  DeveloperTeamMember,
)
pub fn developer_team_member_role_decoder() -> decode.Decoder(
  DeveloperTeamMemberRole,
)
pub fn disable_current_application_webhook_events(
  modify: ModifyCurrentApplication,
) -> ModifyCurrentApplication
pub fn disable_guild_dms(
  modify: ModifyGuildIncidentsData,
  until timestamp: timestamp.Timestamp,
) -> ModifyGuildIncidentsData

Disable DMs between guild members as a response to an incident.

You can only disable DMs for up to 24 hours.

pub fn disable_guild_invites(
  modify: ModifyGuildIncidentsData,
  until timestamp: timestamp.Timestamp,
) -> ModifyGuildIncidentsData

Disable invites in response to an incident.

You can only disable invites for up to 24 hours.

pub fn disable_guild_premium_progress_bar(
  modify: ModifyGuild,
) -> ModifyGuild
pub fn disconnect_guild_member(
  modify: ModifyGuildMember,
) -> ModifyGuildMember

Requires the AllowMovingMembersBetweenVoiceChannels permission and the AllowConnectingToVoiceChannels permission for that voice channel.

Will return a bad request if the user is not in a voice channel.

pub fn dm_channel_decoder() -> decode.Decoder(DmChannel)
pub fn duration_to_json_hours(
  duration: duration.Duration,
) -> json.Json
pub fn duration_to_json_seconds(
  duration: duration.Duration,
) -> json.Json
pub fn embed_author_decoder() -> decode.Decoder(EmbedAuthor)
pub fn embed_field_decoder() -> decode.Decoder(EmbedField)
pub fn embed_footer_decoder() -> decode.Decoder(EmbedFooter)
pub fn embed_image_decoder() -> decode.Decoder(EmbedImage)
pub fn embed_type_decoder() -> decode.Decoder(EmbedType)
pub fn embed_video_decoder() -> decode.Decoder(EmbedVideo)
pub fn emoji_decoder() -> decode.Decoder(Emoji)
pub fn enable_current_application_webhook_events(
  modify: ModifyCurrentApplication,
) -> ModifyCurrentApplication
pub fn enable_guild_dms(
  modify: ModifyGuildIncidentsData,
) -> ModifyGuildIncidentsData

Enable DMs between guild members after they were disabled in response to an incident.

pub fn enable_guild_invites(
  modify: ModifyGuildIncidentsData,
) -> ModifyGuildIncidentsData

Enable guild invites after they were disabled in response to an incident.

pub fn enable_guild_premium_progress_bar(
  modify: ModifyGuild,
) -> ModifyGuild
pub fn end_poll_request(
  token token: Token,
  in_channel_with_id channel_id: Snowflake(Channel),
  for_message_with_id message_id: Snowflake(Message),
) -> request.Request(String)

You cannot end other users’ polls.

pub fn end_poll_response(
  response: response.Response(String),
) -> Result(Message, RestError)
pub fn entitlement_decoder() -> decode.Decoder(Entitlement)
pub fn entitlement_holder_decoder() -> decode.Decoder(
  EntitlementHolder,
)
pub fn entitlement_type_decoder() -> decode.Decoder(
  EntitlementType,
)
pub fn error_code_decoder() -> decode.Decoder(ErrorCode)
pub fn error_item_decoder() -> decode.Decoder(ErrorItem)
pub fn error_node_decoder() -> decode.Decoder(ErrorNode)
pub fn executed_channel_select_decoder() -> decode.Decoder(
  ExecutedChannelSelect,
)
pub fn executed_command_data_decoder() -> decode.Decoder(
  ExecutedCommandData,
)
pub fn executed_command_decoder() -> decode.Decoder(
  ExecutedCommand,
)
pub fn executed_string_select_decoder() -> decode.Decoder(
  ExecutedStringSelect,
)
pub fn file_upload_filter_decoder() -> decode.Decoder(
  FileUploadFilter,
)
pub fn file_upload_filter_to_json(
  filter: FileUploadFilter,
) -> json.Json
pub fn float_slash_command_option_choice_to_json(
  choice: FloatSlashCommandOptionChoice,
) -> json.Json
pub fn float_slash_command_option_decoder() -> decode.Decoder(
  FloatSlashCommandOption,
)
pub fn float_slash_command_option_to_json(
  option: FloatSlashCommandOption,
) -> json.Json
pub fn follow_announcement_channel_request(
  token token: Token,
  source_channel_id source_id: Snowflake(AnnouncementChannel),
  target_channel_id target_id: Snowflake(TextChannel),
  reason reason: option.Option(String),
) -> request.Request(String)

Requires the AllowManagingWebhooks permission.

pub fn follow_announcement_channel_response(
  response: response.Response(String),
) -> Result(FollowedChannel, RestError)
pub fn followed_channel_decoder() -> decode.Decoder(
  FollowedChannel,
)
pub fn followup_to_interaction_response_request(
  token token: Token,
  current_application_id application_id: Snowflake(Application),
  interaction_token interaction_token: InteractionToken,
  with message: InteractionResponseMessage,
) -> request.Request(BitArray)

Creates a reply to the original interaction response.

IMPORTANT: If you deferred the interaction’s response and didn’t modify the deferred response, this endpoint will modify the original interaction response. This behaviour is deprecated, use modify_original_interaction_response_request if you don’t want to create a followup reply.

pub fn followup_to_interaction_response_response(
  response: response.Response(BitArray),
) -> Result(Message, RestError)
pub fn forum_channel_decoder() -> decode.Decoder(ForumChannel)
pub fn forum_layout_decoder() -> decode.Decoder(ForumLayout)
pub fn forum_layout_to_json(layout: ForumLayout) -> json.Json
pub fn forum_sort_order_decoder() -> decode.Decoder(
  ForumSortOrder,
)
pub fn forum_sort_order_to_json(
  order: ForumSortOrder,
) -> json.Json
pub fn forum_tag_decoder() -> decode.Decoder(ForumTag)
pub fn forum_tag_emoji_to_json(
  emoji: ForumTagEmoji,
) -> #(String, json.Json)
pub fn forum_tag_to_json(forum_tag: ForumTag) -> json.Json
pub fn get_all_active_threads_request(
  token token: Token,
  for_guild_with_id guild_id: Snowflake(Guild),
) -> request.Request(String)
pub fn get_all_active_threads_response(
  response: response.Response(String),
) -> Result(GetAllActiveGuildThreadsResponse, RestError)
pub fn get_application_asset_image_request(
  id application_id: Snowflake(Application),
  hash asset_hash: ImageHash,
  format format: RequestedApplicationAssetFormat,
  size size: RequestedImageSize,
) -> request.Request(BitArray)
pub fn get_application_cover_image_request(
  id application_id: Snowflake(Application),
  hash cover_hash: ImageHash,
  format format: RequestedApplicationCoverFormat,
  size size: RequestedImageSize,
) -> request.Request(BitArray)
pub fn get_application_icon_image_request(
  id application_id: Snowflake(Application),
  hash icon_hash: ImageHash,
  format format: RequestedApplicationIconFormat,
  size size: RequestedImageSize,
) -> request.Request(BitArray)
pub fn get_application_skus_request(
  token token: Token,
  application_with_id application_id: Snowflake(Application),
) -> request.Request(String)
pub fn get_application_skus_response(
  response: response.Response(String),
) -> Result(List(Sku), RestError)
pub fn get_avatar_decoration_image_request(
  hash image_hash: ImageHash,
  size size: RequestedImageSize,
) -> request.Request(BitArray)

Returns the image in PNG format.

pub fn get_burst_reacting_users(
  options: GetReactingUsersOptions,
) -> GetReactingUsersOptions

Will ONLY return burst reacting users.

pub fn get_channel_pins_before(
  options: GetChannelPinsOptions,
  timestamp timestamp: timestamp.Timestamp,
) -> GetChannelPinsOptions
pub fn get_channel_pins_request(
  token token: Token,
  channel_with_id channel_id: Snowflake(GuildChannel),
  using options: GetChannelPinsOptions,
) -> request.Request(String)

Requires the AllowViewingChannels permission.

Soft fails (returns 0 pins) if missing the AllowReadingMessageHistory permission.

pub fn get_channel_pins_response(
  response: response.Response(String),
) -> Result(GetChannelPinsResponse, RestError)
pub fn get_channel_pins_response_decoder() -> decode.Decoder(
  GetChannelPinsResponse,
)
pub fn get_channel_pins_with_limit(
  options: GetChannelPinsOptions,
  limit: Int,
) -> GetChannelPinsOptions
pub fn get_channel_request(
  token token: Token,
  with_id channel_id: Snowflake(Channel),
) -> request.Request(String)
pub fn get_channel_response(
  response: response.Response(String),
) -> Result(Channel, RestError)
pub fn get_creation_timestamp(
  of snowflake: Snowflake(a),
) -> timestamp.Timestamp
pub fn get_current_application_entitlements_before(
  options: GetCurrentApplicationEntitlementsOptions,
  entitlement_with_id before: Snowflake(Entitlement),
) -> GetCurrentApplicationEntitlementsOptions
pub fn get_current_application_entitlements_for_guild(
  options: GetCurrentApplicationEntitlementsOptions,
  guild_with_id guild_id: Snowflake(Guild),
) -> GetCurrentApplicationEntitlementsOptions
pub fn get_current_application_entitlements_for_skus(
  options: GetCurrentApplicationEntitlementsOptions,
  skus_with_ids sku_ids: List(Snowflake(Sku)),
) -> GetCurrentApplicationEntitlementsOptions
pub fn get_current_application_entitlements_request(
  token token: Token,
  current_application_id application_id: Snowflake(Application),
  using options: GetCurrentApplicationEntitlementsOptions,
) -> request.Request(String)

You have to provide the current application’s ID. Sorry, I don’t make the rules :/

pub fn get_current_application_entitlements_response(
  response: response.Response(String),
) -> Result(List(Entitlement), RestError)
pub fn get_current_application_entitlements_with_limit(
  options: GetCurrentApplicationEntitlementsOptions,
  limit: Int,
) -> GetCurrentApplicationEntitlementsOptions

Limit must be between 1 and 100.

pub fn get_current_application_request(
  token token: Token,
) -> request.Request(String)
pub fn get_current_application_response(
  response: response.Response(String),
) -> Result(Application, RestError)
pub fn get_current_user_as_guild_member_request(
  token token: Token,
  for_guild_with_id guild_id: Snowflake(Guild),
) -> request.Request(String)
pub fn get_current_user_as_guild_member_response(
  response: response.Response(String),
) -> Result(GuildMember, RestError)
pub fn get_current_user_request(
  token token: Token,
) -> request.Request(String)
pub fn get_current_user_response(
  response: response.Response(String),
) -> Result(User, RestError)
pub fn get_current_user_voice_state_request(
  token token: Token,
  in_guild_with_id guild_id: Snowflake(Guild),
) -> request.Request(String)
pub fn get_current_user_voice_state_response(
  response: response.Response(String),
) -> Result(VoiceState, RestError)
pub fn get_custom_emoji_image_request(
  id emoji_id: Snowflake(Emoji),
  format format: RequestedCustomEmojiFormat,
) -> request.Request(BitArray)

It is recommended to use the WebP format.

Emojis can be uploaded as PNG, JPEG, WebP, GIF, or AVIF.

Other formats don’t convert well to formats other than WebP.

pub fn get_default_soundboard_sounds_request(
  token token: Token,
) -> request.Request(String)
pub fn get_default_soundboard_sounds_response(
  response: response.Response(String),
) -> Result(List(SoundboardSound), RestError)
pub fn get_developer_team_icon_image_request(
  id developer_team_id: Snowflake(DeveloperTeam),
  hash image_hash: ImageHash,
  format format: RequestedDeveloperTeamFormat,
  size size: RequestedImageSize,
) -> request.Request(BitArray)
pub fn get_entitlement_request(
  token token: Token,
  current_application_id application_id: Snowflake(Application),
  entitlement_with_id entitlement_id: Snowflake(Entitlement),
) -> request.Request(String)

You have to provide the current application’s ID. Sorry, I don’t make the rules :/

pub fn get_entitlement_response(
  response: response.Response(String),
) -> Result(Entitlement, RestError)
pub fn get_everyone_role_id(
  of_guild_with_id id: Snowflake(Guild),
) -> Snowflake(Role)

Returns the ID of the @everyone role for a specific guild.

pub fn get_global_command_request(
  token: Token,
  current_application_id application_id: Snowflake(Application),
  command_id command_id: Snowflake(Command),
) -> request.Request(String)

You can only get commands that belong to the current application.

pub fn get_global_command_response(
  response: response.Response(String),
) -> Result(Command, RestError)
pub fn get_global_commands_request(
  token token: Token,
  current_application_id application_id: Snowflake(Application),
  with_localizations with_localizations: Bool,
) -> request.Request(String)
pub fn get_global_commands_response(
  response: response.Response(String),
) -> Result(List(Command), RestError)
pub fn get_guild_ban_request(
  token token: Token,
  of_user_with_id user_id: Snowflake(Guild),
  for_guild_with_id guild_id: Snowflake(Guild),
) -> request.Request(String)

Requires the AllowBanningMembers permission.

pub fn get_guild_ban_response(
  response: response.Response(String),
) -> Result(GuildBan, RestError)
pub fn get_guild_banner_image_request(
  id guild_id: Snowflake(Guild),
  hash banner_hash: ImageHash,
  format format: RequestedGuildBannerFormat,
  size size: RequestedImageSize,
) -> request.Request(BitArray)
pub fn get_guild_bans_after_id(
  options: GetGuildBansOptions,
  id: Snowflake(User),
) -> GetGuildBansOptions

Used for pagination. The parameter should be the highest user ID in the previous page.

pub fn get_guild_bans_before_id(
  options: GetGuildBansOptions,
  id: Snowflake(User),
) -> GetGuildBansOptions

Used for pagination. Takes priority over get_guild_bans_after_id.

pub fn get_guild_bans_request(
  token token: Token,
  for_guild_with_id guild_id: Snowflake(Guild),
  options options: option.Option(GetGuildBansOptions),
) -> request.Request(String)

Requires the AllowBanningMembers permission.

pub fn get_guild_bans_response(
  response: response.Response(String),
) -> Result(List(GuildBan), RestError)
pub fn get_guild_bans_with_limit(
  options: GetGuildBansOptions,
  limit: Int,
) -> GetGuildBansOptions

Between 1-1000 bans.

pub fn get_guild_channel_invites_request(
  token token: Token,
  channel_with_id id: Snowflake(GuildChannel),
) -> request.Request(String)

Requires the AllowManagingChannels permission.

pub fn get_guild_channel_invites_response(
  response: response.Response(String),
) -> Result(List(Invite), RestError)
pub fn get_guild_channels_request(
  token token: Token,
  guild_id guild_id: Snowflake(Guild),
) -> request.Request(String)

Returns all the channels of a guild, excluding threads.

pub fn get_guild_channels_response(
  response: response.Response(String),
) -> Result(List(GuildChannel), RestError)
pub fn get_guild_command_request(
  token token: Token,
  current_application_id application_id: Snowflake(Application),
  guild_id guild_id: Snowflake(Guild),
  command_with_id command_id: Snowflake(Command),
) -> request.Request(String)
pub fn get_guild_command_response(
  response: response.Response(String),
) -> Result(Command, RestError)
pub fn get_guild_commands_request(
  token token: Token,
  current_application_id application_id: Snowflake(Application),
  guild_id guild_id: Snowflake(Guild),
  with_localizations with_localizations: Bool,
) -> request.Request(String)
pub fn get_guild_commands_response(
  response: response.Response(String),
) -> Result(List(Command), RestError)
pub fn get_guild_discovery_splash_image_request(
  id guild_id: Snowflake(Guild),
  hash discovery_splash_hash: ImageHash,
  format format: RequestedGuildDiscoverySplashFormat,
  size size: RequestedImageSize,
) -> request.Request(BitArray)
pub fn get_guild_icon_image_request(
  id guild_id: Snowflake(Guild),
  hash icon_hash: ImageHash,
  format format: RequestedGuildIconFormat,
  size size: RequestedImageSize,
) -> request.Request(BitArray)
pub fn get_guild_integrations_request(
  token token: Token,
  for_guild_with_id guild_id: Snowflake(Guild),
) -> request.Request(String)

Requires the AllowManagingGuild permission.

Returns a maximum of 50 integrations. If a guild has more, they cannot be accessed.

pub fn get_guild_integrations_response(
  response: response.Response(String),
) -> Result(List(GuildIntegration), RestError)
pub fn get_guild_invites_request(
  token token: Token,
  for_guild_with_id guild_id: Snowflake(Guild),
) -> request.Request(String)

Requires the AllowManagingGuild or AllowViewingAuditLog permission.

Will include metadata with the AllowManagingGuild permission.

pub fn get_guild_invites_response(
  response: response.Response(String),
) -> Result(List(Invite), RestError)
pub fn get_guild_member_avatar_image_request(
  user_id user_id: Snowflake(GuildMember),
  guild_id guild_id: Snowflake(Guild),
  hash avatar_hash: ImageHash,
  format format: RequestedGuildMemberAvatarFormat,
  size size: RequestedImageSize,
) -> request.Request(BitArray)

Returns the guild-specific avatar of the user.

pub fn get_guild_member_banner_image_request(
  user_id user_id: Snowflake(GuildMember),
  guild_id guild_id: Snowflake(Guild),
  hash banner_hash: ImageHash,
  format format: RequestedGuildMemberBannerFormat,
  size size: RequestedImageSize,
) -> request.Request(BitArray)

Returns the guild-specific banner of the user.

pub fn get_guild_member_request(
  token token: Token,
  with_id user_id: Snowflake(User),
  in_guild_with_id guild_id: Snowflake(Guild),
) -> request.Request(String)
pub fn get_guild_member_response(
  response: response.Response(String),
) -> Result(GuildMember, RestError)
pub fn get_guild_members_after_id(
  options: GetGuildMembersOptions,
  id: Snowflake(User),
) -> GetGuildMembersOptions

Used for pagination. The parameter should be the highest user ID in the previous page.

pub fn get_guild_members_request(
  token token: Token,
  for_guild_with_id guild_id: Snowflake(Guild),
  options options: option.Option(GetGuildMembersOptions),
) -> request.Request(String)

Requires the GUILD_MEMBERS privileged intent.

By default, will return one member. The maximum limit is 1000.

pub fn get_guild_members_response(
  response: response.Response(String),
) -> Result(List(GuildMember), RestError)
pub fn get_guild_members_with_limit(
  options: GetGuildMembersOptions,
  limit: Int,
) -> GetGuildMembersOptions

The maximum limit is 1000 members. The API will not return more than that.

pub fn get_guild_onboarding_request(
  token token: Token,
  for_guild_with_id guild_id: Snowflake(Guild),
) -> request.Request(String)
pub fn get_guild_onboarding_response(
  response: response.Response(String),
) -> Result(GuildOnboarding, RestError)
pub fn get_guild_preview_request(
  token token: Token,
  id id: Snowflake(Guild),
) -> request.Request(String)

Returns a guild preview object. Is useful for receiving information about discoverable guilds, when the current user isn’t a member of one of those guilds.

pub fn get_guild_preview_response(
  response: response.Response(String),
) -> Result(GuildPreview, RestError)
pub fn get_guild_prunable_count_request(
  token token: Token,
  for_guild_with_id guild_id: Snowflake(Guild),
  required_inactive_days days: Int,
  include_roles_with_ids include_roles: List(Snowflake(Role)),
) -> request.Request(String)

Requires the AllowManagingGuild and AllowKickingMembers permissions.

Returns the amount of members that would be kicked if a prune starts.

Pruning will, by default, only kick members with no roles. Include any roles which you count as prunable.

The minimum number of days is 1 and the maximum number of days is 30. Numbers not within these bounds will return the closest result (1 or 30 days)

pub fn get_guild_prunable_count_response(
  response: response.Response(String),
) -> Result(Int, RestError)
pub fn get_guild_request(
  token token: Token,
  id id: Snowflake(Guild),
) -> request.Request(String)
pub fn get_guild_response(
  response: response.Response(String),
) -> Result(Guild, RestError)
pub fn get_guild_roles_request(
  token token: Token,
  of_guild_with_id guild_id: Snowflake(Guild),
) -> request.Request(String)
pub fn get_guild_roles_response(
  response: response.Response(String),
) -> Result(List(Role), RestError)
pub fn get_guild_soundboard_sound_request(
  token token: Token,
  for_guild_with_id guild_id: Snowflake(Guild),
  sound_with_id sound_id: Snowflake(SoundboardSound),
) -> request.Request(String)

Includes the creator field if the current user has the AllowCreatingGuildExpressions or AllowManagingGuildExpressions permission.

pub fn get_guild_soundboard_sound_response(
  response: response.Response(String),
) -> Result(SoundboardSound, RestError)
pub fn get_guild_soundboard_sounds_request(
  token token: Token,
  for_guild_with_id guild_id: Snowflake(Guild),
) -> request.Request(String)

Includes the creator field if the current user has the AllowCreatingGuildExpressions or AllowManagingGuildExpressions permission.

pub fn get_guild_soundboard_sounds_response(
  response: response.Response(String),
) -> Result(List(SoundboardSound), RestError)
pub fn get_guild_splash_image_request(
  id guild_id: Snowflake(Guild),
  hash splash_hash: ImageHash,
  format format: RequestedGuildSplashFormat,
  size size: RequestedImageSize,
) -> request.Request(BitArray)
pub fn get_guild_sticker_request(
  token token: Token,
  for_guild_with_id guild_id: Snowflake(Guild),
  sticker_with_id sticker_id: Snowflake(Sticker),
) -> request.Request(String)

The returned sticker will contain the user field if the bot has the AllowCreatingGuildExpressions or AllowManagingGuildExpressions permission.

pub fn get_guild_sticker_response(
  response: response.Response(String),
) -> Result(GuildSticker, RestError)
pub fn get_guild_stickers_request(
  token token: Token,
  for_guild_with_id guild_id: Snowflake(Guild),
) -> request.Request(String)

The returned stickers will contain the user field if the bot has the AllowCreatingGuildExpressions or AllowManagingGuildExpressions permission.

pub fn get_guild_stickers_response(
  response: response.Response(String),
) -> Result(List(GuildSticker), RestError)
pub fn get_guild_tag_badge_image_request(
  guild_id guild_id: Snowflake(Guild),
  hash badge_hash: ImageHash,
  format format: RequestedGuildTagBadgeFormat,
  size size: RequestedImageSize,
) -> request.Request(BitArray)
pub fn get_guild_vanity_invite_request(
  token token: Token,
  for_guild_with_id guild_id: Snowflake(Guild),
) -> request.Request(String)

Requires the AllowManagingGuild permission.

Use Guild.vanity_url_code to get the vanity URL code without this permission.

This endpoint is only necessary to get the use count. Returns Ok(None) if the guild can have a vanity URL but doesn’t.

pub fn get_guild_vanity_invite_response(
  response: response.Response(String),
) -> Result(option.Option(GuildVanityInvite), RestError)
pub fn get_guild_voice_regions_request(
  token token: Token,
  for_guild_with_id guild_id: Snowflake(Guild),
) -> request.Request(String)

Unlike the similar get_voice_regions_request, this returns VIP regions if the guild is VIP-enabled.

pub fn get_guild_voice_regions_response(
  response: response.Response(String),
) -> Result(List(VoiceRegion), RestError)
pub fn get_guild_welcome_screen_request(
  token token: Token,
  for_guild_with_id guild_id: Snowflake(Guild),
) -> request.Request(String)

Requires the AllowManagingGuild permission if the welcome screen is disabled.

pub fn get_guild_welcome_screen_response(
  response: response.Response(String),
) -> Result(GuildWelcomeScreen, RestError)
pub fn get_guild_widget_request(
  token token: Token,
  for_guild_with_id guild_id: Snowflake(Guild),
) -> request.Request(String)

Useful for creating custom website widgets.

pub fn get_guild_widget_response(
  response: response.Response(String),
) -> Result(GuildWidget, RestError)
pub fn get_guild_widget_settings_request(
  token token: Token,
  for_guild_with_id guild_id: Snowflake(Guild),
) -> request.Request(String)

Requires the AllowManagingGuild permission.

pub fn get_guild_widget_settings_response(
  response: response.Response(String),
) -> Result(GuildWidgetSettings, RestError)
pub fn get_guild_with_counts(
  token token: Token,
  id id: Snowflake(Guild),
) -> request.Request(String)

Returns a guild object along with its approximate member and presence counts.

pub fn get_guild_with_counts_response(
  response: response.Response(String),
) -> Result(#(Guild, GuildApproximateCounts), RestError)
pub fn get_interaction_response_followup_message_request(
  token token: Token,
  current_application_id application_id: Snowflake(Application),
  interaction_token interaction_token: InteractionToken,
  message_id message_id: Snowflake(Message),
) -> request.Request(String)
pub fn get_interaction_response_followup_message_response(
  response: response.Response(String),
) -> Result(Message, RestError)
pub fn get_invite_request(
  token token: Token,
  invite_with_code code: String,
) -> request.Request(String)
pub fn get_invite_response(
  response: response.Response(String),
) -> Result(Invite, RestError)
pub fn get_invite_with_counts_request(
  token token: Token,
  invite_with_code code: String,
) -> request.Request(String)
pub fn get_invite_with_counts_response(
  response: response.Response(String),
) -> Result(#(Invite, GuildApproximateCounts), RestError)
pub fn get_message_request(
  token token: Token,
  channel_with_id channel_id: Snowflake(Channel),
  message_with_id message_id: Snowflake(Message),
) -> request.Request(String)

Behavior:

  • in DM channels - must be a DM channel between the bot and another user
  • in guild channels - the bot must have the AllowViewingChannels and AllowReadingMessageHistory permissions in that channel
  • in voice channels - in addition to the aforementioned permissions, the bot must also have the AllowConnectingToVoiceChannels permission in that channel
pub fn get_message_response(
  response: response.Response(String),
) -> Result(Message, RestError)
pub fn get_original_interaction_response_request(
  token token: Token,
  current_application_id application_id: Snowflake(Application),
  interaction_token interaction_token: InteractionToken,
) -> request.Request(String)
pub fn get_original_interaction_response_response(
  response: response.Response(String),
) -> Result(Message, RestError)
pub fn get_poll_answer_voters_request(
  token token: Token,
  in_channel_with_id channel_id: Snowflake(Channel),
  for_message_with_id message_id: Snowflake(Message),
  answer_with_id answer_id: Int,
  using options: GetPollAnswerVotersOptions,
) -> request.Request(String)

Get a list of users who voted for a specific poll answer.

pub fn get_poll_answer_voters_response(
  response: response.Response(String),
) -> Result(List(User), RestError)
pub fn get_poll_answer_voters_with_limit(
  options: GetPollAnswerVotersOptions,
  limit: Int,
) -> GetPollAnswerVotersOptions

Limit must be between 1 and 100.

pub fn get_reacting_users_after(
  options: GetReactingUsersOptions,
  id id: Snowflake(User),
) -> GetReactingUsersOptions
pub fn get_reacting_users_request(
  token token: Token,
  in_channel_with_id channel_id: Snowflake(Channel),
  from_message_with_id message_id: Snowflake(Message),
  emoji emoji: MessageReactionEmoji,
  using options: GetReactingUsersOptions,
) -> request.Request(String)
pub fn get_reacting_users_response(
  response: response.Response(String),
) -> Result(List(User), RestError)
pub fn get_reacting_users_with_limit(
  options: GetReactingUsersOptions,
  limit: Int,
) -> GetReactingUsersOptions

Limit must be between 1 and 100.

pub fn get_role_member_counts_request(
  token token: Token,
  for_guild_with_id guild_id: Snowflake(Guild),
) -> request.Request(String)

Returns a Dict of (role_id, member_count)

pub fn get_role_member_counts_response(
  response: response.Response(String),
) -> Result(dict.Dict(Snowflake(Role), Int), RestError)
pub fn get_role_request(
  token token: Token,
  with_id role_id: Snowflake(Role),
  from_guild_with_id guild_id: Snowflake(Guild),
) -> request.Request(String)
pub fn get_role_response(
  response: response.Response(String),
) -> Result(Role, RestError)
pub fn get_scheduled_event_cover_image_request(
  id scheduled_event_id: Snowflake(ScheduledEvent),
  hash cover_hash: ImageHash,
  format format: RequestedScheduledEventCoverFormat,
  size size: RequestedImageSize,
) -> request.Request(BitArray)
pub fn get_sku_subscription_request(
  token token: Token,
  for_sku_with_id sku_id: Snowflake(Sku),
  subscription_with_id subscription_id: Snowflake(Subscription),
) -> request.Request(String)
pub fn get_sku_subscription_response(
  response: response.Response(String),
) -> Result(Subscription, RestError)
pub fn get_sku_subscriptions_after(
  options: GetSkuSubscriptionsOptions,
  subscription_with_id after: Snowflake(Subscription),
) -> GetSkuSubscriptionsOptions
pub fn get_sku_subscriptions_before(
  options: GetSkuSubscriptionsOptions,
  subscription_with_id before: Snowflake(Subscription),
) -> GetSkuSubscriptionsOptions
pub fn get_sku_subscriptions_request(
  token token: Token,
  for_sku_with_id sku_id: Snowflake(Sku),
  using options: GetSkuSubscriptionsOptions,
) -> request.Request(String)
pub fn get_sku_subscriptions_response(
  response: response.Response(String),
) -> Result(List(Subscription), RestError)
pub fn get_sku_subscriptions_with_limit(
  options: GetSkuSubscriptionsOptions,
  limit: Int,
) -> GetSkuSubscriptionsOptions

Limit must be between 1 and 100.

pub fn get_stage_channel_response(
  response: response.Response(String),
) -> Result(StageInstance, RestError)
pub fn get_stage_instance_request(
  token token: Token,
  for_channel_with_id channel_id: Snowflake(StageChannel),
) -> request.Request(String)

Returns the stage instance for the stage channel, if it exists.

pub fn get_sticker_image_request(
  id sticker_id: Snowflake(Sticker),
  format format: RequestedStickerFormat,
) -> request.Request(BitArray)

The sticker is only available in the format it was uploaded in.

pub fn get_sticker_pack_banner_image_request(
  id sticker_pack_banner_id: Snowflake(StickerPackBanner),
  format format: RequestedStickerPackBannerFormat,
  size size: RequestedImageSize,
) -> request.Request(BitArray)
pub fn get_sticker_pack_request(
  token token: Token,
  pack_with_id pack_id: Snowflake(StickerPack),
) -> request.Request(String)
pub fn get_sticker_pack_response(
  response: response.Response(String),
) -> Result(StickerPack, RestError)
pub fn get_sticker_packs_request(
  token token: Token,
) -> request.Request(String)
pub fn get_sticker_packs_response(
  response: response.Response(String),
) -> Result(List(StickerPack), RestError)
pub fn get_sticker_request(
  token token: Token,
  sticker_with_id sticker_id: Snowflake(Sticker),
) -> request.Request(String)
pub fn get_sticker_response(
  response: response.Response(String),
) -> Result(Sticker, RestError)
pub fn get_thread_member_request(
  token token: Token,
  thread_with_id thread_id: Snowflake(Thread),
  member_with_id member_id: Snowflake(User),
) -> request.Request(String)
pub fn get_thread_member_response(
  response: response.Response(String),
) -> Result(ThreadMember, RestError)
pub fn get_thread_member_with_guild_member_request(
  token token: Token,
  thread_with_id thread_id: Snowflake(Thread),
  member_with_id member_id: Snowflake(User),
) -> request.Request(String)
pub fn get_thread_member_with_guild_member_response(
  response: response.Response(String),
) -> Result(#(ThreadMember, GuildMember), RestError)
pub fn get_thread_members_request(
  token token: Token,
  thread_with_id thread_id: Snowflake(Thread),
) -> request.Request(String)

Requires that your app has the GUILD_MEMBERS priviledged intent enabled.

pub fn get_thread_members_response(
  response: response.Response(String),
) -> Result(List(ThreadMember), RestError)
pub fn get_url_to_attachment(named filename: String) -> String

Include the extension in the file name.

pub fn get_user_avatar_image_request(
  id user_id: Snowflake(User),
  hash avatar_hash: ImageHash,
  format format: RequestedUserAvatarFormat,
  size size: RequestedImageSize,
) -> request.Request(BitArray)
pub fn get_user_banner_image_request(
  id user_id: Snowflake(User),
  hash banner_hash: ImageHash,
  format format: RequestedUserBannerFormat,
  size size: RequestedImageSize,
) -> request.Request(BitArray)
pub fn get_user_default_avatar_image_request(
  index index: Int,
) -> request.Request(BitArray)

Use the get_user_index function to get the index.

Returns the default avatar of the user (the one with the Discord logo) in PNG format, with constant size.

pub fn get_user_index(of user: User) -> Result(Int, Nil)

Used to get the default user avatar.

If it returns an error - you got lucky - the user still has a discriminator and it somehow isn’t an integer.

pub fn get_user_request(
  token token: Token,
  id id: Snowflake(User),
) -> request.Request(String)
pub fn get_user_response(
  response: response.Response(String),
) -> Result(User, RestError)
pub fn get_user_voice_state_request(
  token token: Token,
  in_guild_with_id guild_id: Snowflake(Guild),
  for_user_with_id user_id: Snowflake(User),
) -> request.Request(String)

If the user is connected to a voice channel, requires the AllowConnectingToVoiceChannels permission in that channel.

pub fn get_user_voice_state_response(
  response: response.Response(String),
) -> Result(VoiceState, RestError)
pub fn get_voice_regions_request(
  token token: Token,
) -> request.Request(String)
pub fn get_voice_regions_response(
  response: response.Response(String),
) -> Result(List(VoiceRegion), RestError)
pub fn guild_approximate_counts_decoder() -> decode.Decoder(
  GuildApproximateCounts,
)
pub fn guild_ban_decoder() -> decode.Decoder(GuildBan)
pub fn guild_channel_decoder() -> decode.Decoder(GuildChannel)
pub fn guild_decoder() -> decode.Decoder(Guild)
pub fn guild_default_message_notification_setting_to_json(
  setting: GuildDefaultMessageNotificationSetting,
) -> json.Json
pub fn guild_explicit_content_filter_setting_to_json(
  setting: GuildExplicitContentFilterSetting,
) -> json.Json
pub fn guild_feature_to_json(feature: GuildFeature) -> json.Json
pub fn guild_features_decoder() -> decode.Decoder(
  List(GuildFeature),
)
pub fn guild_incidents_data_decoder() -> decode.Decoder(
  GuildIncidentsData,
)
pub fn guild_integration_data_decoder() -> decode.Decoder(
  GuildIntegrationData,
)
pub fn guild_integration_decoder() -> decode.Decoder(
  GuildIntegration,
)
pub fn guild_member_decoder() -> decode.Decoder(GuildMember)
pub fn guild_member_verification_level_to_json(
  level: GuildMemberVerificationLevel,
) -> json.Json
pub fn guild_nsfw_level_decoder() -> decode.Decoder(
  GuildNsfwLevel,
)
pub fn guild_onboarding_decoder() -> decode.Decoder(
  GuildOnboarding,
)
pub fn guild_onboarding_mode_decoder() -> decode.Decoder(
  GuildOnboardingMode,
)
pub fn guild_onboarding_prompt_decoder() -> decode.Decoder(
  GuildOnboardingPrompt,
)
pub fn guild_premium_tier_decoder() -> decode.Decoder(
  GuildPremiumTier,
)
pub fn guild_preview_decoder() -> decode.Decoder(GuildPreview)
pub fn guild_required_mfa_level_decoder() -> decode.Decoder(
  GuildRequiredMfaLevel,
)
pub fn guild_social_integration_decoder() -> decode.Decoder(
  GuildSocialIntegration,
)
pub fn guild_sticker_decoder() -> decode.Decoder(GuildSticker)
pub fn guild_welcome_screen_channel_to_json(
  channel: GuildWelcomeScreenChannel,
) -> json.Json
pub fn guild_welcome_screen_decoder() -> decode.Decoder(
  GuildWelcomeScreen,
)
pub fn guild_widget_channel_decoder() -> decode.Decoder(
  GuildWidgetChannel,
)
pub fn guild_widget_decoder() -> decode.Decoder(GuildWidget)
pub fn guild_widget_settings_decoder() -> decode.Decoder(
  GuildWidgetSettings,
)
pub fn guild_widget_user_decoder() -> decode.Decoder(
  GuildWidgetUser,
)
pub fn hoist_role(modify: ModifyRole) -> ModifyRole

Makes the role separate from others in the sidebar.

pub fn image_data_from_bit_array(
  image data: BitArray,
  content_type content_type: ImageDataContentType,
) -> ImageData
pub fn image_data_to_json(image_data: ImageData) -> json.Json
pub fn image_hash_decoder() -> decode.Decoder(ImageHash)
pub fn image_hash_to_string(image_hash: ImageHash) -> String

Returns the image hash in string form.

pub fn image_message_attachment_decoder() -> decode.Decoder(
  ImageMessageAttachment,
)
pub fn int_slash_command_option_choice_to_json(
  choice: IntSlashCommandOptionChoice,
) -> json.Json
pub fn int_slash_command_option_decoder() -> decode.Decoder(
  IntSlashCommandOption,
)
pub fn int_slash_command_option_to_json(
  option: IntSlashCommandOption,
) -> json.Json
pub fn interaction_context_decoder() -> decode.Decoder(
  InteractionContext,
)
pub fn interaction_decoder() -> decode.Decoder(Interaction)
pub fn interaction_response_message_to_json(
  message: InteractionResponseMessage,
) -> json.Json
pub fn interaction_response_modal_to_json(
  modal: InteractionResponseModal,
) -> json.Json
pub fn interaction_token_decoder() -> decode.Decoder(
  InteractionToken,
)
pub fn invite_decoder() -> decode.Decoder(Invite)
pub fn invite_role_decoder() -> decode.Decoder(InviteRole)
pub fn invite_target_to_json(
  target: InviteTarget,
) -> List(Result(#(String, json.Json), Nil))
pub fn join_thread_request(
  token token: Token,
  thread_with_id id: Snowflake(Thread),
) -> request.Request(String)

The thread mustn’t be archived.

pub fn join_thread_response(
  response: response.Response(String),
) -> Result(Nil, RestError)
pub fn kick_guild_member_request(
  token token: Token,
  with_id user_id: Snowflake(User),
  from_guild_with_id guild_id: Snowflake(Guild),
  reason reason: option.Option(String),
) -> request.Request(String)

Requires the AllowKickingMembers permission

pub fn kick_guild_member_response(
  response: response.Response(String),
) -> Result(Nil, RestError)
pub fn leave_guild_request(
  token token: Token,
  guild_with_id guild_id: Snowflake(Guild),
) -> request.Request(String)
pub fn leave_guild_response(
  response: response.Response(String),
) -> Result(Nil, RestError)
pub fn leave_thread_request(
  token token: Token,
  thread_with_id id: Snowflake(Thread),
) -> request.Request(String)

The thread mustn’t be archived.

pub fn leave_thread_response(
  response: response.Response(String),
) -> Result(Nil, RestError)
pub fn link_button_decoder() -> decode.Decoder(LinkButton)
pub fn locale_decoder() -> decode.Decoder(Locale)
pub fn locale_to_json(locale: Locale) -> json.Json
pub fn locale_to_string(locale: Locale) -> String
pub fn lock_thread(modify: ModifyThread) -> ModifyThread

When a thread is locked, only users with the AllowManagingThreads permission can unarchive it.

pub fn media_channel_decoder() -> decode.Decoder(MediaChannel)
pub fn media_gallery_item_decoder() -> decode.Decoder(
  MediaGalleryItem,
)
pub fn mentionable_slash_command_option_to_json(
  option: MentionableSlashCommandOption,
) -> json.Json
pub fn message_action_row_decoder() -> decode.Decoder(
  MessageActionRow,
)
pub fn message_attachment_decoder() -> decode.Decoder(
  MessageAttachment,
)
pub fn message_call_decoder() -> decode.Decoder(MessageCall)
pub fn message_channel_select_decoder() -> decode.Decoder(
  MessageChannelSelect,
)
pub fn message_component_decoder() -> decode.Decoder(
  MessageComponent,
)
pub fn message_component_interaction_response_to_json(
  response: MessageComponentInteractionResponse,
) -> json.Json
pub fn message_container_decoder() -> decode.Decoder(
  MessageContainer,
)
pub fn message_decoder() -> decode.Decoder(Message)
pub fn message_embed_decoder() -> decode.Decoder(MessageEmbed)
pub fn message_file_decoder() -> decode.Decoder(MessageFile)
pub fn message_media_gallery_decoder() -> decode.Decoder(
  MessageMediaGallery,
)
pub fn message_nonce_decoder() -> decode.Decoder(MessageNonce)
pub fn message_nonce_to_json(nonce: MessageNonce) -> json.Json
pub fn message_pin_decoder() -> decode.Decoder(MessagePin)
pub fn message_reaction_decoder() -> decode.Decoder(
  MessageReaction,
)
pub fn message_reference_decoder() -> decode.Decoder(
  MessageReference,
)
pub fn message_reference_type_decoder() -> decode.Decoder(
  MessageReferenceType,
)
pub fn message_reference_type_to_json(
  type_: MessageReferenceType,
) -> json.Json
pub fn message_role_select_decoder() -> decode.Decoder(
  MessageRoleSelect,
)
pub fn message_separator_decoder() -> decode.Decoder(
  MessageSeparator,
)
pub fn message_snapshot_decoder() -> decode.Decoder(
  MessageSnapshot,
)
pub fn message_string_select_decoder() -> decode.Decoder(
  MessageStringSelect,
)
pub fn message_text_display_decoder() -> decode.Decoder(
  MessageTextDisplay,
)
pub fn message_thumbnail_decoder() -> decode.Decoder(
  MessageThumbnail,
)
pub fn message_type_decoder() -> decode.Decoder(MessageType)
pub fn message_user_select_decoder() -> decode.Decoder(
  MessageUserSelect,
)
pub fn modal_interaction_decoder() -> decode.Decoder(
  ModalInteraction,
)
pub fn modal_interaction_response_to_json(
  response: ModalInteractionResponse,
) -> json.Json
pub fn modal_interaction_token_decoder() -> decode.Decoder(
  ModalInteractionToken,
)
pub fn modify_announcement_channel_default_thread_auto_archive_duration(
  modify: ModifyAnnouncementChannel,
  new duration: ThreadAutoArchiveDuration,
) -> ModifyAnnouncementChannel
pub fn modify_announcement_channel_name(
  modify: ModifyAnnouncementChannel,
  new name: String,
) -> ModifyAnnouncementChannel
pub fn modify_announcement_channel_parent_id(
  modify: ModifyAnnouncementChannel,
  new parent_id: Snowflake(CategoryChannel),
) -> ModifyAnnouncementChannel
pub fn modify_announcement_channel_permission_overwrites(
  modify: ModifyAnnouncementChannel,
  new overwrites: List(PermissionOverwrite),
) -> ModifyAnnouncementChannel

You can only allow/deny permissions if your bot has those permissions. Setting the AllowManagingRoles permission requires your bot to have the AdministratorPermission.

pub fn modify_announcement_channel_position(
  modify: ModifyAnnouncementChannel,
  new position: Int,
) -> ModifyAnnouncementChannel

Channels with the same position are sorted by ID (newer channel will be lower)

pub fn modify_announcement_channel_request(
  token token: Token,
  channel_with_id id: Snowflake(AnnouncementChannel),
  using modify: ModifyAnnouncementChannel,
  reason reason: option.Option(String),
) -> request.Request(String)
pub fn modify_announcement_channel_response(
  response: response.Response(String),
) -> Result(AnnouncementChannel, RestError)

Use modify_announcement_channel_with_conversion_response if you converted the announcement channel into a text channel.

pub fn modify_announcement_channel_to_json(
  modify: ModifyAnnouncementChannel,
) -> json.Json
pub fn modify_announcement_channel_topic(
  modify: ModifyAnnouncementChannel,
  new topic: String,
) -> ModifyAnnouncementChannel
pub fn modify_announcement_channel_with_conversion_response(
  response: response.Response(String),
) -> Result(TextChannel, RestError)

Use this if you converted the announcement channel to a text channel.

pub fn modify_category_channel_name(
  modify: ModifyCategoryChannel,
  new name: String,
) -> ModifyCategoryChannel
pub fn modify_category_channel_permission_overwrites(
  modify: ModifyCategoryChannel,
  new overwrites: List(PermissionOverwrite),
) -> ModifyCategoryChannel

You can only allow/deny permissions if your bot has those permissions. Setting the AllowManagingRoles permission requires your bot to have the AdministratorPermission.

pub fn modify_category_channel_position(
  modify: ModifyCategoryChannel,
  new position: Int,
) -> ModifyCategoryChannel

Channels with the same position are sorted by ID (newer channel will be lower)

pub fn modify_category_channel_request(
  token token: Token,
  channel_with_id channel_id: Snowflake(CategoryChannel),
  using modify: ModifyCategoryChannel,
  reason reason: option.Option(String),
) -> request.Request(String)

Requires the AllowManagingChannels permission.

pub fn modify_category_channel_response(
  response: response.Response(String),
) -> Result(CategoryChannel, RestError)
pub fn modify_category_channel_to_json(
  modify: ModifyCategoryChannel,
) -> json.Json
pub fn modify_current_application_cover_image(
  modify: ModifyCurrentApplication,
  new cover_image: ImageData,
) -> ModifyCurrentApplication
pub fn modify_current_application_custom_installation_url(
  modify: ModifyCurrentApplication,
  new url: String,
) -> ModifyCurrentApplication
pub fn modify_current_application_description(
  modify: ModifyCurrentApplication,
  new description: String,
) -> ModifyCurrentApplication
pub fn modify_current_application_flags(
  modify: ModifyCurrentApplication,
  old old: List(ApplicationFlag),
  new_added new_added: List(ModifyCurrentApplicationFlag),
  new_removed new_removed: List(ModifyCurrentApplicationFlag),
) -> ModifyCurrentApplication

You need the message’s present (old) flags to modify them.

Removal takes prescedence over addition.

Trying to add an already present flag or remove an already absent one is a no-op.

pub fn modify_current_application_guild_installation_settings(
  modify: ModifyCurrentApplication,
  new settings: ApplicationInstallationSettings,
) -> ModifyCurrentApplication
pub fn modify_current_application_icon(
  modify: ModifyCurrentApplication,
  new icon: ImageData,
) -> ModifyCurrentApplication
pub fn modify_current_application_in_app_installation_settings(
  modify: ModifyCurrentApplication,
  new settings: ApplicationInstallationSettings,
) -> ModifyCurrentApplication
pub fn modify_current_application_interactions_endpoint_url(
  modify: ModifyCurrentApplication,
  new url: String,
) -> ModifyCurrentApplication
pub fn modify_current_application_request(
  token token: Token,
  using modify: ModifyCurrentApplication,
) -> request.Request(String)
pub fn modify_current_application_response(
  response: response.Response(String),
) -> Result(Application, RestError)
pub fn modify_current_application_role_connections_verification_url(
  modify: ModifyCurrentApplication,
  new url: String,
) -> ModifyCurrentApplication
pub fn modify_current_application_tags(
  modify: ModifyCurrentApplication,
  new tags: List(String),
) -> ModifyCurrentApplication
pub fn modify_current_application_to_json(
  modify: ModifyCurrentApplication,
) -> json.Json
pub fn modify_current_application_user_installation_settings(
  modify: ModifyCurrentApplication,
  new settings: ApplicationInstallationSettings,
) -> ModifyCurrentApplication
pub fn modify_current_application_webhook_events_types(
  modify: ModifyCurrentApplication,
  new types: List(String),
) -> ModifyCurrentApplication
pub fn modify_current_application_webhook_events_url(
  modify: ModifyCurrentApplication,
  new url: String,
) -> ModifyCurrentApplication
pub fn modify_current_guild_member_avatar(
  modify: ModifyCurrentGuildMember,
  new avatar: ImageData,
) -> ModifyCurrentGuildMember

Modifies your per-guild avatar.

pub fn modify_current_guild_member_banner(
  modify: ModifyCurrentGuildMember,
  new banner: ImageData,
) -> ModifyCurrentGuildMember

Modifies your per-guild banner.

pub fn modify_current_guild_member_bio(
  modify: ModifyCurrentGuildMember,
  new bio: String,
) -> ModifyCurrentGuildMember

Modifies your per-guild bio.

pub fn modify_current_guild_member_nick(
  modify: ModifyCurrentGuildMember,
  new nick: String,
) -> ModifyCurrentGuildMember

Requires the AllowChangingOwnNickname permission.

pub fn modify_current_guild_member_request(
  token token: Token,
  in_guild_with_id guild_id: Snowflake(Guild),
  using modify: ModifyCurrentGuildMember,
  reason reason: option.Option(String),
) -> request.Request(String)
pub fn modify_current_guild_member_response(
  response: response.Response(String),
) -> Result(GuildMember, RestError)
pub fn modify_current_guild_member_to_json(
  modify: ModifyCurrentGuildMember,
) -> json.Json
pub fn modify_current_user_avatar(
  modify: ModifyCurrentUser,
  new avatar: ImageData,
) -> ModifyCurrentUser
pub fn modify_current_user_banner(
  modify: ModifyCurrentUser,
  new banner: ImageData,
) -> ModifyCurrentUser
pub fn modify_current_user_request(
  token token: Token,
  using modify: ModifyCurrentUser,
) -> request.Request(String)
pub fn modify_current_user_response(
  response: response.Response(String),
) -> Result(User, RestError)
pub fn modify_current_user_to_json(
  modify: ModifyCurrentUser,
) -> json.Json
pub fn modify_current_user_username(
  modify: ModifyCurrentUser,
  new username: String,
) -> ModifyCurrentUser

May cause the discriminator to randomize if changed (mostly applies to bots).

pub fn modify_forum_channel_available_tags(
  modify: ModifyForumChannel,
  new tags: List(ForumTag),
) -> ModifyForumChannel
pub fn modify_forum_channel_default_layout(
  modify: ModifyForumChannel,
  new layout: ForumLayout,
) -> ModifyForumChannel
pub fn modify_forum_channel_default_reaction(
  modify: ModifyForumChannel,
  new reaction: DefaultForumReaction,
) -> ModifyForumChannel
pub fn modify_forum_channel_default_sort_order(
  modify: ModifyForumChannel,
  new order: ForumSortOrder,
) -> ModifyForumChannel
pub fn modify_forum_channel_default_thread_auto_archive_duration(
  modify: ModifyForumChannel,
  new duration: ThreadAutoArchiveDuration,
) -> ModifyForumChannel
pub fn modify_forum_channel_default_thread_rate_limit_per_user(
  modify: ModifyForumChannel,
  new limit: RateLimitPerUser,
) -> ModifyForumChannel
pub fn modify_forum_channel_flags(
  modify: ModifyForumChannel,
  new flags: List(ForumChannelFlag),
) -> ModifyForumChannel
pub fn modify_forum_channel_name(
  modify: ModifyForumChannel,
  new name: String,
) -> ModifyForumChannel
pub fn modify_forum_channel_parent_id(
  modify: ModifyForumChannel,
  new id: Snowflake(CategoryChannel),
) -> ModifyForumChannel
pub fn modify_forum_channel_permission_overwrites(
  modify: ModifyForumChannel,
  new overwrites: List(PermissionOverwrite),
) -> ModifyForumChannel

You can only allow/deny permissions if your bot has those permissions. Setting the AllowManagingRoles permission requires your bot to have the AdministratorPermission.

pub fn modify_forum_channel_position(
  modify: ModifyForumChannel,
  new position: Int,
) -> ModifyForumChannel
pub fn modify_forum_channel_rate_limit_per_user(
  modify: ModifyForumChannel,
  new limit: RateLimitPerUser,
) -> ModifyForumChannel
pub fn modify_forum_channel_request(
  token token: Token,
  channel_with_id channel_id: Snowflake(ForumChannel),
  using modify: ModifyForumChannel,
  reason reason: option.Option(String),
) -> request.Request(String)

Requires the AllowManagingChannels permission.

pub fn modify_forum_channel_response(
  response: response.Response(String),
) -> Result(ForumChannel, RestError)
pub fn modify_forum_channel_to_json(
  modify: ModifyForumChannel,
) -> json.Json
pub fn modify_forum_channel_topic(
  modify: ModifyForumChannel,
  new topic: String,
) -> ModifyForumChannel
pub fn modify_global_message_command() -> ModifyGlobalMessageCommand
pub fn modify_global_message_command_allowed_contexts(
  modify: ModifyGlobalMessageCommand,
  contexts: List(CommandContext),
) -> ModifyGlobalMessageCommand
pub fn modify_global_message_command_allowed_installation_types(
  modify: ModifyGlobalMessageCommand,
  new types: List(CommandInstallationType),
) -> ModifyGlobalMessageCommand
pub fn modify_global_message_command_name(
  modify: ModifyGlobalMessageCommand,
  new name: String,
) -> ModifyGlobalMessageCommand

Name must be between 1 and 32 characters.

pub fn modify_global_message_command_name_localizations(
  modify: ModifyGlobalMessageCommand,
  new localizations: dict.Dict(Locale, String),
) -> ModifyGlobalMessageCommand

Name must be between 1 and 32 characters.

pub fn modify_global_message_command_request(
  token token: Token,
  current_application_id application_id: Snowflake(Application),
  command_with_id command_id: Snowflake(MessageCommand),
  using modify: ModifyGlobalMessageCommand,
) -> request.Request(String)
pub fn modify_global_message_command_required_permissions(
  modify: ModifyGlobalMessageCommand,
  new permissions: List(Permission),
) -> ModifyGlobalMessageCommand

Use delete_global_message_command_required_permissions to enable the command for everyone.

Passing an empty list will disable the command for everyone.

Passing a list with at least one permission will require those permissions to use the command.

pub fn modify_global_message_command_response(
  response: response.Response(String),
) -> Result(MessageCommand, RestError)
pub fn modify_global_message_command_to_json(
  modify: ModifyGlobalMessageCommand,
) -> json.Json
pub fn modify_global_slash_command() -> ModifyGlobalSlashCommand
pub fn modify_global_slash_command_allowed_contexts(
  modify: ModifyGlobalSlashCommand,
  contexts: List(CommandContext),
) -> ModifyGlobalSlashCommand
pub fn modify_global_slash_command_allowed_installation_types(
  modify: ModifyGlobalSlashCommand,
  new types: List(CommandInstallationType),
) -> ModifyGlobalSlashCommand
pub fn modify_global_slash_command_description(
  modify: ModifyGlobalSlashCommand,
  new description: String,
) -> ModifyGlobalSlashCommand

Description must be between 1 and 100 characters.

pub fn modify_global_slash_command_description_localizations(
  modify: ModifyGlobalSlashCommand,
  new localizations: dict.Dict(Locale, String),
) -> ModifyGlobalSlashCommand

Description must be between 1 and 100 characters.

pub fn modify_global_slash_command_name(
  modify: ModifyGlobalSlashCommand,
  new name: String,
) -> ModifyGlobalSlashCommand

Name must be between 1 and 32 characters.

pub fn modify_global_slash_command_name_localizations(
  modify: ModifyGlobalSlashCommand,
  new localizations: dict.Dict(Locale, String),
) -> ModifyGlobalSlashCommand

Name must be between 1 and 32 characters.

pub fn modify_global_slash_command_options(
  modify: ModifyGlobalSlashCommand,
  new options: List(SlashCommandOption),
) -> ModifyGlobalSlashCommand

There is a limit of 25 options per command.

pub fn modify_global_slash_command_request(
  token token: Token,
  current_application_id application_id: Snowflake(Application),
  command_with_id command_id: Snowflake(SlashCommand),
  using modify: ModifyGlobalSlashCommand,
) -> request.Request(String)
pub fn modify_global_slash_command_required_permissions(
  modify: ModifyGlobalSlashCommand,
  new permissions: List(Permission),
) -> ModifyGlobalSlashCommand

Use delete_global_slash_command_required_permissions to enable the command for everyone.

Passing an empty list will disable the command for everyone.

Passing a list with at least one permission will require those permissions to use the command.

pub fn modify_global_slash_command_response(
  response: response.Response(String),
) -> Result(SlashCommand, RestError)
pub fn modify_global_slash_command_to_json(
  modify: ModifyGlobalSlashCommand,
) -> json.Json
pub fn modify_global_user_command() -> ModifyGlobalUserCommand
pub fn modify_global_user_command_allowed_contexts(
  modify: ModifyGlobalUserCommand,
  contexts: List(CommandContext),
) -> ModifyGlobalUserCommand
pub fn modify_global_user_command_allowed_installation_types(
  modify: ModifyGlobalUserCommand,
  new types: List(CommandInstallationType),
) -> ModifyGlobalUserCommand
pub fn modify_global_user_command_name(
  modify: ModifyGlobalUserCommand,
  new name: String,
) -> ModifyGlobalUserCommand

Name must be between 1 and 32 characters.

pub fn modify_global_user_command_name_localizations(
  modify: ModifyGlobalUserCommand,
  new localizations: dict.Dict(Locale, String),
) -> ModifyGlobalUserCommand

Name must be between 1 and 32 characters.

pub fn modify_global_user_command_request(
  token token: Token,
  current_application_id application_id: Snowflake(Application),
  command_with_id command_id: Snowflake(UserCommand),
  using modify: ModifyGlobalUserCommand,
) -> request.Request(String)
pub fn modify_global_user_command_required_permissions(
  modify: ModifyGlobalUserCommand,
  new permissions: List(Permission),
) -> ModifyGlobalUserCommand

Use delete_global_user_command_required_permissions to enable the command for everyone.

Passing an empty list will disable the command for everyone.

Passing a list with at least one permission will require those permissions to use the command.

pub fn modify_global_user_command_response(
  response: response.Response(String),
) -> Result(UserCommand, RestError)
pub fn modify_global_user_command_to_json(
  modify: ModifyGlobalUserCommand,
) -> json.Json
pub fn modify_guild_afk_channel(
  modify: ModifyGuild,
  new_id id: Snowflake(Channel),
) -> ModifyGuild
pub fn modify_guild_afk_timeout(
  modify: ModifyGuild,
  new timeout: AfkTimeout,
) -> ModifyGuild
pub fn modify_guild_banner(
  modify: ModifyGuild,
  new banner: ImageData,
) -> ModifyGuild

If not animated, the banner must be a PNG/JPEG image with a 16:9 aspect ratio.

If animated, the banner must be a GIF image with a 16:9 aspect ratio and the guild must have the GuildCanUseAnimatedBanner feature.

In all cases, the guild must have the GuildCanUseBanner feature.

pub fn modify_guild_channel_parent_id(
  modify: ModifyGuildChannelPosition,
  new parent_id: Snowflake(CategoryChannel),
  sync_permissions sync_permissions: Bool,
) -> ModifyGuildChannelPosition

sync_permissions - whether to sync the permission overwrites with the new parent.

pub fn modify_guild_channel_position(
  modify: ModifyGuildChannelPosition,
  new position: Int,
) -> ModifyGuildChannelPosition

Channels with the same position are sorted by ID (newer channel will be lower)

pub fn modify_guild_channel_position_to_json(
  modify: ModifyGuildChannelPosition,
) -> json.Json
pub fn modify_guild_channel_positions_request(
  token token: Token,
  in_guild_with_id guild_id: Snowflake(Guild),
  using modify: List(ModifyGuildChannelPosition),
) -> request.Request(String)

Requires the AllowManagingChannels permission.

pub fn modify_guild_channel_positions_response(
  response: response.Response(String),
) -> Result(Nil, RestError)
pub fn modify_guild_default_message_notification_setting(
  modify: ModifyGuild,
  new setting: GuildDefaultMessageNotificationSetting,
) -> ModifyGuild
pub fn modify_guild_description(
  modify: ModifyGuild,
  new description: String,
) -> ModifyGuild
pub fn modify_guild_discovery_splash(
  modify: ModifyGuild,
  new splash: ImageData,
) -> ModifyGuild

The splash must be a PNG/JPEG image with a 16:9 aspect ratio.

The guild must have the GuildIsDiscoverable feature.

pub fn modify_guild_explicit_content_filter_setting(
  modify: ModifyGuild,
  new setting: GuildExplicitContentFilterSetting,
) -> ModifyGuild
pub fn modify_guild_features(
  modify: ModifyGuild,
  new features: List(GuildFeature),
) -> ModifyGuild

Modifies the guild’s features to the provided list.

You can only modify the following features:

  • GuildIsCommunity - requires the AdministratorPermission permission
  • GuildIsDiscoverable - requires the AdministratorPermission permission. The guild must also satisfy all the discovery requirements.
  • GuildHasPausedInvites - requires the AllowManagingGuild permission
  • GuildDisabledRaidAlerts - requires the AllowManagingGuild permission

NOTE: All enabled features, mutable and immutable, must be provided.

pub fn modify_guild_icon(
  modify: ModifyGuild,
  new icon: ImageData,
) -> ModifyGuild

The icon must have a resolution of 1024x1024.

It can only be animated if the guild has the GuildCanUseAnimatedIcon feature.

pub fn modify_guild_incidents_data_request(
  token token: Token,
  for_guild_with_id guild_id: Snowflake(Guild),
  using modify: ModifyGuildIncidentsData,
) -> request.Request(String)

Requires the AllowManagingGuild permission.

pub fn modify_guild_incidents_data_response(
  response: response.Response(String),
) -> Result(GuildIncidentsData, RestError)
pub fn modify_guild_incidents_data_to_json(
  modify: ModifyGuildIncidentsData,
) -> json.Json
pub fn modify_guild_member_flags(
  modify: ModifyGuildMember,
  new flags: List(GuildMemberFlag),
) -> ModifyGuildMember

You can only add or remove the GuildMemberBypassesVerificationFlag.

Supply the function with all of the future flags.

Requires one of the following permissions:

  • AllowManagingGuild
  • AllowManagingRoles
  • AllowModeratingMembers + AllowKickingMembers + AllowBanningMembers
pub fn modify_guild_member_nick(
  modify: ModifyGuildMember,
  new nick: String,
) -> ModifyGuildMember

Requires the AllowManagingNicknames permission.

pub fn modify_guild_member_request(
  token token: Token,
  member_with_id user_id: Snowflake(User),
  in_guild_with_id guild_id: Snowflake(Guild),
  using modify: ModifyGuildMember,
  reason reason: option.Option(String),
) -> request.Request(String)
pub fn modify_guild_member_response(
  response: response.Response(String),
) -> Result(GuildMember, RestError)
pub fn modify_guild_member_roles(
  modify: ModifyGuildMember,
  new_roles_ids roles: List(Snowflake(Role)),
) -> ModifyGuildMember

Requires the AllowManagingRoles permission.

Supply the function with all of the member’s future roles.

pub fn modify_guild_member_to_json(
  modify: ModifyGuildMember,
) -> json.Json
pub fn modify_guild_member_verification_level(
  modify: ModifyGuild,
  new level: GuildMemberVerificationLevel,
) -> ModifyGuild
pub fn modify_guild_message_command() -> ModifyGuildMessageCommand
pub fn modify_guild_message_command_name(
  modify: ModifyGuildMessageCommand,
  new name: String,
) -> ModifyGuildMessageCommand

Name must be between 1 and 32 characters.

pub fn modify_guild_message_command_name_localizations(
  modify: ModifyGuildMessageCommand,
  new localizations: dict.Dict(Locale, String),
) -> ModifyGuildMessageCommand

Name must be between 1 and 32 characters.

pub fn modify_guild_message_command_request(
  token token: Token,
  current_application_id application_id: Snowflake(Application),
  guild_id guild_id: Snowflake(Guild),
  command_with_id command_id: Snowflake(MessageCommand),
  using modify: ModifyGuildMessageCommand,
) -> request.Request(String)
pub fn modify_guild_message_command_required_permissions(
  modify: ModifyGuildMessageCommand,
  new permissions: List(Permission),
) -> ModifyGuildMessageCommand

Use delete_guild_message_command_required_permissions to enable the command for everyone.

Passing an empty list will disable the command for everyone.

Passing a list with at least one permission will require those permissions to use the command.

pub fn modify_guild_message_command_response(
  response: response.Response(String),
) -> Result(MessageCommand, RestError)
pub fn modify_guild_message_command_to_json(
  modify: ModifyGuildMessageCommand,
) -> json.Json
pub fn modify_guild_name(
  modify: ModifyGuild,
  new name: String,
) -> ModifyGuild
pub fn modify_guild_preferred_locale(
  modify: ModifyGuild,
  new preferred_locale: Locale,
) -> ModifyGuild
pub fn modify_guild_public_updates_channel(
  modify: ModifyGuild,
  new_id id: Snowflake(Channel),
) -> ModifyGuild
pub fn modify_guild_request(
  token token: Token,
  guild_with_id id: Snowflake(Guild),
  using modify: ModifyGuild,
  reason reason: option.Option(String),
) -> request.Request(String)

Requires the AllowManagingGuild permission.

pub fn modify_guild_response(
  response: response.Response(String),
) -> Result(Guild, RestError)
pub fn modify_guild_rules_channel(
  modify: ModifyGuild,
  new_id id: Snowflake(Channel),
) -> ModifyGuild
pub fn modify_guild_safety_alerts_channel(
  modify: ModifyGuild,
  new_id id: Snowflake(Channel),
) -> ModifyGuild
pub fn modify_guild_slash_command() -> ModifyGuildSlashCommand
pub fn modify_guild_slash_command_description(
  modify: ModifyGuildSlashCommand,
  new description: String,
) -> ModifyGuildSlashCommand

Description must be between 1 and 100 characters.

pub fn modify_guild_slash_command_description_localizations(
  modify: ModifyGuildSlashCommand,
  new localizations: dict.Dict(Locale, String),
) -> ModifyGuildSlashCommand

Description must be between 1 and 100 characters.

pub fn modify_guild_slash_command_name(
  modify: ModifyGuildSlashCommand,
  new name: String,
) -> ModifyGuildSlashCommand

Name must be between 1 and 32 characters.

pub fn modify_guild_slash_command_name_localizations(
  modify: ModifyGuildSlashCommand,
  new localizations: dict.Dict(Locale, String),
) -> ModifyGuildSlashCommand

Name must be between 1 and 32 characters.

pub fn modify_guild_slash_command_options(
  modify: ModifyGuildSlashCommand,
  new options: List(SlashCommandOption),
) -> ModifyGuildSlashCommand

There is a limit of 25 options per command.

pub fn modify_guild_slash_command_request(
  token token: Token,
  current_application_id application_id: Snowflake(Application),
  guild_id guild_id: Snowflake(Guild),
  command_with_id command_id: Snowflake(SlashCommand),
  using modify: ModifyGuildSlashCommand,
) -> request.Request(String)
pub fn modify_guild_slash_command_required_permissions(
  modify: ModifyGuildSlashCommand,
  new permissions: List(Permission),
) -> ModifyGuildSlashCommand

Use delete_guild_slash_command_required_permissions to enable the command for everyone.

Passing an empty list will disable the command for everyone.

Passing a list with at least one permission will require those permissions to use the command.

pub fn modify_guild_slash_command_response(
  response: response.Response(String),
) -> Result(SlashCommand, RestError)
pub fn modify_guild_slash_command_to_json(
  modify: ModifyGuildSlashCommand,
) -> json.Json
pub fn modify_guild_soundboard_sound_name(
  modify: ModifyGuildSoundboardSound,
  new name: String,
) -> ModifyGuildSoundboardSound
pub fn modify_guild_soundboard_sound_request(
  token token: Token,
  in_guild_with_id guild_id: Snowflake(Guild),
  sound_with_id sound_id: Snowflake(SoundboardSound),
  using modify: ModifyGuildSoundboardSound,
  reason reason: option.Option(String),
) -> request.Request(String)

If the sound was created by the current user, requires the AllowCreatingGuildExpressions or AllowManagingGuildExpressions permission.

For all other sounds, requires the AllowManagingGuildExpressions permission.

pub fn modify_guild_soundboard_sound_response(
  response: response.Response(String),
) -> Result(SoundboardSound, RestError)
pub fn modify_guild_soundboard_sound_to_json(
  modify: ModifyGuildSoundboardSound,
) -> json.Json
pub fn modify_guild_soundboard_sound_volume(
  modify: ModifyGuildSoundboardSound,
  new volume: Float,
) -> ModifyGuildSoundboardSound

The volume will be clamped between 0.0 and 1.0, so make sure to provide a value within that range.

pub fn modify_guild_splash(
  modify: ModifyGuild,
  new splash: ImageData,
) -> ModifyGuild

The splash must be a PNG/JPEG image with a 16:9 aspect ratio.

The guild must have the GuildCanUseInviteSplash feature.

pub fn modify_guild_sticker_description(
  modify: ModifyGuildSticker,
  new description: String,
) -> ModifyGuildSticker
pub fn modify_guild_sticker_name(
  modify: ModifyGuildSticker,
  new name: String,
) -> ModifyGuildSticker
pub fn modify_guild_sticker_request(
  token token: Token,
  in_guild_with_id guild_id: Snowflake(Guild),
  sticker_with_id sticker_id: Snowflake(GuildSticker),
  using modify: ModifyGuildSticker,
  reason reason: option.Option(String),
) -> request.Request(String)

Required permissions:

  • for stickers created by the current user - AllowCreatingGuildExpressions or AllowManagingGuildExpressions
  • for other stickers - AllowManagingGuildExpressions
pub fn modify_guild_sticker_response(
  response: response.Response(String),
) -> Result(GuildSticker, RestError)
pub fn modify_guild_sticker_tags(
  modify: ModifyGuildSticker,
  new tags: String,
) -> ModifyGuildSticker
pub fn modify_guild_sticker_to_json(
  modify: ModifyGuildSticker,
) -> json.Json
pub fn modify_guild_system_channel(
  modify: ModifyGuild,
  new_id id: Snowflake(Channel),
) -> ModifyGuild
pub fn modify_guild_system_channel_flags(
  modify: ModifyGuild,
  new flags: List(GuildSystemChannelFlag),
) -> ModifyGuild
pub fn modify_guild_to_json(modify: ModifyGuild) -> json.Json
pub fn modify_guild_user_command() -> ModifyGuildUserCommand
pub fn modify_guild_user_command_name(
  modify: ModifyGuildUserCommand,
  new name: String,
) -> ModifyGuildUserCommand

Name must be between 1 and 32 characters.

pub fn modify_guild_user_command_name_localizations(
  modify: ModifyGuildUserCommand,
  new localizations: dict.Dict(Locale, String),
) -> ModifyGuildUserCommand

Name must be between 1 and 32 characters.

pub fn modify_guild_user_command_request(
  token token: Token,
  current_application_id application_id: Snowflake(Application),
  guild_id guild_id: Snowflake(Guild),
  command_with_id command_id: Snowflake(UserCommand),
  using modify: ModifyGuildUserCommand,
) -> request.Request(String)
pub fn modify_guild_user_command_required_permissions(
  modify: ModifyGuildUserCommand,
  new permissions: List(Permission),
) -> ModifyGuildUserCommand

Use delete_guild_user_command_required_permissions to enable the command for everyone.

Passing an empty list will disable the command for everyone.

Passing a list with at least one permission will require those permissions to use the command.

pub fn modify_guild_user_command_response(
  response: response.Response(String),
) -> Result(UserCommand, RestError)
pub fn modify_guild_user_command_to_json(
  modify: ModifyGuildUserCommand,
) -> json.Json
pub fn modify_guild_welcome_screen_channels(
  modify: ModifyGuildWelcomeScreen,
  new channels: List(GuildWelcomeScreenChannel),
) -> ModifyGuildWelcomeScreen
pub fn modify_guild_welcome_screen_description(
  modify: ModifyGuildWelcomeScreen,
  new description: String,
) -> ModifyGuildWelcomeScreen
pub fn modify_guild_welcome_screen_request(
  token token: Token,
  for_guild_with_id guild_id: Snowflake(Guild),
  using modify: ModifyGuildWelcomeScreen,
  reason reason: option.Option(String),
) -> request.Request(String)

Requires the AllowManagingGuild permission.

pub fn modify_guild_welcome_screen_response(
  response: response.Response(String),
) -> Result(GuildWelcomeScreen, RestError)
pub fn modify_guild_welcome_screen_to_json(
  modify: ModifyGuildWelcomeScreen,
) -> json.Json
pub fn modify_guild_widget_settings_request(
  token token: Token,
  for_guild_with_id guild_id: Snowflake(Guild),
  using modify: ModifyGuildWidgetSettings,
  reason reason: option.Option(String),
) -> request.Request(String)

Requires the AllowManagingGuild permission.

pub fn modify_guild_widget_settings_response(
  response: response.Response(String),
) -> Result(GuildWidgetSettings, RestError)
pub fn modify_guild_widget_settings_to_json(
  modify: ModifyGuildWidgetSettings,
) -> json.Json
pub fn modify_interaction_response_followup_message_request(
  token token: Token,
  current_application_id application_id: Snowflake(Application),
  interaction_token interaction_token: InteractionToken,
  message_id message_id: Snowflake(Message),
  using modify: ModifyInteractionResponseMessage,
) -> request.Request(BitArray)
pub fn modify_interaction_response_followup_message_response(
  response: response.Response(BitArray),
) -> Result(Message, RestError)
pub fn modify_interaction_response_message_allowed_mentions(
  modify: ModifyInteractionResponseMessage,
  new allowed_mentions: List(AllowedMessageMention),
) -> ModifyInteractionResponseMessage

Provide an empty list to deny all mentions.

pub fn modify_interaction_response_message_attachments(
  modify: ModifyInteractionResponseMessage,
  new attachments: List(CreateMessageAttachment),
) -> ModifyInteractionResponseMessage
pub fn modify_interaction_response_message_components(
  modify: ModifyInteractionResponseMessage,
  new components: List(CreateMessageComponent),
) -> ModifyInteractionResponseMessage

Make sure to set the InteractionResponseMessageUsesComponentsV2 if using V2 components.

Also make sure to delete the content, embeds, attachments and poll fields if using V2 components.

pub fn modify_interaction_response_message_content(
  modify: ModifyInteractionResponseMessage,
  new content: String,
) -> ModifyInteractionResponseMessage
pub fn modify_interaction_response_message_flags(
  modify: ModifyInteractionResponseMessage,
  new flags: List(InteractionResponseMessageFlag),
) -> ModifyInteractionResponseMessage

You must provide all flags that the message has.

You can only modify the following flags:

  • InteractionResponseMessageWithSuppressedEmbeds - add/remove
  • InteractionResponseMessageUsesComponentsV2 - add

Make sure to delete the content, embeds, attachments and poll fields if you’re adding the Components V2 flag.

pub fn modify_interaction_response_message_to_json(
  modify: ModifyInteractionResponseMessage,
) -> json.Json
pub fn modify_media_channel_available_tags(
  modify: ModifyMediaChannel,
  new tags: List(ForumTag),
) -> ModifyMediaChannel
pub fn modify_media_channel_default_reaction(
  modify: ModifyMediaChannel,
  new reaction: DefaultForumReaction,
) -> ModifyMediaChannel
pub fn modify_media_channel_default_sort_order(
  modify: ModifyMediaChannel,
  new order: ForumSortOrder,
) -> ModifyMediaChannel
pub fn modify_media_channel_default_thread_auto_archive_duration(
  modify: ModifyMediaChannel,
  new duration: ThreadAutoArchiveDuration,
) -> ModifyMediaChannel
pub fn modify_media_channel_default_thread_rate_limit_per_user(
  modify: ModifyMediaChannel,
  new limit: RateLimitPerUser,
) -> ModifyMediaChannel
pub fn modify_media_channel_flags(
  modify: ModifyMediaChannel,
  new flags: List(MediaChannelFlag),
) -> ModifyMediaChannel
pub fn modify_media_channel_name(
  modify: ModifyMediaChannel,
  new name: String,
) -> ModifyMediaChannel
pub fn modify_media_channel_parent_id(
  modify: ModifyMediaChannel,
  new id: Snowflake(CategoryChannel),
) -> ModifyMediaChannel
pub fn modify_media_channel_permission_overwrites(
  modify: ModifyMediaChannel,
  new overwrites: List(PermissionOverwrite),
) -> ModifyMediaChannel

You can only allow/deny permissions if your bot has those permissions. Setting the AllowManagingRoles permission requires your bot to have the AdministratorPermission.

pub fn modify_media_channel_position(
  modify: ModifyMediaChannel,
  new position: Int,
) -> ModifyMediaChannel
pub fn modify_media_channel_rate_limit_per_user(
  modify: ModifyMediaChannel,
  new limit: RateLimitPerUser,
) -> ModifyMediaChannel
pub fn modify_media_channel_request(
  token token: Token,
  channel_with_id channel_id: Snowflake(MediaChannel),
  using modify: ModifyMediaChannel,
  reason reason: option.Option(String),
) -> request.Request(String)

Requires the AllowManagingChannels permission.

pub fn modify_media_channel_response(
  response: response.Response(String),
) -> Result(MediaChannel, RestError)
pub fn modify_media_channel_to_json(
  modify: ModifyMediaChannel,
) -> json.Json
pub fn modify_media_channel_topic(
  modify: ModifyMediaChannel,
  new topic: String,
) -> ModifyMediaChannel
pub fn modify_message_allowed_mentions(
  modify: ModifyMessage,
  allowed_mentions: List(AllowedMessageMention),
) -> ModifyMessage

Modifying a message’s allowed mentions doesn’t notify anyone.

Please read through the AllowedMessageMention documentation before going forward.

pub fn modify_message_attachments(
  modify: ModifyMessage,
  attachments: List(CreateMessageAttachment),
) -> ModifyMessage

All the attachments you plan on having in the new version of the message must be provided.

pub fn modify_message_components(
  modify: ModifyMessage,
  components: List(CreateMessageComponent),
) -> ModifyMessage

All the components you plan on having in the new version of the message must be provided.

Make sure to set the ModifyMessageToUseComponentsV2 flag if using components V2.

Clear out the content and embeds fields if using components V2.

pub fn modify_message_content(
  modify: ModifyMessage,
  new content: String,
) -> ModifyMessage
pub fn modify_message_embeds(
  modify: ModifyMessage,
  new embeds: List(CreateMessageEmbed),
) -> ModifyMessage
pub fn modify_message_flags(
  modify: ModifyMessage,
  old old: List(MessageFlag),
  new_added added: List(ModifyMessageAddFlag),
  new_removed removed: List(ModifyMessageRemoveFlag),
) -> ModifyMessage

You need the message’s present flags to modify them.

Removal takes prescedence over addition.

Trying to add an already present flag or remove an already absent one is a no-op.

pub fn modify_message_request(
  token token: Token,
  in_channel_with_id channel_id: Snowflake(Channel),
  message_with_id message_id: Snowflake(Message),
  using modify: ModifyMessage,
) -> request.Request(BitArray)

Modifying someone else’s message:

  • you can only add the ModifyMessageToSuppressEmbeds flag
  • requires the AllowManagingMessages permission.
pub fn modify_message_response(
  response: response.Response(BitArray),
) -> Result(Message, RestError)
pub fn modify_message_to_json(modify: ModifyMessage) -> json.Json
pub fn modify_original_interaction_response_request(
  token token: Token,
  current_application_id application_id: Snowflake(Application),
  interaction_token interaction_token: InteractionToken,
  with modify: ModifyInteractionResponseMessage,
) -> request.Request(BitArray)
pub fn modify_original_interaction_response_response(
  response: response.Response(BitArray),
) -> Result(Message, RestError)
pub fn modify_role_as_mentionable(
  modify: ModifyRole,
) -> ModifyRole

Allows everyone to mention the role.

pub fn modify_role_as_unmentionable(
  modify: ModifyRole,
) -> ModifyRole

Does not allow everyone to mention the role.

pub fn modify_role_colours(
  modify: ModifyRole,
  new colours: RoleColours,
) -> ModifyRole
pub fn modify_role_icon(
  modify: ModifyRole,
  new icon: ImageData,
) -> ModifyRole

Requires the GuildCanUseRoleIcons feature.

pub fn modify_role_name(
  modify: ModifyRole,
  new name: String,
) -> ModifyRole
pub fn modify_role_permissions(
  modify: ModifyRole,
  new permissions: List(Permission),
) -> ModifyRole

Controls the role’s guild-wide permissions. Supply the function with all the future permissions.

pub fn modify_role_position_response(
  response: response.Response(String),
) -> Result(List(Role), RestError)
pub fn modify_role_position_to_json(
  modify: ModifyRolePosition,
) -> json.Json
pub fn modify_role_positions_request(
  token token: Token,
  in_guild_with_id guild_id: Snowflake(Guild),
  using modify: List(ModifyRolePosition),
  reason reason: option.Option(String),
) -> request.Request(String)

Requires the AllowManagingRoles permission.

Returns all of the guild’s roles.

pub fn modify_role_request(
  token token: Token,
  role_with_id role_id: Snowflake(Role),
  in_guild_with_id guild_id: Snowflake(Guild),
  using modify: ModifyRole,
  reason reason: option.Option(String),
) -> request.Request(String)

Requires the AllowManagingRoles permission.

pub fn modify_role_response(
  response: response.Response(String),
) -> Result(Role, RestError)
pub fn modify_role_to_json(modify: ModifyRole) -> json.Json
pub fn modify_role_unicode_emoji(
  modify: ModifyRole,
  new unicode_emoji: String,
) -> ModifyRole

Requires the GuildCanUseRoleIcons feature.

pub fn modify_stage_channel_bitrate(
  modify: ModifyStageChannel,
  new bitrate: Int,
) -> ModifyStageChannel
pub fn modify_stage_channel_name(
  modify: ModifyStageChannel,
  new name: String,
) -> ModifyStageChannel
pub fn modify_stage_channel_parent_id(
  modify: ModifyStageChannel,
  new parent_id: Snowflake(CategoryChannel),
) -> ModifyStageChannel
pub fn modify_stage_channel_permission_overwrites(
  modify: ModifyStageChannel,
  new overwrites: List(PermissionOverwrite),
) -> ModifyStageChannel

You can only allow/deny permissions if your bot has those permissions. Setting the AllowManagingRoles permission requires your bot to have the AdministratorPermission.

pub fn modify_stage_channel_position(
  modify: ModifyStageChannel,
  new position: Int,
) -> ModifyStageChannel

Channels with the same position are sorted by ID (newer channel will be lower)

pub fn modify_stage_channel_rate_limit_per_user(
  modify: ModifyStageChannel,
  new limit: RateLimitPerUser,
) -> ModifyStageChannel

Modifies the slowmode for the stage-channel-attached text channel.

Must be between 0 and 21600 seconds.

Bots and members with the AllowBypassingSlowmode permission are exempt from slowmode.

pub fn modify_stage_channel_request(
  token token: Token,
  channel_with_id channel_id: Snowflake(StageChannel),
  using modify: ModifyStageChannel,
  reason reason: option.Option(String),
) -> request.Request(String)

Requires the AllowManagingChannels permission.

pub fn modify_stage_channel_response(
  response: response.Response(String),
) -> Result(StageChannel, RestError)
pub fn modify_stage_channel_rtc_region_id(
  modify: ModifyStageChannel,
  new rtc_region_id: String,
) -> ModifyStageChannel
pub fn modify_stage_channel_to_json(
  modify: ModifyStageChannel,
) -> json.Json
pub fn modify_stage_channel_user_limit(
  modify: ModifyStageChannel,
  new limit: Int,
) -> ModifyStageChannel
pub fn modify_stage_channel_video_quality_mode(
  modify: ModifyStageChannel,
  new video_quality_mode: VideoQualityMode,
) -> ModifyStageChannel
pub fn modify_text_channel_default_thread_auto_archive_duration(
  modify: ModifyTextChannel,
  new duration: ThreadAutoArchiveDuration,
) -> ModifyTextChannel
pub fn modify_text_channel_default_thread_rate_limit_per_user(
  modify: ModifyTextChannel,
  new duration: RateLimitPerUser,
) -> ModifyTextChannel

The modified value will only apply to new threads - existing threads won’t auto-update.

pub fn modify_text_channel_name(
  modify: ModifyTextChannel,
  new name: String,
) -> ModifyTextChannel
pub fn modify_text_channel_parent_id(
  modify: ModifyTextChannel,
  new id: Snowflake(CategoryChannel),
) -> ModifyTextChannel
pub fn modify_text_channel_permission_ovewrites(
  modify: ModifyTextChannel,
  new overwrites: List(PermissionOverwrite),
) -> ModifyTextChannel

You can only allow/deny permissions if your bot has those permissions. Setting the AllowManagingRoles permission requires your bot to have the AdministratorPermission.

pub fn modify_text_channel_position(
  modify: ModifyTextChannel,
  new position: Int,
) -> ModifyTextChannel

Channels with the same position are sorted by ID (newer channel will be lower)

pub fn modify_text_channel_rate_limit_per_user(
  modify: ModifyTextChannel,
  new limit: RateLimitPerUser,
) -> ModifyTextChannel

Modify the amount of time between a user has to wait between sending a message or creating a thread.

Must be between 0 and 21600 seconds.

Bots and members with the AllowBypassingSlowmode permission are exempt from slowmode.

pub fn modify_text_channel_request(
  token token: Token,
  channel_with_id channel_id: Snowflake(TextChannel),
  using modify: ModifyTextChannel,
  reason reason: option.Option(String),
) -> request.Request(String)

Requires the AllowManagingChannels permission.

pub fn modify_text_channel_response(
  response: response.Response(String),
) -> Result(TextChannel, RestError)

Use modify_text_channel_with_conversion_response if you converted the text channel into announcement channel.

pub fn modify_text_channel_to_json(
  modify: ModifyTextChannel,
) -> json.Json
pub fn modify_text_channel_topic(
  modify: ModifyTextChannel,
  new topic: String,
) -> ModifyTextChannel
pub fn modify_text_channel_with_conversion_response(
  response: response.Response(String),
) -> Result(AnnouncementChannel, RestError)

Use this if you converted the text channel to an announcement channel.

pub fn modify_thread_applied_tags(
  modify: ModifyThread,
  new_ids ids: List(Snowflake(ForumTag)),
) -> ModifyThread

Limited to 5.

pub fn modify_thread_auto_archive_duration(
  modify: ModifyThread,
  new duration: ThreadAutoArchiveDuration,
) -> ModifyThread
pub fn modify_thread_flags(
  modify: ModifyThread,
  new flags: List(ThreadFlag),
) -> ModifyThread
pub fn modify_thread_name(
  modify: ModifyThread,
  new name: String,
) -> ModifyThread
pub fn modify_thread_rate_limit_per_user(
  modify: ModifyThread,
  new limit: RateLimitPerUser,
) -> ModifyThread
pub fn modify_thread_request(
  token token: Token,
  thread_with_id id: Snowflake(Thread),
  using modify: ModifyThread,
  reason reason: option.Option(String),
) -> request.Request(String)
pub fn modify_thread_response(
  response: response.Response(String),
) -> Result(Thread, RestError)
pub fn modify_thread_to_json(modify: ModifyThread) -> json.Json
pub fn modify_voice_channel_bitrate(
  modify: ModifyVoiceChannel,
  new bitrate: Int,
) -> ModifyVoiceChannel
pub fn modify_voice_channel_name(
  modify: ModifyVoiceChannel,
  new name: String,
) -> ModifyVoiceChannel
pub fn modify_voice_channel_parent_id(
  modify: ModifyVoiceChannel,
  new parent_id: Snowflake(CategoryChannel),
) -> ModifyVoiceChannel
pub fn modify_voice_channel_permission_overwrites(
  modify: ModifyVoiceChannel,
  new overwrites: List(PermissionOverwrite),
) -> ModifyVoiceChannel

You can only allow/deny permissions if your bot has those permissions. Setting the AllowManagingRoles permission requires your bot to have the AdministratorPermission.

pub fn modify_voice_channel_position(
  modify: ModifyVoiceChannel,
  new position: Int,
) -> ModifyVoiceChannel

Channels with the same position are sorted by ID (newer channel will be lower)

pub fn modify_voice_channel_rate_limit_per_user(
  modify: ModifyVoiceChannel,
  new limit: RateLimitPerUser,
) -> ModifyVoiceChannel

Modifies the slowmode for the voice-channel-attached text channel.

Must be between 0 and 21600 seconds.

Bots and members with the AllowBypassingSlowmode permission are exempt from slowmode.

pub fn modify_voice_channel_request(
  token token: Token,
  channel_with_id channel_id: Snowflake(VoiceChannel),
  using modify: ModifyVoiceChannel,
  reason reason: option.Option(String),
) -> request.Request(String)

Requires the AllowManagingChannels permission.

pub fn modify_voice_channel_response(
  response: response.Response(String),
) -> Result(VoiceChannel, RestError)
pub fn modify_voice_channel_rtc_region_id(
  modify: ModifyVoiceChannel,
  new rtc_region_id: String,
) -> ModifyVoiceChannel
pub fn modify_voice_channel_to_json(
  modify: ModifyVoiceChannel,
) -> json.Json
pub fn modify_voice_channel_user_limit(
  modify: ModifyVoiceChannel,
  new limit: Int,
) -> ModifyVoiceChannel
pub fn modify_voice_channel_video_quality_mode(
  modify: ModifyVoiceChannel,
  new video_quality_mode: VideoQualityMode,
) -> ModifyVoiceChannel
pub fn move_guild_member(
  modify: ModifyGuildMember,
  to channel_id: Snowflake(VoiceLikeChannel),
) -> ModifyGuildMember

Requires the AllowMovingMembersBetweenVoiceChannels permission and the AllowConnectingToVoiceChannels permission for that voice channel.

Will return a bad request if the user is not in a voice channel.

pub fn move_role(
  with_id id: Snowflake(Role),
  to_position position: Int,
) -> ModifyRolePosition

Roles with the same position are sorted by ID.

pub fn mute_guild_member(
  modify: ModifyGuildMember,
) -> ModifyGuildMember

Requires the AllowMutingMembersInVoiceChannels permission.

Denies the user’s permission to speak in all the guild’s voice channels.

Will return a bad request if the user is not in a voice channel.

pub fn new_announcement_channel(
  named name: String,
) -> CreateAnnouncementChannel

Requires the AllowManagingChannels permission.

pub fn new_announcement_channel_at_position(
  create: CreateAnnouncementChannel,
  position: Int,
) -> CreateAnnouncementChannel

Channels without a specified position will automatically be assigned one at the bottom of their category/channel list. Channels with the same position are sorted by ID (new channel will be lower)

pub fn new_announcement_channel_request(
  token token: Token,
  in_guild_with_id guild_id: Snowflake(Guild),
  using create: CreateAnnouncementChannel,
  reason reason: option.Option(String),
) -> request.Request(String)

Requires the AllowManagingChannels permission.

pub fn new_announcement_channel_response(
  response: response.Response(String),
) -> Result(AnnouncementChannel, RestError)
pub fn new_announcement_channel_with_parent_id(
  create: CreateAnnouncementChannel,
  parent_id: Snowflake(CategoryChannel),
) -> CreateAnnouncementChannel

Puts the channel in a category. Channels without a parent ID will not be in a category, and will rather be independent in the server list.

pub fn new_announcement_channel_with_permission_overwrites(
  create: CreateAnnouncementChannel,
  overwrites: List(PermissionOverwrite),
) -> CreateAnnouncementChannel

You can only allow/deny permissions if your bot has those permissions. Setting the AllowManagingRoles permission requires your bot to have the AdministratorPermission.

pub fn new_announcement_channel_with_thread_auto_archive_duration(
  create: CreateAnnouncementChannel,
  duration: ThreadAutoArchiveDuration,
) -> CreateAnnouncementChannel

Controls the default amount of time after which inactive threads are archived in the channel.

pub fn new_announcement_channel_with_thread_rate_limit_per_user(
  create: CreateAnnouncementChannel,
  rate_limit_per_user: RateLimitPerUser,
) -> CreateAnnouncementChannel

The default thread rate limit per user. This value gets copied to every thread and does not live-update.

pub fn new_announcement_channel_with_topic(
  create: CreateAnnouncementChannel,
  topic: String,
) -> CreateAnnouncementChannel
pub fn new_attachment_slash_command_option(
  named name: String,
  with_description description: String,
) -> AttachmentSlashCommandOption

The name must be between 1 and 32 characters.

The description must be between 1 and 100 characters.

pub fn new_attachment_slash_command_option_with_allowed_file_types(
  option: AttachmentSlashCommandOption,
  file_types: List(FileUploadFilter),
) -> AttachmentSlashCommandOption

Passing an empty list to this function (default behavior in the new function), allows the user to pass files of any type into the option.

If you pass any file types, the user will only be allowed to pass in files with such types.

pub fn new_attachment_slash_command_option_with_description_localizations(
  option: AttachmentSlashCommandOption,
  localizations: dict.Dict(Locale, String),
) -> AttachmentSlashCommandOption

The description must be between 1 and 100 characters.

pub fn new_attachment_slash_command_option_with_name_localizations(
  option: AttachmentSlashCommandOption,
  localizations: dict.Dict(Locale, String),
) -> AttachmentSlashCommandOption

The name must be between 1 and 32 characters.

pub fn new_bool_slash_command_option(
  named name: String,
  with_description description: String,
) -> BoolSlashCommandOption

The name must be between 1 and 32 characters.

The description must be between 1 and 100 characters.

pub fn new_bool_slash_command_option_with_description_localizations(
  option: BoolSlashCommandOption,
  localizations: dict.Dict(Locale, String),
) -> BoolSlashCommandOption

The description must be between 1 and 100 characters.

pub fn new_bool_slash_command_option_with_name_localizations(
  option: BoolSlashCommandOption,
  localizations: dict.Dict(Locale, String),
) -> BoolSlashCommandOption

The name must be between 1 and 32 characters.

pub fn new_category_channel(
  named name: String,
) -> CreateCategoryChannel
pub fn new_category_channel_at_position(
  create: CreateCategoryChannel,
  position: Int,
) -> CreateCategoryChannel

Channels without a specified position will automatically be assigned one at the bottom of their channel list. Channels with the same position are sorted by ID (new channel will be lower)

pub fn new_category_channel_request(
  token token: Token,
  in_guild_with_id guild_id: Snowflake(Guild),
  using create: CreateCategoryChannel,
  reason reason: option.Option(String),
) -> request.Request(String)

Requires the AllowManagingChannels permission.

pub fn new_category_channel_response(
  response: response.Response(String),
) -> Result(CategoryChannel, RestError)
pub fn new_category_channel_with_permission_overwrites(
  create: CreateCategoryChannel,
  overwrites: List(PermissionOverwrite),
) -> CreateCategoryChannel

You can only allow/deny permissions if your bot has those permissions. Setting the AllowManagingRoles permission requires your bot to have the AdministratorPermission. Channels can sync their permissions to their category channels.

pub fn new_channel_slash_command_option(
  named name: String,
  with_description description: String,
) -> ChannelSlashCommandOption

The name must be between 1 and 32 characters.

The description must be between 1 and 100 characters.

pub fn new_channel_slash_command_option_with_allowed_channel_types(
  option: ChannelSlashCommandOption,
  channel_types: List(SelectChannelType),
) -> ChannelSlashCommandOption

Passing an empty list (default behavior in the new function), allows the user to select a channel of any type.

If you pass any channel types into this function, now users will only be allowed to select channels of those types.

pub fn new_channel_slash_command_option_with_description_localizations(
  option: ChannelSlashCommandOption,
  localizations: dict.Dict(Locale, String),
) -> ChannelSlashCommandOption

The description must be between 1 and 100 characters.

pub fn new_channel_slash_command_option_with_name_localizations(
  option: ChannelSlashCommandOption,
  localizations: dict.Dict(Locale, String),
) -> ChannelSlashCommandOption

The name must be between 1 and 32 characters.

pub fn new_checkbox_group_option(
  label label: String,
  value value: String,
) -> CreateCheckboxGroupOption

Label and value must each be up to 100 characters.

pub fn new_checkbox_group_option_with_description(
  create: CreateCheckboxGroupOption,
  description: String,
) -> CreateCheckboxGroupOption

Must be up to 100 characters.

pub fn new_default_selected_checkbox_group_option(
  create: CreateCheckboxGroupOption,
) -> CreateCheckboxGroupOption
pub fn new_default_selected_modal_checkbox(
  create: CreateModalCheckbox,
) -> CreateModalCheckbox
pub fn new_default_selected_radio_group_option(
  create: CreateRadioGroupOption,
) -> CreateRadioGroupOption

Only one radio group option can be selected by default.

pub fn new_default_selected_string_select_option(
  option: StringSelectOption,
) -> StringSelectOption

Whether the option is selected by default.

pub fn new_disabled_link_button(
  create: CreateLinkButton,
) -> CreateLinkButton
pub fn new_disabled_message_button(
  create: CreatePremiumButton,
) -> CreatePremiumButton
pub fn new_disabled_regular_button(
  create: CreateRegularButton,
) -> CreateRegularButton
pub fn new_dm_channel_request(
  token token: Token,
  to_user_with_id user_id: Snowflake(User),
) -> request.Request(String)

Do not use this endpoint as means of notifying everyone in a server about something.

DMs should be initiated by user action - for example, interactions.

Even then, if you create a significant amount of DMs too quickly, your bot may be quarantined.

pub fn new_dm_channel_response(
  response: response.Response(String),
) -> Result(DmChannel, RestError)
pub fn new_embed_author(named name: String) -> CreateEmbedAuthor
pub fn new_embed_author_with_icon(
  create: CreateEmbedAuthor,
  url icon_url: String,
) -> CreateEmbedAuthor

URL must be attachment or HTTPS.

pub fn new_embed_author_with_url(
  create: CreateEmbedAuthor,
  url: String,
) -> CreateEmbedAuthor

URL must be HTTPS.

pub fn new_embed_field(
  named name: String,
  value value: String,
) -> CreateEmbedField
pub fn new_embed_footer(text text: String) -> CreateEmbedFooter
pub fn new_embed_footer_with_icon(
  create: CreateEmbedFooter,
  url icon_url: String,
) -> CreateEmbedFooter

URL must beattachment or HTTPS.

pub fn new_embed_image(url url: String) -> CreateEmbedImage
pub fn new_embed_image_with_description(
  create: CreateEmbedImage,
  description: String,
) -> CreateEmbedImage
pub fn new_float_slash_command_option(
  named name: String,
  with_description description: String,
) -> FloatSlashCommandOption

The name must be between 1 and 32 characters.

The description must be between 1 and 100 characters.

pub fn new_float_slash_command_option_choice(
  named name: String,
  value value: Float,
) -> FloatSlashCommandOptionChoice

Name must be between 1 and 100 characters.

pub fn new_float_slash_command_option_choice_with_name_localizations(
  choice: FloatSlashCommandOptionChoice,
  localizations: dict.Dict(Locale, String),
) -> FloatSlashCommandOptionChoice

Name must be between 1 and 100 characters.

pub fn new_float_slash_command_option_with_choices(
  option: FloatSlashCommandOption,
  choices: List(FloatSlashCommandOptionChoice),
) -> FloatSlashCommandOption

If you hard-code choices, you cannot enable autocomplete.

There is a limit of 25 choices per option.

pub fn new_float_slash_command_option_with_description_localizations(
  option: FloatSlashCommandOption,
  localizations: dict.Dict(Locale, String),
) -> FloatSlashCommandOption

The description must be between 1 and 100 characters.

pub fn new_float_slash_command_option_with_enabled_autocomplete(
  option: FloatSlashCommandOption,
) -> FloatSlashCommandOption

Used for dynamic suggestion of choices based on user input.

The provided suggestions are not the only possible choices, and the user can still input anything, provided it fits in the character range.

You cannot use hard-coded choices if autocomplete is enabled.

pub fn new_float_slash_command_option_with_maximum_value(
  option: FloatSlashCommandOption,
  value: Float,
) -> FloatSlashCommandOption
pub fn new_float_slash_command_option_with_minimum_value(
  option: FloatSlashCommandOption,
  value: Float,
) -> FloatSlashCommandOption
pub fn new_float_slash_command_option_with_name_localizations(
  option: FloatSlashCommandOption,
  localizations: dict.Dict(Locale, String),
) -> FloatSlashCommandOption

The name must be between 1 and 32 characters.

pub fn new_forum_channel(
  named name: String,
) -> CreateForumChannel
pub fn new_forum_channel_at_position(
  create: CreateForumChannel,
  position: Int,
) -> CreateForumChannel

Channels without a specified position will automatically be assigned one at the bottom of their category/channel list. Channels with the same position are sorted by ID (new channel will be lower)

pub fn new_forum_channel_request(
  token token: Token,
  in_guild_with_id guild_id: Snowflake(Guild),
  using create: CreateForumChannel,
  reason reason: option.Option(String),
) -> request.Request(String)

Requires the AllowManagingChannels permission.

pub fn new_forum_channel_response(
  response: response.Response(String),
) -> Result(ForumChannel, RestError)
pub fn new_forum_channel_with_default_layout(
  create: CreateForumChannel,
  layout: ForumLayout,
) -> CreateForumChannel

Controls the default layout the channel is shown in.

pub fn new_forum_channel_with_default_reaction(
  create: CreateForumChannel,
  reaction: DefaultForumReaction,
) -> CreateForumChannel

Controls the default reaction shown in the thread preview.

pub fn new_forum_channel_with_default_sort_order(
  create: CreateForumChannel,
  order: ForumSortOrder,
) -> CreateForumChannel

Controls the default order of sorting the threads in the forum.

pub fn new_forum_channel_with_parent_id(
  create: CreateForumChannel,
  parent_id: Snowflake(CategoryChannel),
) -> CreateForumChannel

Puts the channel in a category. Channels without a parent ID will not be in a category, and will rather be independent in the server list.

pub fn new_forum_channel_with_permission_overwrites(
  create: CreateForumChannel,
  overwrites: List(PermissionOverwrite),
) -> CreateForumChannel

You can only allow/deny permissions if your bot has those permissions. Setting the AllowManagingRoles permission requires your bot to have the AdministratorPermission.

pub fn new_forum_channel_with_rate_limit_per_user(
  create: CreateForumChannel,
  limit: RateLimitPerUser,
) -> CreateForumChannel

The rate limit per user is the amount of time a user has to wait between sending messages.

pub fn new_forum_channel_with_tags(
  create: CreateForumChannel,
  tags: List(ForumTag),
) -> CreateForumChannel
pub fn new_forum_channel_with_thread_auto_archive_duration(
  create: CreateForumChannel,
  duration: ThreadAutoArchiveDuration,
) -> CreateForumChannel

Controls the default amount of time after which inactive threads are archived in the channel.

pub fn new_forum_channel_with_thread_rate_limit_per_user(
  create: CreateForumChannel,
  limit: RateLimitPerUser,
) -> CreateForumChannel

The default thread rate limit per user. This value gets copied to every thread and does not live-update.

pub fn new_forum_channel_with_topic(
  create: CreateForumChannel,
  topic: String,
) -> CreateForumChannel
pub fn new_forum_like_thread(
  named name: String,
  using message: CreateForumLikeThreadMessage,
) -> CreateForumLikeThread
pub fn new_forum_like_thread_message() -> CreateForumLikeThreadMessage

You need to set one of content, embeds, sticker_ids, components, or attachments.

You have to use the CreateForumLikeThreadMessageUsingComponentsV2 flag if you use Components V2.

pub fn new_forum_like_thread_message_embed_with_description(
  create: CreateForumLikeThreadMessageEmbed,
  description: String,
) -> CreateForumLikeThreadMessageEmbed
pub fn new_forum_like_thread_message_embed_with_title(
  create: CreateForumLikeThreadMessageEmbed,
  title: String,
) -> CreateForumLikeThreadMessageEmbed
pub fn new_forum_like_thread_message_embed_with_url(
  create: CreateForumLikeThreadMessageEmbed,
  url: String,
) -> CreateForumLikeThreadMessageEmbed
pub fn new_forum_like_thread_message_with_allowed_mentions(
  create: CreateForumLikeThreadMessage,
  allowed_mentions: List(AllowedMessageMention),
) -> CreateForumLikeThreadMessage

Please read the AllowedMessageMention documentation beforehand.

pub fn new_forum_like_thread_message_with_attachments(
  create: CreateForumLikeThreadMessage,
  attachments: List(CreateMessageAttachment),
) -> CreateForumLikeThreadMessage
pub fn new_forum_like_thread_message_with_components(
  create: CreateForumLikeThreadMessage,
  components: List(CreateMessageComponent),
) -> CreateForumLikeThreadMessage

If sending a V2 component, remember to set the CreateForumLikeThreadMessageUsingComponentsV2 flag.

pub fn new_forum_like_thread_message_with_content(
  create: CreateForumLikeThreadMessage,
  content: String,
) -> CreateForumLikeThreadMessage
pub fn new_forum_like_thread_message_with_stickers(
  create: CreateForumLikeThreadMessage,
  ids sticker_ids: List(Snowflake(Sticker)),
) -> CreateForumLikeThreadMessage
pub fn new_forum_like_thread_request(
  token token: Token,
  in_channel_with_id channel_id: Snowflake(ForumLikeChannel),
  using create: CreateForumLikeThread,
  reason reason: option.Option(String),
) -> request.Request(BitArray)

Behavior:

  • the created thread will be a PublicThread
  • requires the AllowSendingMessages permission in the forum-like channel
pub fn new_forum_like_thread_response(
  response: response.Response(BitArray),
) -> Result(Thread, RestError)
pub fn new_forum_like_thread_with_applied_tags(
  create: CreateForumLikeThread,
  ids ids: List(Snowflake(ForumTag)),
) -> CreateForumLikeThread
pub fn new_forum_like_thread_with_auto_archive_duration(
  create: CreateForumLikeThread,
  duration: ThreadAutoArchiveDuration,
) -> CreateForumLikeThread
pub fn new_forum_like_thread_with_rate_limit_per_user(
  create: CreateForumLikeThread,
  limit: RateLimitPerUser,
) -> CreateForumLikeThread
pub fn new_forward_message_reference(
  original_message_id original_message_id: Snowflake(Message),
  original_channel_id original_channel_id: Snowflake(Channel),
  original_guild_id original_guild_id: option.Option(
    Snowflake(Guild),
  ),
) -> CreateMessageReference

Allows you to make a new message be a forward of another message.

You MUST include the original guild ID unless the message was sent in a DM.

pub fn new_get_channel_pins_options() -> GetChannelPinsOptions

Default limit is 50.

pub fn new_get_current_application_entitlements_options() -> GetCurrentApplicationEntitlementsOptions

Defaults:

  • limit 100
  • include ended
  • exclude deleted
pub fn new_get_guild_bans_options() -> GetGuildBansOptions
pub fn new_get_guild_members_options() -> GetGuildMembersOptions
pub fn new_get_poll_answer_voters_options() -> GetPollAnswerVotersOptions

Default limit is 25.

pub fn new_get_reacting_users_options() -> GetReactingUsersOptions

Defaults:

  • only normal reactions
  • limit: 25
pub fn new_get_sku_subscriptions_options(
  for_user_with_id user_id: Snowflake(User),
) -> GetSkuSubscriptionsOptions

Default limit is 50.

pub fn new_global_message_command(
  named name: String,
) -> CreateGlobalMessageCommand

Name must be between 1 and 32 characters.

pub fn new_global_message_command_request(
  token token: Token,
  current_application_id application_id: Snowflake(Application),
  using create: CreateGlobalMessageCommand,
) -> request.Request(String)

Creating a command with the same name as an existing one will overwrite that command.

pub fn new_global_message_command_response(
  response: response.Response(String),
) -> Result(MessageCommand, RestError)

Response status codes:

  • 201 - new command created
  • 200 - existed command overwritten
pub fn new_global_message_command_with_allowed_contexts(
  create: CreateGlobalMessageCommand,
  contexts: List(CommandContext),
) -> CreateGlobalMessageCommand
pub fn new_global_message_command_with_allowed_installation_types(
  create: CreateGlobalMessageCommand,
  types: List(CommandInstallationType),
) -> CreateGlobalMessageCommand

Check CommandInstallationType documentation.

pub fn new_global_message_command_with_name_localizations(
  create: CreateGlobalMessageCommand,
  localizations: dict.Dict(Locale, String),
) -> CreateGlobalMessageCommand

Name must be between 1 and 32 characters.

pub fn new_global_message_command_with_required_permissions(
  create: CreateGlobalMessageCommand,
  permissions: List(Permission),
) -> CreateGlobalMessageCommand

Not using this function (default in new), will enable the command for everyone.

Passing an empty list will disable the command for everyone.

Passing a list with at least one permission will require those permissions to use the command.

pub fn new_global_slash_command(
  named name: String,
  with_description description: String,
) -> CreateGlobalSlashCommand

Name must be between 1 and 32 characters.

Description must be between 1 and 100 characters.

pub fn new_global_slash_command_request(
  token token: Token,
  current_application_id application_id: Snowflake(Application),
  using create: CreateGlobalSlashCommand,
) -> request.Request(String)

Creating a command with the same name as an existing one will overwrite that command.

pub fn new_global_slash_command_response(
  response: response.Response(String),
) -> Result(SlashCommand, RestError)

Response status codes:

  • 201 - new command created
  • 200 - existed command overwritten
pub fn new_global_slash_command_with_allowed_contexts(
  create: CreateGlobalSlashCommand,
  contexts: List(CommandContext),
) -> CreateGlobalSlashCommand
pub fn new_global_slash_command_with_allowed_installation_types(
  create: CreateGlobalSlashCommand,
  types: List(CommandInstallationType),
) -> CreateGlobalSlashCommand

Check CommandInstallationType documentation.

pub fn new_global_slash_command_with_description_localizations(
  create: CreateGlobalSlashCommand,
  localizations: dict.Dict(Locale, String),
) -> CreateGlobalSlashCommand

Description must be between 1 and 100 characters.

pub fn new_global_slash_command_with_name_localizations(
  create: CreateGlobalSlashCommand,
  localizations: dict.Dict(Locale, String),
) -> CreateGlobalSlashCommand

Name must be between 1 and 32 characters.

pub fn new_global_slash_command_with_options(
  create: CreateGlobalSlashCommand,
  options: List(SlashCommandOption),
) -> CreateGlobalSlashCommand

There is a limit of 25 options per command.

pub fn new_global_slash_command_with_required_permissions(
  create: CreateGlobalSlashCommand,
  permissions: List(Permission),
) -> CreateGlobalSlashCommand

Not using this function (default in new), will enable the command for everyone.

Passing an empty list will disable the command for everyone.

Passing a list with at least one permission will require those permissions to use the command.

pub fn new_global_user_command(
  named name: String,
) -> CreateGlobalUserCommand

Name must be between 1 and 32 characters.

pub fn new_global_user_command_request(
  token token: Token,
  current_application_id application_id: Snowflake(Application),
  using create: CreateGlobalUserCommand,
) -> request.Request(String)

Creating a command with the same name as an existing one will overwrite that command.

pub fn new_global_user_command_response(
  response: response.Response(String),
) -> Result(UserCommand, RestError)

Response status codes:

  • 201 - new command created
  • 200 - existed command overwritten
pub fn new_global_user_command_with_allowed_contexts(
  create: CreateGlobalUserCommand,
  contexts: List(CommandContext),
) -> CreateGlobalUserCommand
pub fn new_global_user_command_with_allowed_installation_types(
  create: CreateGlobalUserCommand,
  types: List(CommandInstallationType),
) -> CreateGlobalUserCommand

Check CommandInstallationType documentation.

pub fn new_global_user_command_with_name_localizations(
  create: CreateGlobalUserCommand,
  localizations: dict.Dict(Locale, String),
) -> CreateGlobalUserCommand

Name must be between 1 and 32 characters.

pub fn new_global_user_command_with_required_permissions(
  create: CreateGlobalUserCommand,
  permissions: List(Permission),
) -> CreateGlobalUserCommand

Not using this function (default in new), will enable the command for everyone.

Passing an empty list will disable the command for everyone.

Passing a list with at least one permission will require those permissions to use the command.

pub fn new_guild_channel_invite() -> CreateGuildChannelInvite
pub fn new_guild_channel_invite_request(
  token token: Token,
  channel_with_id id: Snowflake(GuildChannel),
  using create: CreateGuildChannelInvite,
  reason reason: option.Option(String),
) -> request.Request(BitArray)

Requires the AllowCreatingInstantInvites permission.

pub fn new_guild_channel_invite_response(
  response: response.Response(BitArray),
) -> Result(Invite, RestError)
pub fn new_guild_channel_invite_with_allowlist(
  create: CreateGuildChannelInvite,
  user_ids allowlist: List(Snowflake(User)),
) -> CreateGuildChannelInvite

Restricts who can accept the invite.

pub fn new_guild_channel_invite_with_automatically_awarded_roles(
  create: CreateGuildChannelInvite,
  role_ids role_ids: List(Snowflake(Role)),
) -> CreateGuildChannelInvite

Requires the AllowManagingRoles permission.

You cannot assign roles with higher permissions than the current user.

pub fn new_guild_channel_invite_with_expiration(
  create: CreateGuildChannelInvite,
  max_age: duration.Duration,
) -> CreateGuildChannelInvite

Defaults to 24 hours.

pub fn new_guild_channel_invite_with_max_uses(
  create: CreateGuildChannelInvite,
  max_uses: Int,
) -> CreateGuildChannelInvite
pub fn new_guild_channel_invite_with_target(
  create: CreateGuildChannelInvite,
  target: InviteTarget,
) -> CreateGuildChannelInvite
pub fn new_guild_message_command(
  named name: String,
) -> CreateGuildMessageCommand

Name must be between 1 and 32 characters.

pub fn new_guild_message_command_request(
  token token: Token,
  current_application_id application_id: Snowflake(Application),
  guild_id guild_id: Snowflake(Guild),
  using create: CreateGuildMessageCommand,
) -> request.Request(String)

Creating a command with the same name as an existing one will overwrite that command.

pub fn new_guild_message_command_with_name_localizations(
  create: CreateGuildMessageCommand,
  localizations: dict.Dict(Locale, String),
) -> CreateGuildMessageCommand

Name must be between 1 and 32 characters.

pub fn new_guild_message_command_with_required_permissions(
  create: CreateGuildMessageCommand,
  permissions: List(Permission),
) -> CreateGuildMessageCommand

Not using this function (default in new), will enable the command for everyone.

Passing an empty list will disable the command for everyone.

Passing a list with at least one permission will require those permissions to use the command.

pub fn new_guild_slash_command(
  named name: String,
  with_description description: String,
) -> CreateGuildSlashCommand

Name must be between 1 and 32 characters.

Description must be between 1 and 100 characters.

pub fn new_guild_slash_command_request(
  token token: Token,
  current_application_id application_id: Snowflake(Application),
  guild_id guild_id: Snowflake(Guild),
  using create: CreateGuildSlashCommand,
) -> request.Request(String)

Creating a command with the same name as an existing one will overwrite that command.

pub fn new_guild_slash_command_with_description_localizations(
  create: CreateGuildSlashCommand,
  localizations: dict.Dict(Locale, String),
) -> CreateGuildSlashCommand

Description must be between 1 and 100 characters.

pub fn new_guild_slash_command_with_name_localizations(
  create: CreateGuildSlashCommand,
  localizations: dict.Dict(Locale, String),
) -> CreateGuildSlashCommand

Name must be between 1 and 32 characters.

pub fn new_guild_slash_command_with_options(
  create: CreateGuildSlashCommand,
  options: List(SlashCommandOption),
) -> CreateGuildSlashCommand

There is a limit of 25 options per command.

pub fn new_guild_slash_command_with_required_permissions(
  create: CreateGuildSlashCommand,
  permissions: List(Permission),
) -> CreateGuildSlashCommand

Not using this function (default in new), will enable the command for everyone.

Passing an empty list will disable the command for everyone.

Passing a list with at least one permission will require those permissions to use the command.

pub fn new_guild_soundboard_sound(
  named name: String,
  data data: BitArray,
  content_type content_type: SoundboardSoundContentType,
) -> CreateGuildSoundboardSound

The data must be maximum 512 kB and maximum 5.2 seconds.

pub fn new_guild_soundboard_sound_request(
  token token: Token,
  in_guild_with_id guild_id: Snowflake(Guild),
  using create: CreateGuildSoundboardSound,
  reason reason: option.Option(String),
) -> request.Request(String)

Requires the AllowCreatingGuildExpressions permission

pub fn new_guild_soundboard_sound_response(
  response: response.Response(String),
) -> Result(SoundboardSound, RestError)
pub fn new_guild_soundboard_sound_with_volume(
  create: CreateGuildSoundboardSound,
  volume: Float,
) -> CreateGuildSoundboardSound

The volume will be clamped between 0.0 and 1.0, so make sure to provide a value within that range.

pub fn new_guild_sticker(
  named name: String,
  with_with_description description: String,
  with_tags tags: String,
  file file: File,
) -> CreateGuildSticker

Requirements:

  • name must be between 2 and 30 characters
  • description must be empty or between 2 and 100 characters
  • tags must be between 0 and 200 characters
  • the file must be a PNG, APNG, GIF or Lottie JSON file, maximum 512 KiB
  • only guilds with the GuildIsVerified or GuildIsPartnered features can upload Lottie stickers
  • animated stickers must be maximum 5 seconds long
  • stickers must be maximum 320x320px
pub fn new_guild_sticker_request(
  token token: Token,
  in_guild_with_id guild_id: Snowflake(Guild),
  using create: CreateGuildSticker,
  reason reason: option.Option(String),
) -> request.Request(BitArray)

Requires the AllowCreatingGuildExpressions permission.

pub fn new_guild_sticker_response(
  response: response.Response(BitArray),
) -> Result(GuildSticker, RestError)
pub fn new_guild_user_command(
  named name: String,
) -> CreateGuildUserCommand

Name must be between 1 and 32 characters.

pub fn new_guild_user_command_request(
  token token: Token,
  current_application_id application_id: Snowflake(Application),
  guild_id guild_id: Snowflake(Guild),
  using create: CreateGuildUserCommand,
) -> request.Request(String)

Creating a command with the same name as an existing one will overwrite that command.

pub fn new_guild_user_command_with_name_localizations(
  create: CreateGuildUserCommand,
  localizations: dict.Dict(Locale, String),
) -> CreateGuildUserCommand

Name must be between 1 and 32 characters.

pub fn new_guild_user_command_with_required_permissions(
  create: CreateGuildUserCommand,
  permissions: List(Permission),
) -> CreateGuildUserCommand

Not using this function (default in new), will enable the command for everyone.

Passing an empty list will disable the command for everyone.

Passing a list with at least one permission will require those permissions to use the command.

pub fn new_guild_welcome_screen_channel(
  with_id id: Snowflake(Channel),
  with_description description: String,
) -> GuildWelcomeScreenChannel
pub fn new_hoisted_role(create: CreateRole) -> CreateRole

Controls whether the role is shown separately in the sidebar.

pub fn new_inline_embed_field(
  create: CreateEmbedField,
) -> CreateEmbedField
pub fn new_int_slash_command_option(
  named name: String,
  with_description description: String,
) -> IntSlashCommandOption

The name must be between 1 and 32 characters.

The description must be between 1 and 100 characters.

pub fn new_int_slash_command_option_choice(
  named name: String,
  value value: Int,
) -> IntSlashCommandOptionChoice

Name must be between 1 and 100 characters.

pub fn new_int_slash_command_option_choice_with_name_localizations(
  choice: IntSlashCommandOptionChoice,
  localizations: dict.Dict(Locale, String),
) -> IntSlashCommandOptionChoice

Name must be between 1 and 100 characters.

pub fn new_int_slash_command_option_with_choices(
  option: IntSlashCommandOption,
  choices: List(IntSlashCommandOptionChoice),
) -> IntSlashCommandOption

If you hard-code choices, you cannot enable autocomplete.

There is a limit of 25 choices per option.

pub fn new_int_slash_command_option_with_description_localizations(
  option: IntSlashCommandOption,
  localizations: dict.Dict(Locale, String),
) -> IntSlashCommandOption

The description must be between 1 and 100 characters.

pub fn new_int_slash_command_option_with_enabled_autocomplete(
  option: IntSlashCommandOption,
) -> IntSlashCommandOption

Used for dynamic suggestion of choices based on user input.

The provided suggestions are not the only possible choices, and the user can still input anything, provided it fits in the character range.

You cannot use hard-coded choices if autocomplete is enabled.

pub fn new_int_slash_command_option_with_maximum_value(
  option: IntSlashCommandOption,
  value: Int,
) -> IntSlashCommandOption
pub fn new_int_slash_command_option_with_minimum_value(
  option: IntSlashCommandOption,
  value: Int,
) -> IntSlashCommandOption
pub fn new_int_slash_command_option_with_name_localizations(
  option: IntSlashCommandOption,
  localizations: dict.Dict(Locale, String),
) -> IntSlashCommandOption

The name must be between 1 and 32 characters.

pub fn new_interaction_response_message() -> InteractionResponseMessage
pub fn new_interaction_response_message_with_allowed_mentions(
  message: InteractionResponseMessage,
  allowed_mentions: List(AllowedMessageMention),
) -> InteractionResponseMessage

The default behavior of grom is not to allow any mentions.

pub fn new_interaction_response_message_with_attachments(
  message: InteractionResponseMessage,
  attachments: List(CreateMessageAttachment),
) -> InteractionResponseMessage
pub fn new_interaction_response_message_with_components(
  message: InteractionResponseMessage,
  components: List(CreateMessageComponent),
) -> InteractionResponseMessage

Make sure to set the InteractionResponseMessageUsesComponentsV2 flag if you’re using any V2 components!

pub fn new_interaction_response_message_with_content(
  message: InteractionResponseMessage,
  content: String,
) -> InteractionResponseMessage

Cannot be used with the InteractionResponseMessageUsesComponentsV2 flag.

pub fn new_interaction_response_message_with_poll(
  message: InteractionResponseMessage,
  poll: CreatePoll,
) -> InteractionResponseMessage

A message cannot contain a poll and any of the following: content, attachments, components, allowed mentions, embeds.

pub fn new_interaction_response_modal(
  custom_id custom_id: String,
  title title: String,
  components components: List(CreateModalComponent),
) -> InteractionResponseModal

Limitations:

  • custom ID must be between 1 and 100 characters
  • title must be maximum 45 characters
  • you must provide between 1 and 5 components (inclusive)
pub fn new_link_button(url url: String) -> CreateLinkButton
pub fn new_link_button_with_emoji(
  create: CreateLinkButton,
  emoji: ComponentEmoji,
) -> CreateLinkButton
pub fn new_link_button_with_id(
  create: CreateLinkButton,
  id: Int,
) -> CreateLinkButton
pub fn new_link_button_with_label(
  create: CreateLinkButton,
  label: String,
) -> CreateLinkButton

Label must be max 80 characters.

pub fn new_media_channel(
  named name: String,
) -> CreateMediaChannel
pub fn new_media_channel_at_position(
  create: CreateMediaChannel,
  position: Int,
) -> CreateMediaChannel

Channels without a specified position will automatically be assigned one at the bottom of their category/channel list. Channels with the same position are sorted by ID (new channel will be lower)

pub fn new_media_channel_request(
  token token: Token,
  in_guild_with_id guild_id: Snowflake(Guild),
  using create: CreateMediaChannel,
  reason reason: option.Option(String),
) -> request.Request(String)

Requires the AllowManagingChannels permission.

pub fn new_media_channel_response(
  response: response.Response(String),
) -> Result(MediaChannel, RestError)
pub fn new_media_channel_with_default_reaction(
  create: CreateMediaChannel,
  reaction: DefaultForumReaction,
) -> CreateMediaChannel

Controls the default reaction shown in the thread preview.

pub fn new_media_channel_with_default_sort_order(
  create: CreateMediaChannel,
  order: ForumSortOrder,
) -> CreateMediaChannel

Controls the default order of sorting the threads in the media.

pub fn new_media_channel_with_parent_id(
  create: CreateMediaChannel,
  parent_id: Snowflake(CategoryChannel),
) -> CreateMediaChannel

Puts the channel in a category. Channels without a parent ID will not be in a category, and will rather be independent in the server list.

pub fn new_media_channel_with_permission_overwrites(
  create: CreateMediaChannel,
  overwrites: List(PermissionOverwrite),
) -> CreateMediaChannel

You can only allow/deny permissions if your bot has those permissions. Setting the AllowManagingRoles permission requires your bot to have the AdministratorPermission.

pub fn new_media_channel_with_rate_limit_per_user(
  create: CreateMediaChannel,
  limit: RateLimitPerUser,
) -> CreateMediaChannel

The rate limit per user is the amount of time a user has to wait between sending messages.

pub fn new_media_channel_with_tags(
  create: CreateMediaChannel,
  tags: List(ForumTag),
) -> CreateMediaChannel
pub fn new_media_channel_with_thread_auto_archive_duration(
  create: CreateMediaChannel,
  duration: ThreadAutoArchiveDuration,
) -> CreateMediaChannel

Controls the default amount of time after which inactive threads are archived in the channel.

pub fn new_media_channel_with_thread_rate_limit_per_user(
  create: CreateMediaChannel,
  limit: RateLimitPerUser,
) -> CreateMediaChannel

The default thread rate limit per user. This value gets copied to every thread and does not live-update.

pub fn new_media_channel_with_topic(
  create: CreateMediaChannel,
  topic: String,
) -> CreateMediaChannel
pub fn new_media_gallery_item(
  media media: CreateUnfurledMediaItem,
) -> CreateMediaGalleryItem
pub fn new_media_gallery_item_with_description(
  create: CreateMediaGalleryItem,
  description: String,
) -> CreateMediaGalleryItem

Description must be max 1024 characters.

pub fn new_mentionable_role(create: CreateRole) -> CreateRole

Allows everyone the mention the role.

pub fn new_mentionable_slash_command_option(
  named name: String,
  with_description description: String,
) -> MentionableSlashCommandOption

The name must be between 1 and 32 characters.

The description must be between 1 and 100 characters.

pub fn new_mentionable_slash_command_option_with_description_localizations(
  option: MentionableSlashCommandOption,
  localizations: dict.Dict(Locale, String),
) -> MentionableSlashCommandOption

The description must be between 1 and 100 characters.

pub fn new_mentionable_slash_command_option_with_name_localizations(
  option: MentionableSlashCommandOption,
  localizations: dict.Dict(Locale, String),
) -> MentionableSlashCommandOption

The name must be between 1 and 32 characters.

pub fn new_message() -> CreateMessage

You must set at least one of content, embeds, sticker_ids, components, attachments, or poll.

If you’re forwarding a message, only reference is required.

By default, no mentions will be allowed.

pub fn new_message_action_row(
  components components: List(CreateActionRowComponent),
) -> CreateMessageActionRow

Components must be either up to 5 buttons or a single select component.

pub fn new_message_action_row_with_id(
  create: CreateMessageActionRow,
  id: Int,
) -> CreateMessageActionRow
pub fn new_message_attachment(
  file file: File,
) -> CreateMessageAttachment
pub fn new_message_attachment_with_description(
  create: CreateMessageAttachment,
  description: String,
) -> CreateMessageAttachment

Maximum 1024 characters.

pub fn new_message_attachment_with_title(
  create: CreateMessageAttachment,
  title: String,
) -> CreateMessageAttachment
pub fn new_message_channel_select(
  custom_id custom_id: String,
) -> CreateMessageChannelSelect
pub fn new_message_channel_select_with_channel_types(
  create: CreateMessageChannelSelect,
  channel_types: List(SelectChannelType),
) -> CreateMessageChannelSelect

Which channel types are to be included in the select window.

pub fn new_message_channel_select_with_default_channels(
  create: CreateMessageChannelSelect,
  default_channels: List(Snowflake(Channel)),
) -> CreateMessageChannelSelect

Which channels are to be selected by default.

pub fn new_message_channel_select_with_id(
  create: CreateMessageChannelSelect,
  id: Int,
) -> CreateMessageChannelSelect
pub fn new_message_channel_select_with_max_values(
  create: CreateMessageChannelSelect,
  max_values: Int,
) -> CreateMessageChannelSelect

Maximum amount of selected values, default 1.

Must be between 1 and 25.

pub fn new_message_channel_select_with_min_values(
  create: CreateMessageChannelSelect,
  min_values: Int,
) -> CreateMessageChannelSelect

Minimum amount of selected values, default 1.

Must be between 0 and 25.

pub fn new_message_channel_select_with_placeholder(
  create: CreateMessageChannelSelect,
  placeholder: String,
) -> CreateMessageChannelSelect

Shown when no value is selected. Maximum 150 characters.

pub fn new_message_container() -> CreateMessageContainer
pub fn new_message_container_with_accent_colour(
  create: CreateMessageContainer,
  accent_colour: colour.Colour,
) -> CreateMessageContainer
pub fn new_message_container_with_components(
  create: CreateMessageContainer,
  components: List(CreateContainerComponent),
) -> CreateMessageContainer
pub fn new_message_container_with_id(
  create: CreateMessageContainer,
  id: Int,
) -> CreateMessageContainer
pub fn new_message_embed() -> CreateMessageEmbed
pub fn new_message_embed_with_author(
  create: CreateMessageEmbed,
  author: CreateEmbedAuthor,
) -> CreateMessageEmbed
pub fn new_message_embed_with_colour(
  create: CreateMessageEmbed,
  colour: colour.Colour,
) -> CreateMessageEmbed
pub fn new_message_embed_with_description(
  create: CreateMessageEmbed,
  description: String,
) -> CreateMessageEmbed
pub fn new_message_embed_with_fields(
  create: CreateMessageEmbed,
  fields: List(CreateEmbedField),
) -> CreateMessageEmbed
pub fn new_message_embed_with_image(
  create: CreateMessageEmbed,
  image: CreateEmbedImage,
) -> CreateMessageEmbed
pub fn new_message_embed_with_thumbnail(
  create: CreateMessageEmbed,
  thumbnail: CreateEmbedImage,
) -> CreateMessageEmbed
pub fn new_message_embed_with_timestamp(
  create: CreateMessageEmbed,
  timestamp: timestamp.Timestamp,
) -> CreateMessageEmbed
pub fn new_message_embed_with_title(
  create: CreateMessageEmbed,
  title: String,
) -> CreateMessageEmbed
pub fn new_message_embed_with_url(
  create: CreateMessageEmbed,
  url: String,
) -> CreateMessageEmbed
pub fn new_message_file(
  file file: CreateUnfurledMediaItem,
) -> CreateMessageFile

The unfurled media item MUST contain an attachment URL.

pub fn new_message_file_with_id(
  create: CreateMessageFile,
  id: Int,
) -> CreateMessageFile
pub fn new_message_media_gallery(
  items items: List(CreateMediaGalleryItem),
) -> CreateMessageMediaGallery

A media gallery must contain between 1 and 10 items.

pub fn new_message_media_gallery_with_id(
  create: CreateMessageMediaGallery,
  id: Int,
) -> CreateMessageMediaGallery
pub fn new_message_mentionable_select(
  custom_id custom_id: String,
) -> CreateMessageMentionableSelect
pub fn new_message_mentionable_select_with_default_roles(
  create: CreateMessageMentionableSelect,
  default_roles: List(Snowflake(Role)),
) -> CreateMessageMentionableSelect

Which roles are to be selected by default.

pub fn new_message_mentionable_select_with_default_users(
  create: CreateMessageMentionableSelect,
  default_users: List(Snowflake(User)),
) -> CreateMessageMentionableSelect

Which users are to be selected by default.

pub fn new_message_mentionable_select_with_id(
  create: CreateMessageMentionableSelect,
  id: Int,
) -> CreateMessageMentionableSelect
pub fn new_message_mentionable_select_with_max_values(
  create: CreateMessageMentionableSelect,
  max_values: Int,
) -> CreateMessageMentionableSelect

Maximum amount of selected values, default 1.

Must be between 1 and 25.

pub fn new_message_mentionable_select_with_min_values(
  create: CreateMessageMentionableSelect,
  min_values: Int,
) -> CreateMessageMentionableSelect

Minimum amount of selected values, default 1.

Must be between 0 and 25.

pub fn new_message_mentionable_select_with_placeholder(
  create: CreateMessageMentionableSelect,
  placeholder: String,
) -> CreateMessageMentionableSelect

Shown when no value is selected. Maximum 150 characters.

pub fn new_message_reaction_request(
  token token: Token,
  in_channel_with_id channel_id: Snowflake(Channel),
  message_with_id message_id: Snowflake(Message),
  emoji emoji: MessageReactionEmoji,
) -> request.Request(String)

Required permissions in the target channel:

  • always - AllowReadingMessageHistory
  • if nobody else reacted to the message with this emoji - AllowAddingReactions
pub fn new_message_reaction_response(
  response: response.Response(String),
) -> Result(Nil, RestError)
pub fn new_message_reference_with_no_fail_if_original_not_exists(
  create: CreateMessageReference,
) -> CreateMessageReference

Makes it so that the message will send as a regular message instead of failing if the original message doesn’t exist.

pub fn new_message_request(
  token token: Token,
  in_channel_with_id channel_id: Snowflake(Channel),
  using create: CreateMessage,
) -> request.Request(BitArray)

If sending in a guild channel, requires the AllowSendingMessages permission.

pub fn new_message_response(
  response: response.Response(BitArray),
) -> Result(Message, RestError)
pub fn new_message_role_select(
  custom_id custom_id: String,
) -> CreateMessageRoleSelect
pub fn new_message_role_select_with_default_roles(
  create: CreateMessageRoleSelect,
  default_roles: List(Snowflake(Role)),
) -> CreateMessageRoleSelect

Which roles are to be selected by default.

pub fn new_message_role_select_with_id(
  create: CreateMessageRoleSelect,
  id: Int,
) -> CreateMessageRoleSelect
pub fn new_message_role_select_with_max_values(
  create: CreateMessageRoleSelect,
  max_values: Int,
) -> CreateMessageRoleSelect

Maximum amount of selected values, default 1.

Must be between 1 and 25.

pub fn new_message_role_select_with_min_values(
  create: CreateMessageRoleSelect,
  min_values: Int,
) -> CreateMessageRoleSelect

Minimum amount of selected values, default 1.

Must be between 0 and 25.

pub fn new_message_role_select_with_placeholder(
  create: CreateMessageRoleSelect,
  placeholder: String,
) -> CreateMessageRoleSelect

Shown when no value is selected. Maximum 150 characters.

pub fn new_message_section(
  children components: List(CreateSectionComponent),
  accessory accessory: CreateSectionAccessory,
) -> CreateMessageSection

A section must contain between 1 and 3 children.

pub fn new_message_section_with_id(
  create: CreateMessageSection,
  id: Int,
) -> CreateMessageSection
pub fn new_message_separator() -> CreateMessageSeparator

Defaults: visible divider, small spacing.

pub fn new_message_separator_with_id(
  create: CreateMessageSeparator,
  id: Int,
) -> CreateMessageSeparator
pub fn new_message_separator_with_large_spacing(
  create: CreateMessageSeparator,
) -> CreateMessageSeparator
pub fn new_message_separator_without_visible_divider(
  create: CreateMessageSeparator,
) -> CreateMessageSeparator
pub fn new_message_string_select(
  custom_id custom_id: String,
  options options: List(StringSelectOption),
) -> CreateMessageStringSelect
pub fn new_message_string_select_with_id(
  create: CreateMessageStringSelect,
  id: Int,
) -> CreateMessageStringSelect
pub fn new_message_string_select_with_max_values(
  create: CreateMessageStringSelect,
  max_values: Int,
) -> CreateMessageStringSelect

Maximum amount of selected values, default 1.

Must be between 1 and 25.

pub fn new_message_string_select_with_min_values(
  create: CreateMessageStringSelect,
  min_values: Int,
) -> CreateMessageStringSelect

Minimum amount of selected values, default 1.

Must be between 0 and 25.

pub fn new_message_string_select_with_placeholder(
  create: CreateMessageStringSelect,
  placeholder: String,
) -> CreateMessageStringSelect

Shown when no value is selected. Maximum 150 characters.

pub fn new_message_text_display(
  content content: String,
) -> CreateMessageTextDisplay
pub fn new_message_text_display_with_id(
  create: CreateMessageTextDisplay,
  id: Int,
) -> CreateMessageTextDisplay
pub fn new_message_thumbnail(
  media media: CreateUnfurledMediaItem,
) -> CreateMessageThumbnail
pub fn new_message_thumbnail_with_description(
  create: CreateMessageThumbnail,
  description: String,
) -> CreateMessageThumbnail

The description must be max 1024 characters.

pub fn new_message_thumbnail_with_id(
  create: CreateMessageThumbnail,
  id: Int,
) -> CreateMessageThumbnail
pub fn new_message_user_select(
  custom_id custom_id: String,
) -> CreateMessageUserSelect
pub fn new_message_user_select_with_default_users(
  create: CreateMessageUserSelect,
  default_users: List(Snowflake(User)),
) -> CreateMessageUserSelect

Which users are to be selected by default.

pub fn new_message_user_select_with_id(
  create: CreateMessageUserSelect,
  id: Int,
) -> CreateMessageUserSelect
pub fn new_message_user_select_with_max_values(
  create: CreateMessageUserSelect,
  max_values: Int,
) -> CreateMessageUserSelect

Maximum amount of selected values, default 1.

Must be between 1 and 25.

pub fn new_message_user_select_with_min_values(
  create: CreateMessageUserSelect,
  min_values: Int,
) -> CreateMessageUserSelect

Minimum amount of selected values, default 1.

Must be between 0 and 25.

pub fn new_message_user_select_with_placeholder(
  create: CreateMessageUserSelect,
  placeholder: String,
) -> CreateMessageUserSelect

Shown when no value is selected. Maximum 150 characters.

pub fn new_message_with_allowed_mentions(
  create: CreateMessage,
  allowed_mentions: List(AllowedMessageMention),
) -> CreateMessage

Please read the AllowedMessageMention documentation beforehand.

pub fn new_message_with_attachments(
  create: CreateMessage,
  attachments: List(CreateMessageAttachment),
) -> CreateMessage
pub fn new_message_with_components(
  create: CreateMessage,
  components: List(CreateMessageComponent),
) -> CreateMessage

If using Components V2, make sure to set the CreateMessageUsingComponentsV2 flag.

pub fn new_message_with_content(
  create: CreateMessage,
  content: String,
) -> CreateMessage

Content must be maximum 2000 characters.

pub fn new_message_with_embeds(
  create: CreateMessage,
  embeds: List(CreateMessageEmbed),
) -> CreateMessage
pub fn new_message_with_enforced_nonce(
  create: CreateMessage,
  nonce: MessageNonce,
) -> CreateMessage

With an enforced nonce, Discord will verify whether a message with the same nonce was sent by the bot in the past couple minutes.

If that is the case, the response will contain the older message and no new message will be created.

pub fn new_message_with_flags(
  create: CreateMessage,
  flags: List(CreateMessageFlag),
) -> CreateMessage
pub fn new_message_with_nonce(
  create: CreateMessage,
  nonce: MessageNonce,
) -> CreateMessage

A nonce is used to verify a message was sent through the gateway.

Verify message create events for that nonce to make sure a message was created.

pub fn new_message_with_poll(
  create: CreateMessage,
  poll: CreatePoll,
) -> CreateMessage
pub fn new_message_with_reference(
  create: CreateMessage,
  reference: CreateMessageReference,
) -> CreateMessage
pub fn new_message_with_stickers(
  create: CreateMessage,
  ids sticker_ids: List(Snowflake(Sticker)),
) -> CreateMessage
pub fn new_modal_channel_select(
  custom_id custom_id: String,
) -> CreateModalChannelSelect
pub fn new_modal_channel_select_with_channel_types(
  create: CreateModalChannelSelect,
  channel_types: List(SelectChannelType),
) -> CreateModalChannelSelect

Which channel types are to be included in the select window.

pub fn new_modal_channel_select_with_default_channels(
  create: CreateModalChannelSelect,
  default_channels: List(Snowflake(Channel)),
) -> CreateModalChannelSelect

Which channels are to be selected by default.

pub fn new_modal_channel_select_with_id(
  create: CreateModalChannelSelect,
  id: Int,
) -> CreateModalChannelSelect
pub fn new_modal_channel_select_with_max_values(
  create: CreateModalChannelSelect,
  max_values: Int,
) -> CreateModalChannelSelect

Maximum amount of selected values, default 1.

Must be between 1 and 25.

pub fn new_modal_channel_select_with_min_values(
  create: CreateModalChannelSelect,
  min_values: Int,
) -> CreateModalChannelSelect

Minimum amount of selected values, default 1.

Must be between 0 and 25.

pub fn new_modal_channel_select_with_placeholder(
  create: CreateModalChannelSelect,
  placeholder: String,
) -> CreateModalChannelSelect

Shown when no value is selected. Maximum 150 characters.

pub fn new_modal_checkbox(
  custom_id custom_id: String,
) -> CreateModalCheckbox
pub fn new_modal_checkbox_group(
  custom_id custom_id: String,
  options options: List(CreateCheckboxGroupOption),
) -> CreateModalCheckboxGroup
pub fn new_modal_checkbox_group_with_max_values(
  create: CreateModalCheckboxGroup,
  max_values: Int,
) -> CreateModalCheckboxGroup

Must be between 1 and 10.

pub fn new_modal_checkbox_group_with_min_values(
  create: CreateModalCheckboxGroup,
  min_values: Int,
) -> CreateModalCheckboxGroup

Must be between 1 and 10 if not optional.

Can be 0 if optional.

pub fn new_modal_checkbox_with_id(
  create: CreateModalCheckbox,
  id: Int,
) -> CreateModalCheckbox
pub fn new_modal_file_upload(
  custom_id custom_id: String,
) -> CreateModalFileUpload
pub fn new_modal_file_upload_with_file_type_filter(
  create: CreateModalFileUpload,
  filter: List(FileUploadFilter),
) -> CreateModalFileUpload

Providing an empty list will deny all files.

pub fn new_modal_file_upload_with_id(
  create: CreateModalFileUpload,
  id: Int,
) -> CreateModalFileUpload
pub fn new_modal_file_upload_with_max_values(
  create: CreateModalFileUpload,
  max_values: Int,
) -> CreateModalFileUpload

Must be between 1 and 10.

pub fn new_modal_file_upload_with_min_values(
  create: CreateModalFileUpload,
  min_values: Int,
) -> CreateModalFileUpload

Must be between 0 and 10.

pub fn new_modal_label(
  text label: String,
  component component: CreateModalLabelComponent,
) -> CreateModalLabel

The text must be maximum 45 characters.

pub fn new_modal_label_with_description(
  label: CreateModalLabel,
  description: String,
) -> CreateModalLabel

The description must be maximum 100 characters.

pub fn new_modal_label_with_id(
  label: CreateModalLabel,
  id: Int,
) -> CreateModalLabel
pub fn new_modal_mentionable_select(
  custom_id custom_id: String,
) -> CreateModalMentionableSelect
pub fn new_modal_mentionable_select_with_default_roles(
  create: CreateModalMentionableSelect,
  default_roles: List(Snowflake(Role)),
) -> CreateModalMentionableSelect

Which roles are to be selected by default.

pub fn new_modal_mentionable_select_with_default_users(
  create: CreateModalMentionableSelect,
  default_users: List(Snowflake(User)),
) -> CreateModalMentionableSelect

Which users are to be selected by default.

pub fn new_modal_mentionable_select_with_id(
  create: CreateModalMentionableSelect,
  id: Int,
) -> CreateModalMentionableSelect
pub fn new_modal_mentionable_select_with_max_values(
  create: CreateModalMentionableSelect,
  max_values: Int,
) -> CreateModalMentionableSelect

Maximum amount of selected values, default 1.

Must be between 1 and 25.

pub fn new_modal_mentionable_select_with_min_values(
  create: CreateModalMentionableSelect,
  min_values: Int,
) -> CreateModalMentionableSelect

Minimum amount of selected values, default 1.

Must be between 0 and 25.

pub fn new_modal_mentionable_select_with_placeholder(
  create: CreateModalMentionableSelect,
  placeholder: String,
) -> CreateModalMentionableSelect

Shown when no value is selected. Maximum 150 characters.

pub fn new_modal_radio_group(
  custom_id custom_id: String,
  options options: List(CreateRadioGroupOption),
) -> CreateModalRadioGroup
pub fn new_modal_radio_group_with_id(
  create: CreateModalRadioGroup,
  id: Int,
) -> CreateModalRadioGroup
pub fn new_modal_role_select(
  custom_id custom_id: String,
) -> CreateModalRoleSelect
pub fn new_modal_role_select_with_default_roles(
  create: CreateModalRoleSelect,
  default_roles: List(Snowflake(Role)),
) -> CreateModalRoleSelect

Which roles are to be selected by default.

pub fn new_modal_role_select_with_id(
  create: CreateModalRoleSelect,
  id: Int,
) -> CreateModalRoleSelect
pub fn new_modal_role_select_with_max_values(
  create: CreateModalRoleSelect,
  max_values: Int,
) -> CreateModalRoleSelect

Maximum amount of selected values, default 1.

Must be between 1 and 25.

pub fn new_modal_role_select_with_min_values(
  create: CreateModalRoleSelect,
  min_values: Int,
) -> CreateModalRoleSelect

Minimum amount of selected values, default 1.

Must be between 0 and 25.

pub fn new_modal_role_select_with_placeholder(
  create: CreateModalRoleSelect,
  placeholder: String,
) -> CreateModalRoleSelect

Shown when no value is selected. Maximum 150 characters.

pub fn new_modal_string_select(
  custom_id: String,
  options: List(StringSelectOption),
) -> CreateModalStringSelect
pub fn new_modal_string_select_with_id(
  create: CreateModalStringSelect,
  id: Int,
) -> CreateModalStringSelect
pub fn new_modal_string_select_with_max_values(
  create: CreateModalStringSelect,
  max_values: Int,
) -> CreateModalStringSelect

Maximum amount of selected values, default 1.

Must be between 1 and 25.

pub fn new_modal_string_select_with_min_values(
  create: CreateModalStringSelect,
  min_values: Int,
) -> CreateModalStringSelect

Minimum amount of selected values, default 1.

Must be between 0 and 25.

pub fn new_modal_string_select_with_placeholder(
  create: CreateModalStringSelect,
  placeholder: String,
) -> CreateModalStringSelect

The placeholder will be shown when no value is selected.

Maximum 150 characters.

pub fn new_modal_text_display(
  content content: String,
) -> CreateModalTextDisplay
pub fn new_modal_text_display_with_id(
  text_display: CreateModalTextDisplay,
  id: Int,
) -> CreateModalTextDisplay
pub fn new_modal_text_input(
  custom_id custom_id: String,
  style style: TextInputStyle,
) -> CreateModalTextInput

The custom ID must be between 1 and 100 characters.

pub fn new_modal_text_input_with_id(
  create: CreateModalTextInput,
  id: Int,
) -> CreateModalTextInput
pub fn new_modal_text_input_with_max_length(
  create: CreateModalTextInput,
  max_length: Int,
) -> CreateModalTextInput

Must be between 1 and 4000.

pub fn new_modal_text_input_with_min_length(
  create: CreateModalTextInput,
  min_length: Int,
) -> CreateModalTextInput

Must be between 0 and 4000.

pub fn new_modal_text_input_with_placeholder(
  create: CreateModalTextInput,
  placeholder: String,
) -> CreateModalTextInput
pub fn new_modal_text_input_with_prefilled_value(
  create: CreateModalTextInput,
  value: String,
) -> CreateModalTextInput
pub fn new_modal_user_select(
  custom_id custom_id: String,
) -> CreateModalUserSelect
pub fn new_modal_user_select_with_default_users(
  create: CreateModalUserSelect,
  default_users: List(Snowflake(User)),
) -> CreateModalUserSelect

Which users are to be selected by default.

pub fn new_modal_user_select_with_id(
  create: CreateModalUserSelect,
  id: Int,
) -> CreateModalUserSelect
pub fn new_modal_user_select_with_max_values(
  create: CreateModalUserSelect,
  max_values: Int,
) -> CreateModalUserSelect

Maximum amount of selected values, default 1.

Must be between 1 and 25.

pub fn new_modal_user_select_with_min_values(
  create: CreateModalUserSelect,
  min_values: Int,
) -> CreateModalUserSelect

Minimum amount of selected values, default 1.

Must be between 0 and 25.

pub fn new_modal_user_select_with_placeholder(
  create: CreateModalUserSelect,
  placeholder: String,
) -> CreateModalUserSelect

Shown when no value is selected. Maximum 150 characters.

pub fn new_modify_announcement_channel() -> ModifyAnnouncementChannel
pub fn new_modify_category_channel() -> ModifyCategoryChannel
pub fn new_modify_current_application() -> ModifyCurrentApplication
pub fn new_modify_current_guild_member() -> ModifyCurrentGuildMember
pub fn new_modify_current_user() -> ModifyCurrentUser
pub fn new_modify_forum_channel() -> ModifyForumChannel
pub fn new_modify_guild() -> ModifyGuild
pub fn new_modify_guild_channel_position(
  of_channel_with_id id: Snowflake(GuildChannel),
) -> ModifyGuildChannelPosition
pub fn new_modify_guild_incidents_data() -> ModifyGuildIncidentsData
pub fn new_modify_guild_member() -> ModifyGuildMember
pub fn new_modify_guild_soundboard_sound() -> ModifyGuildSoundboardSound
pub fn new_modify_guild_sticker() -> ModifyGuildSticker
pub fn new_modify_guild_welcome_screen() -> ModifyGuildWelcomeScreen
pub fn new_modify_guild_widget_settings() -> ModifyGuildWidgetSettings
pub fn new_modify_media_channel() -> ModifyMediaChannel
pub fn new_modify_message() -> ModifyMessage
pub fn new_modify_role() -> ModifyRole
pub fn new_modify_stage_channel() -> ModifyStageChannel
pub fn new_modify_text_channel() -> ModifyTextChannel
pub fn new_modify_thread() -> ModifyThread
pub fn new_modify_voice_channel() -> ModifyVoiceChannel
pub fn new_nsfw_announcement_channel(
  create: CreateAnnouncementChannel,
) -> CreateAnnouncementChannel

Creates an age-restricted announcement channel.

pub fn new_nsfw_global_message_command(
  create: CreateGlobalMessageCommand,
) -> CreateGlobalMessageCommand

This will only make the command usable in NSFW contexts.

pub fn new_nsfw_global_slash_command(
  create: CreateGlobalSlashCommand,
) -> CreateGlobalSlashCommand

This will only make the command usable in NSFW contexts.

pub fn new_nsfw_global_user_command(
  create: CreateGlobalUserCommand,
) -> CreateGlobalUserCommand

This will only make the command usable in NSFW contexts.

pub fn new_nsfw_guild_message_command(
  create: CreateGuildMessageCommand,
) -> CreateGuildMessageCommand

This will only make the command usable in NSFW contexts.

pub fn new_nsfw_guild_slash_command(
  create: CreateGuildSlashCommand,
) -> CreateGuildSlashCommand

This will only make the command usable in NSFW contexts.

pub fn new_nsfw_guild_user_command(
  create: CreateGuildUserCommand,
) -> CreateGuildUserCommand

This will only make the command usable in NSFW contexts.

pub fn new_nsfw_stage_channel(
  create: CreateStageChannel,
) -> CreateStageChannel

Creates an age-restricted stage channel.

pub fn new_nsfw_text_channel(
  create: CreateTextChannel,
) -> CreateTextChannel

Creates an age-restricted text channel.

pub fn new_nsfw_voice_channel(
  create: CreateVoiceChannel,
) -> CreateVoiceChannel

Creates an age-restricted voice channel.

pub fn new_optional_modal_file_upload(
  create: CreateModalFileUpload,
) -> CreateModalFileUpload
pub fn new_optional_modal_radio_group(
  create: CreateModalRadioGroup,
) -> CreateModalRadioGroup
pub fn new_optional_modal_role_select(
  create: CreateModalRoleSelect,
) -> CreateModalRoleSelect
pub fn new_optional_modal_text_input(
  create: CreateModalTextInput,
) -> CreateModalTextInput
pub fn new_optional_modal_user_select(
  create: CreateModalUserSelect,
) -> CreateModalUserSelect
pub fn new_poll(
  asking question: String,
  answers answers: List(CreatePollAnswer),
) -> CreatePoll

Defaults:

  • duration - 24 hours
  • doesn’t allow multiselect
pub fn new_poll_allowing_multiselect(
  create: CreatePoll,
) -> CreatePoll
pub fn new_poll_answer(text text: String) -> CreatePollAnswer

Text must be maximum 55 characters.

pub fn new_poll_answer_with_emoji(
  create: CreatePollAnswer,
  emoji: CreatePollAnswerEmoji,
) -> CreatePollAnswer
pub fn new_poll_with_duration(
  create: CreatePoll,
  duration: duration.Duration,
) -> CreatePoll

Duration must be max 32 days. Duration is rounded to the nearest hour.

pub fn new_premium_button(
  for_sku_with_id sku_id: Snowflake(Sku),
) -> CreatePremiumButton
pub fn new_premium_button_with_id(
  create: CreatePremiumButton,
  id: Int,
) -> CreatePremiumButton
pub fn new_prune_guild() -> PruneGuild

Defaults:

  • days: 7
  • include_roles: None
pub fn new_radio_group_option(
  label label: String,
  value value: String,
) -> CreateRadioGroupOption

Label and value must each be up to 100 characters.

pub fn new_radio_group_option_with_description(
  create: CreateRadioGroupOption,
  description: String,
) -> CreateRadioGroupOption

Description must be up to 100 characters.

pub fn new_regular_button(
  custom_id custom_id: String,
  style style: RegularButtonStyle,
) -> CreateRegularButton

Custom ID must be between 1 and 100 characters.

pub fn new_regular_button_with_emoji(
  create: CreateRegularButton,
  emoji: ComponentEmoji,
) -> CreateRegularButton
pub fn new_regular_button_with_id(
  create: CreateRegularButton,
  id: Int,
) -> CreateRegularButton
pub fn new_regular_button_with_label(
  create: CreateRegularButton,
  label: String,
) -> CreateRegularButton

Label must be max 80 characters.

pub fn new_reply_message_reference(
  original_message_id original_message_id: Snowflake(Message),
  original_guild_id original_guild_id: option.Option(
    Snowflake(Guild),
  ),
) -> CreateMessageReference

Allows you to make a new message be a reply to another message.

You MUST include the original guild ID unless the message was sent in a DM.

Requires the AllowReadingMessageHistory permission.

pub fn new_required_bool_slash_command_option(
  option: BoolSlashCommandOption,
) -> BoolSlashCommandOption
pub fn new_required_float_slash_command_option(
  option: FloatSlashCommandOption,
) -> FloatSlashCommandOption
pub fn new_required_int_slash_command_option(
  option: IntSlashCommandOption,
) -> IntSlashCommandOption
pub fn new_required_role_slash_command_option(
  option: RoleSlashCommandOption,
) -> RoleSlashCommandOption
pub fn new_required_string_slash_command_option(
  option: StringSlashCommandOption,
) -> StringSlashCommandOption
pub fn new_required_user_slash_command_option(
  option: UserSlashCommandOption,
) -> UserSlashCommandOption
pub fn new_role() -> CreateRole

Defaults:

  • name: “new role”
  • permissions: the same as the guild @everyone permissions
  • colours: { primary: 0, secondary: null, tertiary: null }
  • is_hoisted: false
  • icon: null
  • unicode_emoji: null
  • is_mentionable: false
pub fn new_role_colours() -> RoleColours
pub fn new_role_request(
  token token: Token,
  in_guild_with_id guild_id: Snowflake(Guild),
  using create: CreateRole,
  reason reason: option.Option(String),
) -> request.Request(String)

Requires the AllowManagingRoles permission.

pub fn new_role_response(
  response: response.Response(String),
) -> Result(Role, RestError)
pub fn new_role_slash_command_option(
  named name: String,
  with_description description: String,
) -> RoleSlashCommandOption

The name must be between 1 and 32 characters.

The description must be between 1 and 100 characters.

pub fn new_role_slash_command_option_with_description_localizations(
  option: RoleSlashCommandOption,
  localizations: dict.Dict(Locale, String),
) -> RoleSlashCommandOption

The description must be between 1 and 100 characters.

pub fn new_role_slash_command_option_with_name_localizations(
  option: RoleSlashCommandOption,
  localizations: dict.Dict(Locale, String),
) -> RoleSlashCommandOption

The name must be between 1 and 32 characters.

pub fn new_role_with_colours(
  create: CreateRole,
  colours: RoleColours,
) -> CreateRole
pub fn new_role_with_icon(
  create: CreateRole,
  icon: ImageData,
) -> CreateRole

Requires the GuildCanUseRoleIcons feature.

pub fn new_role_with_name(
  create: CreateRole,
  name: String,
) -> CreateRole
pub fn new_role_with_permissions(
  create: CreateRole,
  permissions: List(Permission),
) -> CreateRole

Controls the role’s guild-wide permissions.

pub fn new_role_with_unicode_emoji(
  create: CreateRole,
  emoji: String,
) -> CreateRole

Requires the GuildCanUseRoleIcons feature.

Accepts a unicode emoji character (e.g. 🔨)

pub fn new_snowflake(from id: Int) -> Snowflake(a)

Used for creating arbitary snowflakes.

This should only be used for hardcoding values or retrieving IDs from a database.

Don’t use this function to change Snowflake(a) to a Snowflake(b).

Example usage:

let guild_id: Snowflake(Guild) = new_snowflake(768594524158427167)
pub fn new_spoiler_media_gallery_item(
  create: CreateMediaGalleryItem,
) -> CreateMediaGalleryItem
pub fn new_spoiler_message_file(
  create: CreateMessageFile,
) -> CreateMessageFile
pub fn new_stage_channel(
  named name: String,
) -> CreateStageChannel
pub fn new_stage_channel_at_position(
  create: CreateStageChannel,
  position: Int,
) -> CreateStageChannel

Channels without a specified position will automatically be assigned one at the bottom of their category/channel list. Channels with the same position are sorted by ID (new channel will be lower)

pub fn new_stage_channel_request(
  token token: Token,
  in_guild_with_id guild_id: Snowflake(Guild),
  using create: CreateStageChannel,
  reason reason: option.Option(String),
) -> request.Request(String)

Requires the AllowManagingChannels permission.

pub fn new_stage_channel_response(
  response: response.Response(String),
) -> Result(StageChannel, RestError)
pub fn new_stage_channel_with_bitrate(
  create: CreateStageChannel,
  bitrate: Int,
) -> CreateStageChannel

Bitrate is expressed in bits per second.

Maximum bitrate for every premium tier:

  • No premium tier - 96000
  • Premium tier 1 - 128000
  • Premium tier 2 - 256000
  • Premium tier 3 - 384000

Additionally, servers with the GuildCanUse384KbpsstageBitrate can specify the bitrate up to 384000.

pub fn new_stage_channel_with_parent_id(
  create: CreateStageChannel,
  parent_id: Snowflake(CategoryChannel),
) -> CreateStageChannel

Puts the channel in a category. Channels without a parent ID will not be in a category, and will rather be independent in the server list.

pub fn new_stage_channel_with_permission_overwrites(
  create: CreateStageChannel,
  overwrites: List(PermissionOverwrite),
) -> CreateStageChannel

You can only allow/deny permissions if your bot has those permissions. Setting the AllowManagingRoles permission requires your bot to have the AdministratorPermission.

pub fn new_stage_channel_with_rate_limit_per_user(
  create: CreateStageChannel,
  limit: RateLimitPerUser,
) -> CreateStageChannel

The rate limit per user amount of time that a user has to wait between sending messages in the stage-channel attached text channel.

pub fn new_stage_channel_with_rtc_region_id(
  create: CreateStageChannel,
  id: String,
) -> CreateStageChannel

Manually sets the stage channel’s region.

pub fn new_stage_channel_with_user_limit(
  create: CreateStageChannel,
  user_limit: Int,
) -> CreateStageChannel
pub fn new_stage_channel_with_video_quality_mode(
  create: CreateStageChannel,
  mode: VideoQualityMode,
) -> CreateStageChannel
pub fn new_stage_instance(
  in_channel_with_id channel_id: Snowflake(StageChannel),
  topic topic: String,
) -> CreateStageInstance
pub fn new_stage_instance_for_scheduled_event(
  create: CreateStageInstance,
  scheduled_event_with_id scheduled_event_id: Snowflake(
    ScheduledEvent,
  ),
) -> CreateStageInstance
pub fn new_stage_instance_request(
  token token: Token,
  using create: CreateStageInstance,
  reason reason: option.Option(String),
) -> request.Request(String)

Requires the AllowManagingChannels, AllowMutingMembersInVoiceChannels, and AllowMovingMembersBetweenVoiceChannels permissions.

pub fn new_stage_instance_response(
  response: response.Response(String),
) -> Result(StageInstance, RestError)

Requires the AllowManagingChannels, AllowMutingMembersInVoiceChannels, and AllowMovingMembersBetweenVoiceChannels permissions.

pub fn new_stage_instance_with_start_notification(
  create: CreateStageInstance,
) -> CreateStageInstance

Notifies @everyone about the stage instance starting.

Requires the AllowMentioningEveryone permission.

pub fn new_string_select_option(
  label label: String,
  value value: String,
) -> StringSelectOption

Label is user-facing, value is dev-facing.

pub fn new_string_select_option_with_description(
  option: StringSelectOption,
  description: String,
) -> StringSelectOption

Description must be max 100 characters.

pub fn new_string_slash_command_option(
  named name: String,
  with_description description: String,
) -> StringSlashCommandOption

The name must be between 1 and 32 characters.

The description must be between 1 and 100 characters.

pub fn new_string_slash_command_option_choice(
  named name: String,
  value value: String,
) -> StringSlashCommandOptionChoice

Name and value must be between 1 and 100 characters each.

pub fn new_string_slash_command_option_choice_with_name_localizations(
  choice: StringSlashCommandOptionChoice,
  localizations: dict.Dict(Locale, String),
) -> StringSlashCommandOptionChoice

Name must be between 1 and 100 characters.

pub fn new_string_slash_command_option_with_choices(
  option: StringSlashCommandOption,
  choices: List(StringSlashCommandOptionChoice),
) -> StringSlashCommandOption

If you hard-code choices, you cannot enable autocomplete.

There is a limit of 25 choices per option.

pub fn new_string_slash_command_option_with_description_localizations(
  option: StringSlashCommandOption,
  localizations: dict.Dict(Locale, String),
) -> StringSlashCommandOption

The description must be between 1 and 100 characters.

pub fn new_string_slash_command_option_with_enabled_autocomplete(
  option: StringSlashCommandOption,
) -> StringSlashCommandOption

Used for dynamic suggestion of choices based on user input.

The provided suggestions are not the only possible choices, and the user can still input anything, provided it fits in the character range.

You cannot use hard-coded choices if autocomplete is enabled.

pub fn new_string_slash_command_option_with_maximum_length(
  option: StringSlashCommandOption,
  length: Int,
) -> StringSlashCommandOption

The maximum length must be between 1 and 6000.

pub fn new_string_slash_command_option_with_minimum_length(
  option: StringSlashCommandOption,
  length: Int,
) -> StringSlashCommandOption

The minimum length must be between 0 and 6000.

pub fn new_string_slash_command_option_with_name_localizations(
  option: StringSlashCommandOption,
  localizations: dict.Dict(Locale, String),
) -> StringSlashCommandOption

The name must be between 1 and 32 characters.

pub fn new_sub_command(
  named name: String,
  with_description description: String,
) -> SubCommandSlashCommandOption

The name must be between 1 and 32 characters.

The description must be between 1 and 100 characters.

pub fn new_sub_command_group(
  named name: String,
  with_description description: String,
) -> SubCommandGroupSlashCommandOption

The name must be between 1 and 32 characters.

The description must be between 1 and 100 characters.

pub fn new_sub_command_group_with_description_localizations(
  sub_command_group: SubCommandGroupSlashCommandOption,
  localizations: dict.Dict(Locale, String),
) -> SubCommandGroupSlashCommandOption

The description must be between 1 and 100 characters.

pub fn new_sub_command_group_with_name_localizations(
  sub_command_group: SubCommandGroupSlashCommandOption,
  localizations: dict.Dict(Locale, String),
) -> SubCommandGroupSlashCommandOption

The name must be between 1 and 32 characters.

pub fn new_sub_command_group_with_options(
  sub_command_group: SubCommandGroupSlashCommandOption,
  options: List(SubCommandGroupOption),
) -> SubCommandGroupSlashCommandOption
pub fn new_sub_command_with_description_localizations(
  sub_command: SubCommandSlashCommandOption,
  localizations: dict.Dict(Locale, String),
) -> SubCommandSlashCommandOption

The description must be between 1 and 100 characters.

pub fn new_sub_command_with_name_localizations(
  sub_command: SubCommandSlashCommandOption,
  localizations: dict.Dict(Locale, String),
) -> SubCommandSlashCommandOption

The name must be between 1 and 32 characters.

pub fn new_sub_command_with_options(
  sub_command: SubCommandSlashCommandOption,
  options: List(SubCommandOption),
) -> SubCommandSlashCommandOption

Required options must come before optional ones.

pub fn new_temporary_guild_channel_invite(
  create: CreateGuildChannelInvite,
) -> CreateGuildChannelInvite

A temporary invite only grants temporary membership.

pub fn new_text_channel(named name: String) -> CreateTextChannel

Requires the AllowManagingChannels permission.

pub fn new_text_channel_at_position(
  create: CreateTextChannel,
  position: Int,
) -> CreateTextChannel

Channels without a specified position will automatically be assigned one at the bottom of their category/channel list. Channels with the same position are sorted by ID (new channel will be lower)

pub fn new_text_channel_request(
  token token: Token,
  in_guild_with_id guild_id: Snowflake(Guild),
  using create: CreateTextChannel,
  reason reason: option.Option(String),
) -> request.Request(String)

Requires the AllowManagingChannels permission.

pub fn new_text_channel_response(
  response: response.Response(String),
) -> Result(TextChannel, RestError)
pub fn new_text_channel_with_parent_id(
  create: CreateTextChannel,
  parent_id: Snowflake(CategoryChannel),
) -> CreateTextChannel

Puts the channel in a category. Channels without a parent ID will not be in a category, and will rather be independent in the server list.

pub fn new_text_channel_with_permission_overwrites(
  create: CreateTextChannel,
  overwrites: List(PermissionOverwrite),
) -> CreateTextChannel

You can only allow/deny permissions if your bot has those permissions. Setting the AllowManagingRoles permission requires your bot to have the AdministratorPermission.

pub fn new_text_channel_with_rate_limit_per_user(
  create: CreateTextChannel,
  rate_limit_per_user: RateLimitPerUser,
) -> CreateTextChannel

The rate limit per user is the amount of time a user has to wait between sending messages.

pub fn new_text_channel_with_thread_auto_archive_duration(
  create: CreateTextChannel,
  duration: ThreadAutoArchiveDuration,
) -> CreateTextChannel

Controls the default amount of time after which inactive threads are archived in the channel.

pub fn new_text_channel_with_thread_rate_limit_per_user(
  create: CreateTextChannel,
  rate_limit_per_user: RateLimitPerUser,
) -> CreateTextChannel

The default thread rate limit per user. This value gets copied to every thread and does not live-update.

pub fn new_text_channel_with_topic(
  create: CreateTextChannel,
  topic: String,
) -> CreateTextChannel
pub fn new_thread(
  named name: String,
  of_type type_: ThreadType,
) -> CreateThread
pub fn new_thread_from_message(
  named name: String,
) -> CreateThreadFromMessage
pub fn new_thread_from_message_request(
  token token: Token,
  in_channel_with_id channel_id: Snowflake(ThreadCreatableChannel),
  message_with_id message_id: Snowflake(Message),
  using create: CreateThreadFromMessage,
  reason reason: option.Option(String),
) -> request.Request(String)

Behavior:

  • in text channels - creates a PublicThread
  • in announcement channels - creates an AnnouncementThread
  • the ID of the created thread will be the same as the message’s ID
  • you can only create 1 thread per message
pub fn new_thread_from_message_response(
  response: response.Response(String),
) -> Result(Thread, RestError)
pub fn new_thread_from_message_with_auto_archive_duration(
  create: CreateThreadFromMessage,
  duration: ThreadAutoArchiveDuration,
) -> CreateThreadFromMessage
pub fn new_thread_from_message_with_rate_limit_per_user(
  create: CreateThreadFromMessage,
  limit: RateLimitPerUser,
) -> CreateThreadFromMessage
pub fn new_thread_request(
  token token: Token,
  in_channel_with_id channel_id: Snowflake(ThreadCreatableChannel),
  using create: CreateThread,
  reason reason: option.Option(String),
) -> request.Request(String)
pub fn new_thread_with_auto_archive_duration(
  create: CreateThread,
  duration: ThreadAutoArchiveDuration,
) -> CreateThread
pub fn new_thread_with_rate_limit_per_user(
  create: CreateThread,
  limit: RateLimitPerUser,
) -> CreateThread
pub fn new_tts_interaction_response_message(
  message: InteractionResponseMessage,
) -> InteractionResponseMessage

Makes the message be read out loud using text-to-speech.

Requires the AllowSendingTtsMessages permission and content to be set.

pub fn new_tts_message(create: CreateMessage) -> CreateMessage

A text-to-speech message will be read out-loud to all readers.

Requires the AllowSendingTtsMessages permission.

pub fn new_unfurled_media_item(
  url url: String,
) -> CreateUnfurledMediaItem

Supports HTTPS and attachment URLs.

pub fn new_unique_guild_channel_invite(
  create: CreateGuildChannelInvite,
) -> CreateGuildChannelInvite

Will force creating a new code, won’t reuse similar invites.

pub fn new_user_slash_command_option(
  named name: String,
  with_description description: String,
) -> UserSlashCommandOption

The name must be between 1 and 32 characters.

The description must be between 1 and 100 characters.

pub fn new_user_slash_command_option_with_description_localizations(
  option: UserSlashCommandOption,
  localizations: dict.Dict(Locale, String),
) -> UserSlashCommandOption

The description must be between 1 and 100 characters.

pub fn new_user_slash_command_option_with_name_localizations(
  option: UserSlashCommandOption,
  localizations: dict.Dict(Locale, String),
) -> UserSlashCommandOption

The name must be between 1 and 32 characters.

pub fn new_voice_channel(
  named name: String,
) -> CreateVoiceChannel
pub fn new_voice_channel_at_position(
  create: CreateVoiceChannel,
  position: Int,
) -> CreateVoiceChannel

Channels without a specified position will automatically be assigned one at the bottom of their category/channel list. Channels with the same position are sorted by ID (new channel will be lower)

pub fn new_voice_channel_request(
  token token: Token,
  in_guild_with_id guild_id: Snowflake(Guild),
  using create: CreateVoiceChannel,
  reason reason: option.Option(String),
) -> request.Request(String)

Requires the AllowManagingChannels permission.

pub fn new_voice_channel_response(
  response: response.Response(String),
) -> Result(VoiceChannel, RestError)
pub fn new_voice_channel_with_bitrate(
  create: CreateVoiceChannel,
  bitrate: Int,
) -> CreateVoiceChannel

Bitrate is expressed in bits per second.

Maximum bitrate for every premium tier:

  • No premium tier - 96000
  • Premium tier 1 - 128000
  • Premium tier 2 - 256000
  • Premium tier 3 - 384000

Additionally, servers with the GuildCanUse384KbpsVoiceBitrate can specify the bitrate up to 384000.

pub fn new_voice_channel_with_parent_id(
  create: CreateVoiceChannel,
  parent_id: Snowflake(CategoryChannel),
) -> CreateVoiceChannel

Puts the channel in a category. Channels without a parent ID will not be in a category, and will rather be independent in the server list.

pub fn new_voice_channel_with_permission_overwrites(
  create: CreateVoiceChannel,
  overwrites: List(PermissionOverwrite),
) -> CreateVoiceChannel

You can only allow/deny permissions if your bot has those permissions. Setting the AllowManagingRoles permission requires your bot to have the AdministratorPermission.

pub fn new_voice_channel_with_rate_limit_per_user(
  create: CreateVoiceChannel,
  limit: RateLimitPerUser,
) -> CreateVoiceChannel

The rate limit per user amount of time that a user has to wait between sending messages in the voice-channel attached text channel.

pub fn new_voice_channel_with_rtc_region_id(
  create: CreateVoiceChannel,
  id: String,
) -> CreateVoiceChannel

Manually sets the voice channel’s region.

pub fn new_voice_channel_with_user_limit(
  create: CreateVoiceChannel,
  user_limit: Int,
) -> CreateVoiceChannel
pub fn new_voice_channel_with_video_quality_mode(
  create: CreateVoiceChannel,
  mode: VideoQualityMode,
) -> CreateVoiceChannel
pub fn optional_to_json(
  option: option.Option(a),
  name: String,
  encoder: fn(a) -> json.Json,
) -> Result(#(String, json.Json), Nil)
pub fn permission_overwrite_decoder() -> decode.Decoder(
  PermissionOverwrite,
)
pub fn permission_overwrite_to_json(
  overwrite: PermissionOverwrite,
) -> json.Json
pub fn pin_message_request(
  token token: Token,
  in_channel_with_id channel_id: Snowflake(GuildChannel),
  message_with_id message_id: Snowflake(Message),
  reason reason: option.Option(String),
) -> request.Request(String)

Requires the AllowPinningMessages permission.

pub fn pin_message_response(
  response: response.Response(String),
) -> Result(Nil, RestError)
pub fn poll_answer_count_decoder() -> decode.Decoder(
  PollAnswerCount,
)
pub fn poll_answer_decoder() -> decode.Decoder(PollAnswer)
pub fn poll_decoder() -> decode.Decoder(Poll)
pub fn poll_results_decoder() -> decode.Decoder(PollResults)
pub fn prune_guild_request(
  token token: Token,
  with_id guild_id: Snowflake(Guild),
  using prune: PruneGuild,
  reason reason: option.Option(String),
) -> request.Request(String)

Requires the AllowManagingGuild and AllowKickingMembers permissions.

Kicks inactive members based on the provided options.

pub fn prune_guild_response(
  response: response.Response(String),
) -> Result(Nil, RestError)
pub fn prune_guild_to_json(prune: PruneGuild) -> json.Json
pub fn prune_guild_with_count_request(
  token token: Token,
  with_id guild_id: Snowflake(Guild),
  using prune: PruneGuild,
  reason reason: option.Option(String),
) -> request.Request(String)

Not recommended for large guilds, use prune_guild instead.

Requires the AllowManagingGuild and AllowKickingMembers permissions.

Kicks inactive members based on the provided options.

Returns the amount of members who have been kicked.

pub fn prune_guild_with_count_response(
  response: response.Response(String),
) -> Result(Int, RestError)
pub fn prune_guild_with_included_roles(
  prune: PruneGuild,
  roles: List(Snowflake(Role)),
) -> PruneGuild

Pruning will, by default, only kick members with no roles. Include any roles which you count as prunable.

pub fn prune_guild_with_required_inactive_days(
  prune: PruneGuild,
  days: Int,
) -> PruneGuild

The minimum number of days is 1 and the maximum number of days is 30. Numbers not within these bounds will kick the closest amount of time (1 or 30 days).

pub fn rate_limit_per_user(
  taking duration: duration.Duration,
) -> RateLimitPerUser

Represents the amount of time between a user has to wait between sending a message or creating a thread.

Bots and members with the AllowBypassingSlowmode permission are exempt from slowmode.

Rate limits per user must be between 0 and 21600 seconds (7.22 hours). The value will be clamped within the bounds.

pub fn rate_limit_per_user_decoder() -> decode.Decoder(
  RateLimitPerUser,
)
pub fn rate_limit_per_user_to_duration(
  limit: RateLimitPerUser,
) -> duration.Duration
pub fn rate_limit_per_user_to_json(
  limit: RateLimitPerUser,
) -> json.Json
pub fn regular_button_style_decoder() -> decode.Decoder(
  RegularButtonStyle,
)
pub fn regular_button_style_to_json(
  style: RegularButtonStyle,
) -> json.Json
pub fn remove_all_guild_member_roles(
  modify: ModifyGuildMember,
) -> ModifyGuildMember

Requires the AllowManagingRoles permission.

Does not actually delete the roles - only removes them from the member.

pub fn remove_guild_banner(modify: ModifyGuild) -> ModifyGuild
pub fn remove_guild_description(
  modify: ModifyGuild,
) -> ModifyGuild
pub fn remove_guild_icon(modify: ModifyGuild) -> ModifyGuild
pub fn remove_guild_member_nick(
  modify: ModifyGuildMember,
) -> ModifyGuildMember

Requires the AllowManagingNicknames permission.

pub fn remove_guild_splash(modify: ModifyGuild) -> ModifyGuild
pub fn remove_member_from_thread(
  token token: Token,
  thread_with_id thread_id: Snowflake(Thread),
  member_with_id member_id: Snowflake(User),
) -> request.Request(String)

The thread mustn’t be archived.

Requires the AllowManagingThreads permission or the current user to be the thread’s creator if it’s a private thread.

pub fn remove_member_from_thread_response(
  response: response.Response(String),
) -> Result(Nil, RestError)
pub fn remove_role_from_guild_member_request(
  token token: Token,
  in_guild_with_id guild_id: Snowflake(Guild),
  from_member_with_id user_id: Snowflake(User),
  with_id role_id: Snowflake(Role),
  reason reason: option.Option(String),
) -> request.Request(String)

Requires the AllowManagingRoles permission.

pub fn remove_role_from_guild_member_response(
  response: response.Response(String),
) -> Result(Nil, RestError)
pub fn remove_role_icon(modify: ModifyRole) -> ModifyRole
pub fn reset_guild_default_message_notification_setting(
  modify: ModifyGuild,
) -> ModifyGuild

Resets the guild’s default message notification setting back to default.

pub fn reset_guild_explicit_content_filter_setting(
  modify: ModifyGuild,
) -> ModifyGuild

Resets the guild’s explicit content filter setting back to default.

pub fn reset_guild_member_verification_level(
  modify: ModifyGuild,
) -> ModifyGuild

Resets the guild’s member verification level back to default.

pub fn reset_role_name(modify: ModifyRole) -> ModifyRole

Resets the role’s name to “new name”.

pub fn reset_stage_channel_bitrate(
  modify: ModifyStageChannel,
) -> ModifyStageChannel
pub fn reset_voice_channel_bitrate(
  modify: ModifyVoiceChannel,
) -> ModifyVoiceChannel
pub fn resolved_channel_decoder() -> decode.Decoder(
  ResolvedChannel,
)
pub fn resolved_dm_channel_decoder() -> decode.Decoder(
  ResolvedDmChannel,
)
pub fn resolved_forum_channel_decoder() -> decode.Decoder(
  ResolvedForumChannel,
)
pub fn resolved_guild_member_decoder() -> decode.Decoder(
  ResolvedGuildMember,
)
pub fn resolved_media_channel_decoder() -> decode.Decoder(
  ResolvedMediaChannel,
)
pub fn resolved_stage_channel_decoder() -> decode.Decoder(
  ResolvedStageChannel,
)
pub fn resolved_text_channel_decoder() -> decode.Decoder(
  ResolvedTextChannel,
)
pub fn resolved_voice_channel_decoder() -> decode.Decoder(
  ResolvedVoiceChannel,
)
pub fn respond_to_autocomplete_request_interaction_request(
  token token: Token,
  id interaction_id: Snowflake(Interaction),
  interaction_token interaction_token: AutocompleteRequestInteractionToken,
  with response: AutocompleteRequestInteractionResponse,
) -> request.Request(String)
pub fn respond_to_autocomplete_request_interaction_response(
  response: response.Response(String),
) -> Result(Nil, RestError)
pub fn respond_to_command_interaction_request(
  token token: Token,
  id interaction_id: Snowflake(Interaction),
  interaction_token interaction_token: CommandInteractionToken,
  with response: CommandInteractionResponse,
) -> request.Request(BitArray)
pub fn respond_to_command_interaction_response(
  response: response.Response(BitArray),
) -> Result(Nil, RestError)
pub fn respond_to_command_interaction_with_message(
  message: InteractionResponseMessage,
) -> CommandInteractionResponse
pub fn respond_to_float_autocomplete_request_interaction(
  choices: List(FloatSlashCommandOptionChoice),
) -> AutocompleteRequestInteractionResponse

You can provide up to 25 choices.

pub fn respond_to_int_autocomplete_request_interaction(
  choices: List(IntSlashCommandOptionChoice),
) -> AutocompleteRequestInteractionResponse

You can provide up to 25 choices.

pub fn respond_to_message_component_interaction_request(
  token token: Token,
  id interaction_id: Snowflake(Interaction),
  interaction_token interaction_token: MessageComponentInteractionToken,
  with response: MessageComponentInteractionResponse,
) -> request.Request(BitArray)
pub fn respond_to_message_component_interaction_response(
  response: response.Response(BitArray),
) -> Result(Nil, RestError)
pub fn respond_to_message_component_interaction_with_message(
  message: InteractionResponseMessage,
) -> MessageComponentInteractionResponse

Responds by replying to the original component’s message.

pub fn respond_to_message_component_interaction_with_message_update(
  message: InteractionResponseMessage,
) -> MessageComponentInteractionResponse

Responds by editing the original component’s message.

pub fn respond_to_modal_interaction_request(
  token token: Token,
  id interaction_id: Snowflake(Interaction),
  interaction_token interaction_token: ModalInteractionToken,
  with response: ModalInteractionResponse,
) -> request.Request(BitArray)
pub fn respond_to_modal_interaction_response(
  response: response.Response(BitArray),
) -> Result(Nil, RestError)
pub fn respond_to_modal_interaction_with_message(
  message: InteractionResponseMessage,
) -> ModalInteractionResponse
pub fn respond_to_string_autocomplete_request_interaction(
  choices: List(StringSlashCommandOptionChoice),
) -> AutocompleteRequestInteractionResponse

You can provide up to 25 choices.

pub fn role_colours_decoder() -> decode.Decoder(RoleColours)
pub fn role_colours_to_json(
  role_colours: RoleColours,
) -> json.Json
pub fn role_colours_with_primary_colour(
  colours: RoleColours,
  colour: colour.Colour,
) -> RoleColours
pub fn role_colours_with_secondary_colour(
  colours: RoleColours,
  colour: colour.Colour,
) -> RoleColours
pub fn role_colours_with_tertiary_colour(
  colours: RoleColours,
  colour: colour.Colour,
) -> RoleColours
pub fn role_decoder() -> decode.Decoder(Role)
pub fn role_select_default_value_to_json(
  id: Snowflake(Role),
) -> json.Json
pub fn role_slash_command_option_decoder() -> decode.Decoder(
  RoleSlashCommandOption,
)
pub fn role_slash_command_option_to_json(
  option: RoleSlashCommandOption,
) -> json.Json
pub fn scheduled_event_location_decoder() -> decode.Decoder(
  ScheduledEventLocation,
)
pub fn scheduled_event_status_decoder() -> decode.Decoder(
  ScheduledEventStatus,
)
pub fn search_guild_members_request(
  token token: Token,
  in_guild_with_id guild_id: Snowflake(Guild),
  search_query query: String,
  limit limit: Int,
) -> request.Request(String)

The API will respond with one member for limits smaller than 1, and with 1000 members for limits larger than 1000.

pub fn search_guild_members_response(
  response: response.Response(String),
) -> Result(List(GuildMember), RestError)
pub fn section_accessory_decoder() -> decode.Decoder(
  SectionAccessory,
)
pub fn section_component_decoder() -> decode.Decoder(
  SectionComponent,
)
pub fn select_channel_type_decoder() -> decode.Decoder(
  SelectChannelType,
)
pub fn select_channel_type_to_json(
  type_: SelectChannelType,
) -> json.Json
pub fn send_soundboard_sound_request(
  token token: Token,
  in_channel_with_id channel_id: Snowflake(VoiceLikeChannel),
  sound_with_id sound_id: Snowflake(SoundboardSound),
  sound_from_guild_with_id source_guild_id: option.Option(
    Snowflake(Guild),
  ),
) -> request.Request(String)

Requirements:

  • must have the AllowSpeakingInVoiceChannels and AllowUsingSoundboard permissions
  • must be connected to the channel
  • must not be muted, deafened or suppressed
  • if using a sound from another guild:
    • must supply the source guild ID
    • must additionally have the AllowUsingExternalSoundboardSounds permission

Do not supply the source guild ID if the sound is from a default pack/the channel’s guild.

pub fn send_soundboard_sound_response(
  response: response.Response(String),
) -> Result(Nil, RestError)
pub fn separator_spacing_decoder() -> decode.Decoder(
  SeparatorSpacing,
)
pub fn separator_spacing_to_json(
  spacing: SeparatorSpacing,
) -> json.Json
pub fn set_forum_channel_as_nsfw(
  modify: ModifyForumChannel,
) -> ModifyForumChannel
pub fn set_forum_channel_as_sfw(
  modify: ModifyForumChannel,
) -> ModifyForumChannel
pub fn set_global_message_command_as_nsfw(
  modify: ModifyGlobalMessageCommand,
) -> ModifyGlobalMessageCommand

This will only make the command usable in NSFW contexts.

pub fn set_global_message_command_as_sfw(
  modify: ModifyGlobalMessageCommand,
) -> ModifyGlobalMessageCommand

This will only make the command also available outside of NSFW contexts.

pub fn set_global_slash_command_as_nsfw(
  modify: ModifyGlobalSlashCommand,
) -> ModifyGlobalSlashCommand

This will only make the command usable in NSFW contexts.

pub fn set_global_slash_command_as_sfw(
  modify: ModifyGlobalSlashCommand,
) -> ModifyGlobalSlashCommand

This will only make the command also available outside of NSFW contexts.

pub fn set_global_user_command_as_nsfw(
  modify: ModifyGlobalUserCommand,
) -> ModifyGlobalUserCommand

This will only make the command usable in NSFW contexts.

pub fn set_global_user_command_as_sfw(
  modify: ModifyGlobalUserCommand,
) -> ModifyGlobalUserCommand

This will only make the command also available outside of NSFW contexts.

pub fn set_guild_message_command_as_nsfw(
  modify: ModifyGuildMessageCommand,
) -> ModifyGuildMessageCommand

This will only make the command usable in NSFW contexts.

pub fn set_guild_message_command_as_sfw(
  modify: ModifyGuildMessageCommand,
) -> ModifyGuildMessageCommand

This will only make the command also available outside of NSFW contexts.

pub fn set_guild_slash_command_as_nsfw(
  modify: ModifyGuildSlashCommand,
) -> ModifyGuildSlashCommand

This will only make the command usable in NSFW contexts.

pub fn set_guild_slash_command_as_sfw(
  modify: ModifyGuildSlashCommand,
) -> ModifyGuildSlashCommand

This will only make the command also available outside of NSFW contexts.

pub fn set_guild_user_command_as_nsfw(
  modify: ModifyGuildUserCommand,
) -> ModifyGuildUserCommand

This will only make the command usable in NSFW contexts.

pub fn set_guild_user_command_as_sfw(
  modify: ModifyGuildUserCommand,
) -> ModifyGuildUserCommand

This will only make the command also available outside of NSFW contexts.

pub fn set_media_channel_as_nsfw(
  modify: ModifyMediaChannel,
) -> ModifyMediaChannel
pub fn set_media_channel_as_sfw(
  modify: ModifyMediaChannel,
) -> ModifyMediaChannel
pub fn set_stage_channel_as_nsfw(
  modify: ModifyStageChannel,
) -> ModifyStageChannel
pub fn set_stage_channel_as_sfw(
  modify: ModifyStageChannel,
) -> ModifyStageChannel
pub fn set_text_channel_as_nsfw(
  modify: ModifyTextChannel,
) -> ModifyTextChannel
pub fn set_text_channel_as_sfw(
  modify: ModifyTextChannel,
) -> ModifyTextChannel
pub fn set_thread_as_invitable(
  modify: ModifyThread,
) -> ModifyThread

Non-moderators can add other non-moderators to an invitable thread.

Only available on private threads.

pub fn set_thread_as_uninvitable(
  modify: ModifyThread,
) -> ModifyThread

Non-moderators can add other non-moderators to an invitable thread.

Only available on private threads.

pub fn set_voice_channel_as_nsfw(
  modify: ModifyVoiceChannel,
) -> ModifyVoiceChannel
pub fn set_voice_channel_as_sfw(
  modify: ModifyVoiceChannel,
) -> ModifyVoiceChannel
pub fn set_voice_channel_status_request(
  token token: Token,
  channel_with_id id: Snowflake(VoiceChannel),
  new status: option.Option(String),
  reason reason: option.Option(String),
) -> request.Request(String)

Requires the AllowSettingVoiceChannelStatus permission.

Additionally requires the AllowManagingChannels permission if the current user isn’t connected to the specified channel.

pub fn set_voice_channel_status_response(
  response: response.Response(String),
) -> Result(Nil, RestError)
pub fn sku_decoder() -> decode.Decoder(Sku)
pub fn sku_type_decoder() -> decode.Decoder(SkuType)
pub fn slash_command_decoder() -> decode.Decoder(SlashCommand)
pub fn slash_command_option_decoder() -> decode.Decoder(
  SlashCommandOption,
)
pub fn slash_command_option_to_json(
  option: SlashCommandOption,
) -> json.Json
pub fn snowflake_decoder() -> decode.Decoder(Snowflake(a))
pub fn snowflake_to_int(snowflake: Snowflake(a)) -> Int
pub fn snowflake_to_json(snowflake: Snowflake(a)) -> json.Json
pub fn soundboard_sound_decoder() -> decode.Decoder(
  SoundboardSound,
)
pub fn soundboard_sound_emoji_to_json(
  emoji: option.Option(SoundboardSoundEmoji),
) -> Result(#(String, json.Json), Nil)
pub fn stage_channel_decoder() -> decode.Decoder(StageChannel)
pub fn standard_sticker_decoder() -> decode.Decoder(
  StandardSticker,
)
pub fn sticker_decoder() -> decode.Decoder(Sticker)
pub fn sticker_format_type_decoder() -> decode.Decoder(
  StickerFormatType,
)
pub fn sticker_item_decoder() -> decode.Decoder(StickerItem)
pub fn sticker_pack_decoder() -> decode.Decoder(StickerPack)
pub fn string_select_option_decoder() -> decode.Decoder(
  StringSelectOption,
)
pub fn string_select_option_to_json(
  option: StringSelectOption,
) -> json.Json
pub fn string_slash_command_option_choice_to_json(
  choice: StringSlashCommandOptionChoice,
) -> json.Json
pub fn string_slash_command_option_to_json(
  option: StringSlashCommandOption,
) -> json.Json
pub fn sub_command_group_option_decoder() -> decode.Decoder(
  SubCommandGroupOption,
)
pub fn sub_command_group_option_to_json(
  option: SubCommandGroupOption,
) -> json.Json
pub fn sub_command_group_slash_command_option_to_json(
  option: SubCommandGroupSlashCommandOption,
) -> json.Json
pub fn sub_command_option_decoder() -> decode.Decoder(
  SubCommandOption,
)
pub fn sub_command_option_to_json(
  option: SubCommandOption,
) -> json.Json
pub fn sub_command_slash_command_option_to_json(
  option: SubCommandSlashCommandOption,
) -> json.Json
pub fn submitted_modal_checkbox_decoder() -> decode.Decoder(
  SubmittedModalCheckbox,
)
pub fn submitted_modal_label_decoder() -> decode.Decoder(
  SubmittedModalLabel,
)
pub fn submitted_modal_text_input_decoder() -> decode.Decoder(
  SubmittedModalTextInput,
)
pub fn subscription_status_decoder() -> decode.Decoder(
  SubscriptionStatus,
)
pub fn text_channel_decoder() -> decode.Decoder(TextChannel)
pub fn thread_auto_archive_duration_to_json(
  thread_auto_archive_duration: ThreadAutoArchiveDuration,
) -> json.Json
pub fn thread_decoder() -> decode.Decoder(Thread)
pub fn thread_member_decoder() -> decode.Decoder(ThreadMember)
pub fn thread_type_decoder() -> decode.Decoder(ThreadType)
pub fn thread_type_to_json(
  type_: ThreadType,
) -> List(Result(#(String, json.Json), Nil))
pub fn timeout_guild_member(
  modify: ModifyGuildMember,
  until timestamp: timestamp.Timestamp,
) -> ModifyGuildMember

Requires the AllowModeratingMembers permission.

The timeout can be issued for a maximum of 28 days.

Will override all previous timeouts.

Will return a Forbidden (403) status code if the member has the AdministratorPermission or is the guild’s owner.

pub fn timestamp_to_json(
  timestamp: timestamp.Timestamp,
) -> json.Json
pub fn trigger_typing_indicator_request(
  token token: Token,
  in_channel_with_id id: Snowflake(Channel),
) -> request.Request(String)

The typing indicator expires after 10 seconds.

Bots generally shouldn’t use this endpoint. It’s useful if you want to let the user know that the bot is still working on their request.

Prefer deferring interactions and using the thinking state.

pub fn trigger_typing_indicator_response(
  response: response.Response(String),
) -> Result(Nil, RestError)
pub fn unarchive_thread(modify: ModifyThread) -> ModifyThread
pub fn unban_user_from_guild_request(
  token token: Token,
  with_id user_id: Snowflake(User),
  from_guild_with_id guild_id: Snowflake(Guild),
  reason reason: option.Option(String),
) -> request.Request(String)

Requires the AllowBanningMembers permission.

pub fn unban_user_from_guild_response(
  response: response.Response(String),
) -> Result(Nil, RestError)
pub fn undeafen_guild_member(
  modify: ModifyGuildMember,
) -> ModifyGuildMember

Requires the AllowDeafeningMembersInVoiceChannels permission.

Allows the user to listen in all the guild’s voice channels, and, if they were previously muted because of a server-wide deafen, allows them to speak.

Will return a bad request if the user is not in a voice channel.

pub fn unfurled_media_item_decoder() -> decode.Decoder(
  UnfurledMediaItem,
)
pub fn unhoist_role(modify: ModifyRole) -> ModifyRole

Makes the role no longer separate from others in the sidebar.

pub fn unlock_thread(modify: ModifyThread) -> ModifyThread

When a thread is locked, only users with the AllowManagingThreads permission can unarchive it.

pub fn unmute_guild_member(
  modify: ModifyGuildMember,
) -> ModifyGuildMember

Requires the AllowMutingMembersInVoiceChannels permission.

Allows the user to speak in all the guild’s voice channels.

Will return a bad request if the user is not in a voice channel.

pub fn unpin_message_request(
  token token: Token,
  in_channel_with_id channel_id: Snowflake(GuildChannel),
  message_with_id message_id: Snowflake(Message),
  reason reason: option.Option(String),
) -> request.Request(String)

Requires the AllowPinningMessages permission.

pub fn unpin_message_response(
  response: response.Response(String),
) -> Result(Nil, RestError)
pub fn unset_announcement_channel_default_thread_auto_archive_duration(
  modify: ModifyAnnouncementChannel,
) -> ModifyAnnouncementChannel
pub fn unset_announcement_channel_position(
  modify: ModifyAnnouncementChannel,
) -> ModifyAnnouncementChannel

Channels without a specified position will automatically be assigned one at the bottom of their category/channel list.

pub fn unset_category_channel_position(
  modify: ModifyCategoryChannel,
) -> ModifyCategoryChannel

Channels without a specified position will automatically be assigned one at the bottom of their category/channel list.

pub fn unset_forum_channel_default_reaction(
  modify: ModifyForumChannel,
) -> ModifyForumChannel
pub fn unset_forum_channel_default_sort_order(
  modify: ModifyForumChannel,
) -> ModifyForumChannel
pub fn unset_forum_channel_default_thread_auto_archive_duration(
  modify: ModifyForumChannel,
) -> ModifyForumChannel
pub fn unset_forum_channel_parent_id(
  modify: ModifyForumChannel,
) -> ModifyForumChannel
pub fn unset_forum_channel_position(
  modify: ModifyForumChannel,
) -> ModifyForumChannel
pub fn unset_guild_afk_channel(
  modify: ModifyGuild,
) -> ModifyGuild

Unsets the guild’s AFK channel.

This will not delete the channel, just make the guild not have an AFK channel.

pub fn unset_guild_channel_parent_id(
  modify: ModifyGuildChannelPosition,
) -> ModifyGuildChannelPosition

Makes the channel independent of a category, putting it by itself in the channel list.

pub fn unset_guild_channel_position(
  modify: ModifyGuildChannelPosition,
) -> ModifyGuildChannelPosition

Resets the channel’s position back to the default - will put the channel at the bottom of the category/channel list.

pub fn unset_guild_public_updates_channel(
  modify: ModifyGuild,
) -> ModifyGuild

Makes the guild not have a public updates channel anymore.

This will not delete the channel.

pub fn unset_guild_rules_channel(
  modify: ModifyGuild,
) -> ModifyGuild

Makes the guild not have a rules channel anymore.

This will not delete the channel.

pub fn unset_guild_safety_alerts_channel(
  modify: ModifyGuild,
) -> ModifyGuild

Makes the guild not have a safety alerts channel anymore.

This will not delete the channel.

pub fn unset_guild_system_channel(
  modify: ModifyGuild,
) -> ModifyGuild

Makes the guild not have a system channel anymore.

This will not delete the channel.

pub fn unset_media_channel_default_reaction(
  modify: ModifyMediaChannel,
) -> ModifyMediaChannel
pub fn unset_media_channel_default_sort_order(
  modify: ModifyMediaChannel,
) -> ModifyMediaChannel
pub fn unset_media_channel_default_thread_auto_archive_duration(
  modify: ModifyMediaChannel,
) -> ModifyMediaChannel
pub fn unset_media_channel_parent_id(
  modify: ModifyMediaChannel,
) -> ModifyMediaChannel
pub fn unset_media_channel_position(
  modify: ModifyMediaChannel,
) -> ModifyMediaChannel
pub fn unset_stage_channel_parent_id(
  modify: ModifyStageChannel,
) -> ModifyStageChannel
pub fn unset_stage_channel_position(
  modify: ModifyStageChannel,
) -> ModifyStageChannel

Channels without a specified position will automatically be assigned one at the bottom of their category/channel list.

pub fn unset_stage_channel_rtc_region_id(
  modify: ModifyStageChannel,
) -> ModifyStageChannel

Makes the RTC region automatically selected by Discord.

pub fn unset_text_channel_default_thread_auto_archive_duration(
  modify: ModifyTextChannel,
) -> ModifyTextChannel
pub fn unset_text_channel_parent_id(
  modify: ModifyTextChannel,
) -> ModifyTextChannel
pub fn unset_text_channel_position(
  modify: ModifyTextChannel,
) -> ModifyTextChannel

Channels without a specified position will automatically be assigned one at the bottom of their category/channel list.

pub fn unset_thread_rate_limit_per_user(
  modify: ModifyThread,
) -> ModifyThread
pub fn unset_voice_channel_parent_id(
  modify: ModifyVoiceChannel,
) -> ModifyVoiceChannel
pub fn unset_voice_channel_position(
  modify: ModifyVoiceChannel,
) -> ModifyVoiceChannel

Channels without a specified position will automatically be assigned one at the bottom of their category/channel list.

pub fn unset_voice_channel_rtc_region_id(
  modify: ModifyVoiceChannel,
) -> ModifyVoiceChannel

Makes the RTC region automatically selected by Discord.

pub fn untimeout_guild_member(
  modify: ModifyGuildMember,
) -> ModifyGuildMember

Requires the AllowModeratingMembers permission.

pub fn user_avatar_decoration_decoder() -> decode.Decoder(
  UserAvatarDecoration,
)
pub fn user_collectibles_decoder() -> decode.Decoder(
  UserCollectibles,
)
pub fn user_command_decoder() -> decode.Decoder(UserCommand)
pub fn user_decoder() -> decode.Decoder(User)
pub fn user_nameplate_palette_decoder() -> decode.Decoder(
  UserNameplatePalette,
)
pub fn user_premium_type_decoder() -> decode.Decoder(
  UserPremiumType,
)
pub fn user_primary_guild_decoder() -> decode.Decoder(
  UserPrimaryGuild,
)
pub fn user_select_default_value_to_json(
  id: Snowflake(User),
) -> json.Json
pub fn user_slash_command_option_decoder() -> decode.Decoder(
  UserSlashCommandOption,
)
pub fn user_slash_command_option_to_json(
  option: UserSlashCommandOption,
) -> json.Json
pub fn user_status_decoder() -> decode.Decoder(UserStatus)
pub fn video_message_attachment_decoder() -> decode.Decoder(
  VideoMessageAttachment,
)
pub fn video_quality_mode_decoder() -> decode.Decoder(
  VideoQualityMode,
)
pub fn video_quality_mode_to_json(
  video_quality_mode: VideoQualityMode,
) -> json.Json
pub fn voice_channel_decoder() -> decode.Decoder(VoiceChannel)
pub fn voice_message_attachment_decoder() -> decode.Decoder(
  VoiceMessageAttachment,
)
pub fn voice_region_decoder() -> decode.Decoder(VoiceRegion)
pub fn voice_state_decoder() -> decode.Decoder(VoiceState)
Search Document