Documentation
¶
Index ¶
- Constants
- Variables
- func AllGuildChannels(guildID snowflake.ID) snowflake.ID
- func AnimatedEmojiMention(id snowflake.ID, name string) string
- func AuthorizeURL(values QueryValues) string
- func ChannelMention(id snowflake.ID) string
- func EmailMention(email string) string
- func EmojiMention(id snowflake.ID, name string) string
- func FormattedTimestampMention(timestamp int64, style TimestampStyle) string
- func HasScope(scope OAuth2Scope, scopes ...OAuth2Scope) bool
- func InviteURL(code string) string
- func JoinScopes(scopes []OAuth2Scope) string
- func MessageURL(guildID snowflake.ID, channelID snowflake.ID, messageID snowflake.ID) string
- func NavigationBrowseMention() string
- func NavigationCustomizeMention() string
- func NavigationGuideMention() string
- func NavigationLinkedRole(id snowflake.ID) string
- func NavigationLinkedRoles() string
- func PhoneNumberMention(number string) string
- func RoleMention(id snowflake.ID) string
- func SlashCommandMention(id snowflake.ID, path string) string
- func TimestampMention(timestamp int64) string
- func UserMention(id snowflake.ID) string
- func UserTag(username string, discriminator string) string
- func WebhookURL(webhookID snowflake.ID, webhookToken string) string
- type AccessTokenResponse
- type ActionRowComponent
- func (c ActionRowComponent) AddComponents(components ...InteractiveComponent) ActionRowComponent
- func (c ActionRowComponent) GetID() int
- func (c ActionRowComponent) MarshalJSON() ([]byte, error)
- func (c ActionRowComponent) RemoveComponent(id int) ActionRowComponent
- func (c ActionRowComponent) SubComponents() iter.Seq[Component]
- func (ActionRowComponent) Type() ComponentType
- func (c *ActionRowComponent) UnmarshalJSON(data []byte) error
- func (c ActionRowComponent) UpdateComponent(id int, component InteractiveComponent) ActionRowComponent
- func (c ActionRowComponent) WithComponents(components ...InteractiveComponent) ActionRowComponent
- func (c ActionRowComponent) WithID(id int) ActionRowComponent
- type Activity
- type ActivityAssets
- type ActivityButton
- type ActivityFlags
- type ActivityInstance
- type ActivityLocation
- type ActivityLocationKind
- type ActivityParty
- type ActivitySecrets
- type ActivityStatusDisplayType
- type ActivityTimestamps
- type ActivityType
- type AddBan
- type AllowedMentionType
- type AllowedMentions
- type Application
- type ApplicationCommand
- type ApplicationCommandCreate
- type ApplicationCommandInteraction
- func (i ApplicationCommandInteraction) AppPermissions() *Permissions
- func (i ApplicationCommandInteraction) ApplicationID() snowflake.ID
- func (i ApplicationCommandInteraction) AttachmentSizeLimit() int
- func (i ApplicationCommandInteraction) AuthorizingIntegrationOwners() map[ApplicationIntegrationType]snowflake.ID
- func (i ApplicationCommandInteraction) Channel() InteractionChannel
- func (i ApplicationCommandInteraction) Context() InteractionContextType
- func (i ApplicationCommandInteraction) CreatedAt() time.Time
- func (i ApplicationCommandInteraction) Entitlements() []Entitlement
- func (i ApplicationCommandInteraction) EntryPointCommandInteractionData() EntryPointCommandInteractionData
- func (i ApplicationCommandInteraction) GuildID() *snowflake.ID
- func (i ApplicationCommandInteraction) GuildLocale() *Locale
- func (i ApplicationCommandInteraction) ID() snowflake.ID
- func (i ApplicationCommandInteraction) Locale() Locale
- func (i ApplicationCommandInteraction) MarshalJSON() ([]byte, error)
- func (i ApplicationCommandInteraction) Member() *ResolvedMember
- func (i ApplicationCommandInteraction) MessageCommandInteractionData() MessageCommandInteractionData
- func (i ApplicationCommandInteraction) PartialGuild() *InteractionGuild
- func (i ApplicationCommandInteraction) SlashCommandInteractionData() SlashCommandInteractionData
- func (i ApplicationCommandInteraction) Token() string
- func (ApplicationCommandInteraction) Type() InteractionType
- func (i *ApplicationCommandInteraction) UnmarshalJSON(data []byte) error
- func (i ApplicationCommandInteraction) User() User
- func (i ApplicationCommandInteraction) UserCommandInteractionData() UserCommandInteractionData
- func (i ApplicationCommandInteraction) Version() int
- type ApplicationCommandInteractionData
- type ApplicationCommandOption
- type ApplicationCommandOptionAttachment
- type ApplicationCommandOptionBool
- type ApplicationCommandOptionChannel
- type ApplicationCommandOptionChoice
- type ApplicationCommandOptionChoiceFloat
- type ApplicationCommandOptionChoiceInt
- type ApplicationCommandOptionChoiceString
- type ApplicationCommandOptionFloat
- type ApplicationCommandOptionInt
- type ApplicationCommandOptionMentionable
- type ApplicationCommandOptionRole
- type ApplicationCommandOptionString
- type ApplicationCommandOptionSubCommand
- func (o ApplicationCommandOptionSubCommand) MarshalJSON() ([]byte, error)
- func (o ApplicationCommandOptionSubCommand) OptionDescription() string
- func (o ApplicationCommandOptionSubCommand) OptionName() string
- func (ApplicationCommandOptionSubCommand) Type() ApplicationCommandOptionType
- func (o *ApplicationCommandOptionSubCommand) UnmarshalJSON(data []byte) error
- type ApplicationCommandOptionSubCommandGroup
- func (o ApplicationCommandOptionSubCommandGroup) MarshalJSON() ([]byte, error)
- func (o ApplicationCommandOptionSubCommandGroup) OptionDescription() string
- func (o ApplicationCommandOptionSubCommandGroup) OptionName() string
- func (ApplicationCommandOptionSubCommandGroup) Type() ApplicationCommandOptionType
- type ApplicationCommandOptionType
- type ApplicationCommandOptionUser
- type ApplicationCommandPermission
- type ApplicationCommandPermissionChannel
- type ApplicationCommandPermissionRole
- type ApplicationCommandPermissionType
- type ApplicationCommandPermissionUser
- type ApplicationCommandPermissions
- type ApplicationCommandPermissionsSet
- type ApplicationCommandType
- type ApplicationCommandUpdate
- type ApplicationFlags
- type ApplicationIntegrationType
- type ApplicationIntegrationTypeConfiguration
- type ApplicationIntegrationTypesConfig
- type ApplicationRoleConnection
- type ApplicationRoleConnectionMetadata
- type ApplicationRoleConnectionMetadataType
- type ApplicationRoleConnectionUpdate
- type ApplicationUpdate
- type ApplicationWebhook
- func (w ApplicationWebhook) Avatar() *string
- func (w ApplicationWebhook) AvatarURL(opts ...CDNOpt) *string
- func (w ApplicationWebhook) CreatedAt() time.Time
- func (w ApplicationWebhook) DefaultAvatarURL(opts ...CDNOpt) string
- func (w ApplicationWebhook) EffectiveAvatarURL(opts ...CDNOpt) string
- func (w ApplicationWebhook) ID() snowflake.ID
- func (w ApplicationWebhook) MarshalJSON() ([]byte, error)
- func (w ApplicationWebhook) Name() string
- func (ApplicationWebhook) Type() WebhookType
- func (w *ApplicationWebhook) UnmarshalJSON(data []byte) error
- type Attachment
- type AttachmentCreate
- type AttachmentFlags
- type AttachmentKeep
- type AttachmentUpdate
- type AuditLog
- type AuditLogChange
- type AuditLogChangeKey
- type AuditLogEntry
- type AuditLogEvent
- type AuthorizationInformation
- type AutoArchiveDuration
- type AutoModerationAction
- type AutoModerationActionMetadata
- type AutoModerationActionType
- type AutoModerationEventType
- type AutoModerationKeywordPreset
- type AutoModerationRule
- type AutoModerationRuleCreate
- type AutoModerationRuleUpdate
- type AutoModerationTriggerMetadata
- type AutoModerationTriggerType
- type AutocompleteChoice
- type AutocompleteChoiceFloat
- type AutocompleteChoiceInt
- type AutocompleteChoiceString
- type AutocompleteInteraction
- func (i AutocompleteInteraction) AppPermissions() *Permissions
- func (i AutocompleteInteraction) ApplicationID() snowflake.ID
- func (i AutocompleteInteraction) AttachmentSizeLimit() int
- func (i AutocompleteInteraction) AuthorizingIntegrationOwners() map[ApplicationIntegrationType]snowflake.ID
- func (i AutocompleteInteraction) Channel() InteractionChannel
- func (i AutocompleteInteraction) Context() InteractionContextType
- func (i AutocompleteInteraction) CreatedAt() time.Time
- func (i AutocompleteInteraction) Entitlements() []Entitlement
- func (i AutocompleteInteraction) GuildID() *snowflake.ID
- func (i AutocompleteInteraction) GuildLocale() *Locale
- func (i AutocompleteInteraction) ID() snowflake.ID
- func (i AutocompleteInteraction) Locale() Locale
- func (i AutocompleteInteraction) MarshalJSON() ([]byte, error)
- func (i AutocompleteInteraction) Member() *ResolvedMember
- func (i AutocompleteInteraction) PartialGuild() *InteractionGuild
- func (i AutocompleteInteraction) Token() string
- func (AutocompleteInteraction) Type() InteractionType
- func (i *AutocompleteInteraction) UnmarshalJSON(data []byte) error
- func (i AutocompleteInteraction) User() User
- func (i AutocompleteInteraction) Version() int
- type AutocompleteInteractionData
- func (d AutocompleteInteractionData) All() []AutocompleteOption
- func (d AutocompleteInteractionData) Bool(name string) bool
- func (d AutocompleteInteractionData) CommandPath() string
- func (d AutocompleteInteractionData) Find(optionFindFunc func(option AutocompleteOption) bool) (AutocompleteOption, bool)
- func (d AutocompleteInteractionData) FindAll(optionFindFunc func(option AutocompleteOption) bool) []AutocompleteOption
- func (d AutocompleteInteractionData) Float(name string) float64
- func (d AutocompleteInteractionData) Focused() AutocompleteOption
- func (d AutocompleteInteractionData) GetByType(optionType ApplicationCommandOptionType) []AutocompleteOption
- func (d AutocompleteInteractionData) Int(name string) int
- func (d AutocompleteInteractionData) MarshalJSON() ([]byte, error)
- func (d AutocompleteInteractionData) OptBool(name string) (bool, bool)
- func (d AutocompleteInteractionData) OptFloat(name string) (float64, bool)
- func (d AutocompleteInteractionData) OptInt(name string) (int, bool)
- func (d AutocompleteInteractionData) OptSnowflake(name string) (snowflake.ID, bool)
- func (d AutocompleteInteractionData) OptString(name string) (string, bool)
- func (d AutocompleteInteractionData) Option(name string) (AutocompleteOption, bool)
- func (d AutocompleteInteractionData) Snowflake(name string) snowflake.ID
- func (d AutocompleteInteractionData) String(name string) string
- func (d *AutocompleteInteractionData) UnmarshalJSON(data []byte) error
- type AutocompleteOption
- type AutocompleteOptionSubCommand
- type AutocompleteOptionSubCommandGroup
- type AutocompleteResult
- type AvatarDecorationData
- type Ban
- type BotIntegration
- type BulkBan
- type BulkBanResult
- type ButtonComponent
- func NewButton(style ButtonStyle, label string, customID string, url string, ...) ButtonComponent
- func NewDangerButton(label string, customID string) ButtonComponent
- func NewLinkButton(label string, url string) ButtonComponent
- func NewPremiumButton(skuID snowflake.ID) ButtonComponent
- func NewPrimaryButton(label string, customID string) ButtonComponent
- func NewSecondaryButton(label string, customID string) ButtonComponent
- func NewSuccessButton(label string, customID string) ButtonComponent
- func (c ButtonComponent) AsDisabled() ButtonComponent
- func (c ButtonComponent) AsEnabled() ButtonComponent
- func (c ButtonComponent) GetCustomID() string
- func (c ButtonComponent) GetID() int
- func (c ButtonComponent) MarshalJSON() ([]byte, error)
- func (ButtonComponent) Type() ComponentType
- func (c ButtonComponent) WithCustomID(customID string) ButtonComponent
- func (c ButtonComponent) WithDisabled(disabled bool) ButtonComponent
- func (c ButtonComponent) WithEmoji(emoji ComponentEmoji) ButtonComponent
- func (c ButtonComponent) WithID(id int) ButtonComponent
- func (c ButtonComponent) WithLabel(label string) ButtonComponent
- func (c ButtonComponent) WithSkuID(skuID snowflake.ID) ButtonComponent
- func (c ButtonComponent) WithStyle(style ButtonStyle) ButtonComponent
- func (c ButtonComponent) WithURL(url string) ButtonComponent
- type ButtonInteractionData
- type ButtonStyle
- type CDNConfig
- type CDNEndpoint
- type CDNOpt
- type Channel
- type ChannelCreate
- type ChannelFlags
- type ChannelFollowerWebhook
- func (w ChannelFollowerWebhook) Avatar() *string
- func (w ChannelFollowerWebhook) AvatarURL(opts ...CDNOpt) *string
- func (w ChannelFollowerWebhook) CreatedAt() time.Time
- func (w ChannelFollowerWebhook) DefaultAvatarURL(opts ...CDNOpt) string
- func (w ChannelFollowerWebhook) EffectiveAvatarURL(opts ...CDNOpt) string
- func (w ChannelFollowerWebhook) ID() snowflake.ID
- func (w ChannelFollowerWebhook) MarshalJSON() ([]byte, error)
- func (w ChannelFollowerWebhook) Name() string
- func (ChannelFollowerWebhook) Type() WebhookType
- func (w *ChannelFollowerWebhook) UnmarshalJSON(data []byte) error
- type ChannelPins
- type ChannelSelectMenuComponent
- func (c ChannelSelectMenuComponent) AddDefaultValue(defaultValue snowflake.ID) ChannelSelectMenuComponent
- func (c ChannelSelectMenuComponent) AsDisabled() ChannelSelectMenuComponent
- func (c ChannelSelectMenuComponent) AsEnabled() ChannelSelectMenuComponent
- func (c ChannelSelectMenuComponent) GetCustomID() string
- func (c ChannelSelectMenuComponent) GetID() int
- func (c ChannelSelectMenuComponent) MarshalJSON() ([]byte, error)
- func (c ChannelSelectMenuComponent) RemoveDefaultValue(index int) ChannelSelectMenuComponent
- func (c ChannelSelectMenuComponent) SetDefaultValues(defaultValues ...snowflake.ID) ChannelSelectMenuComponent
- func (ChannelSelectMenuComponent) Type() ComponentType
- func (c ChannelSelectMenuComponent) WithChannelTypes(channelTypes ...ChannelType) ChannelSelectMenuComponent
- func (c ChannelSelectMenuComponent) WithCustomID(customID string) ChannelSelectMenuComponent
- func (c ChannelSelectMenuComponent) WithDisabled(disabled bool) ChannelSelectMenuComponent
- func (c ChannelSelectMenuComponent) WithID(id int) ChannelSelectMenuComponent
- func (c ChannelSelectMenuComponent) WithMaxValues(maxValue int) ChannelSelectMenuComponent
- func (c ChannelSelectMenuComponent) WithMinValues(minValue int) ChannelSelectMenuComponent
- func (c ChannelSelectMenuComponent) WithPlaceholder(placeholder string) ChannelSelectMenuComponent
- func (c ChannelSelectMenuComponent) WithRequired(required bool) ChannelSelectMenuComponent
- type ChannelSelectMenuInteractionData
- func (d ChannelSelectMenuInteractionData) Channels() []ResolvedChannel
- func (d ChannelSelectMenuInteractionData) CustomID() string
- func (d ChannelSelectMenuInteractionData) MarshalJSON() ([]byte, error)
- func (ChannelSelectMenuInteractionData) Type() ComponentType
- func (d *ChannelSelectMenuInteractionData) UnmarshalJSON(data []byte) error
- type ChannelSelectMenuResolved
- type ChannelTag
- type ChannelType
- type ChannelUpdate
- type CheckboxComponent
- func (c CheckboxComponent) GetCustomID() string
- func (c CheckboxComponent) GetID() int
- func (c CheckboxComponent) MarshalJSON() ([]byte, error)
- func (CheckboxComponent) Type() ComponentType
- func (c CheckboxComponent) WithCustomID(customID string) CheckboxComponent
- func (c CheckboxComponent) WithDefault(def bool) CheckboxComponent
- func (c CheckboxComponent) WithID(id int) CheckboxComponent
- type CheckboxGroupComponent
- func (c CheckboxGroupComponent) GetCustomID() string
- func (c CheckboxGroupComponent) GetID() int
- func (c CheckboxGroupComponent) MarshalJSON() ([]byte, error)
- func (CheckboxGroupComponent) Type() ComponentType
- func (c CheckboxGroupComponent) WithCustomID(customID string) CheckboxGroupComponent
- func (c CheckboxGroupComponent) WithID(id int) CheckboxGroupComponent
- func (c CheckboxGroupComponent) WithMaxValues(maxValues int) CheckboxGroupComponent
- func (c CheckboxGroupComponent) WithMinValues(minValues int) CheckboxGroupComponent
- func (c CheckboxGroupComponent) WithOptions(options ...CheckboxGroupOption) CheckboxGroupComponent
- func (c CheckboxGroupComponent) WithRequired(required bool) CheckboxGroupComponent
- type CheckboxGroupOption
- func (o CheckboxGroupOption) WithDefault(def bool) CheckboxGroupOption
- func (o CheckboxGroupOption) WithDescription(description string) CheckboxGroupOption
- func (o CheckboxGroupOption) WithLabel(label string) CheckboxGroupOption
- func (o CheckboxGroupOption) WithValue(value string) CheckboxGroupOption
- type ClientStatus
- type Collectibles
- type Component
- type ComponentEmoji
- type ComponentInteraction
- func (i ComponentInteraction) AppPermissions() *Permissions
- func (i ComponentInteraction) ApplicationID() snowflake.ID
- func (i ComponentInteraction) AttachmentSizeLimit() int
- func (i ComponentInteraction) AuthorizingIntegrationOwners() map[ApplicationIntegrationType]snowflake.ID
- func (i ComponentInteraction) ButtonInteractionData() ButtonInteractionData
- func (i ComponentInteraction) Channel() InteractionChannel
- func (i ComponentInteraction) ChannelSelectMenuInteractionData() ChannelSelectMenuInteractionData
- func (i ComponentInteraction) Context() InteractionContextType
- func (i ComponentInteraction) CreatedAt() time.Time
- func (i ComponentInteraction) Entitlements() []Entitlement
- func (i ComponentInteraction) GuildID() *snowflake.ID
- func (i ComponentInteraction) GuildLocale() *Locale
- func (i ComponentInteraction) ID() snowflake.ID
- func (i ComponentInteraction) Locale() Locale
- func (i ComponentInteraction) MarshalJSON() ([]byte, error)
- func (i ComponentInteraction) Member() *ResolvedMember
- func (i ComponentInteraction) MentionableSelectMenuInteractionData() MentionableSelectMenuInteractionData
- func (i ComponentInteraction) PartialGuild() *InteractionGuild
- func (i ComponentInteraction) RoleSelectMenuInteractionData() RoleSelectMenuInteractionData
- func (i ComponentInteraction) SelectMenuInteractionData() SelectMenuInteractionData
- func (i ComponentInteraction) StringSelectMenuInteractionData() StringSelectMenuInteractionData
- func (i ComponentInteraction) Token() string
- func (ComponentInteraction) Type() InteractionType
- func (i *ComponentInteraction) UnmarshalJSON(data []byte) error
- func (i ComponentInteraction) User() User
- func (i ComponentInteraction) UserSelectMenuInteractionData() UserSelectMenuInteractionData
- func (i ComponentInteraction) Version() int
- type ComponentInteractionData
- type ComponentIter
- type ComponentType
- type Connection
- type ConnectionType
- type ContainerComponent
- func (c ContainerComponent) AddComponents(components ...ContainerSubComponent) ContainerComponent
- func (c ContainerComponent) GetID() int
- func (c ContainerComponent) MarshalJSON() ([]byte, error)
- func (c ContainerComponent) RemoveComponent(id int) ContainerComponent
- func (c ContainerComponent) SubComponents() iter.Seq[Component]
- func (ContainerComponent) Type() ComponentType
- func (c *ContainerComponent) UnmarshalJSON(data []byte) error
- func (c ContainerComponent) UpdateComponent(id int, component ContainerSubComponent) ContainerComponent
- func (c ContainerComponent) WithAccentColor(accentColor int) ContainerComponent
- func (c ContainerComponent) WithComponents(components ...ContainerSubComponent) ContainerComponent
- func (c ContainerComponent) WithID(id int) ContainerComponent
- func (c ContainerComponent) WithSpoiler(spoiler bool) ContainerComponent
- type ContainerSubComponent
- type ContextCommandInteractionData
- type CurrentMemberUpdate
- type CurrentUserVoiceStateUpdate
- type DMChannel
- func (c DMChannel) CreatedAt() time.Time
- func (c DMChannel) ID() snowflake.ID
- func (c DMChannel) LastMessageID() *snowflake.ID
- func (c DMChannel) LastPinTimestamp() *time.Time
- func (c DMChannel) MarshalJSON() ([]byte, error)
- func (c DMChannel) Name() string
- func (c DMChannel) String() string
- func (DMChannel) Type() ChannelType
- func (c *DMChannel) UnmarshalJSON(data []byte) error
- type DMChannelCreate
- type DefaultForumLayout
- type DefaultReactionEmoji
- type DefaultSortOrder
- type Embed
- type EmbedAuthor
- type EmbedBuilder
- func (b *EmbedBuilder) AddField(name string, value string, inline bool) *EmbedBuilder
- func (b *EmbedBuilder) AddFields(fields ...EmbedField) *EmbedBuilder
- func (b *EmbedBuilder) Build() Embed
- func (b *EmbedBuilder) ClearFields() *EmbedBuilder
- func (b *EmbedBuilder) RemoveField(i int) *EmbedBuilder
- func (b *EmbedBuilder) SetAuthor(name string, url string, iconURL string) *EmbedBuilder
- func (b *EmbedBuilder) SetAuthorIcon(iconURL string) *EmbedBuilder
- func (b *EmbedBuilder) SetAuthorIconf(iconURL string, a ...any) *EmbedBuilder
- func (b *EmbedBuilder) SetAuthorName(name string) *EmbedBuilder
- func (b *EmbedBuilder) SetAuthorNamef(name string, a ...any) *EmbedBuilder
- func (b *EmbedBuilder) SetAuthorURL(url string) *EmbedBuilder
- func (b *EmbedBuilder) SetAuthorURLf(url string, a ...any) *EmbedBuilder
- func (b *EmbedBuilder) SetColor(color int) *EmbedBuilder
- func (b *EmbedBuilder) SetDescription(description string) *EmbedBuilder
- func (b *EmbedBuilder) SetDescriptionf(description string, a ...any) *EmbedBuilder
- func (b *EmbedBuilder) SetEmbedAuthor(author *EmbedAuthor) *EmbedBuilder
- func (b *EmbedBuilder) SetEmbedFooter(footer *EmbedFooter) *EmbedBuilder
- func (b *EmbedBuilder) SetField(i int, name string, value string, inline bool) *EmbedBuilder
- func (b *EmbedBuilder) SetFields(fields ...EmbedField) *EmbedBuilder
- func (b *EmbedBuilder) SetFooter(text string, iconURL string) *EmbedBuilder
- func (b *EmbedBuilder) SetFooterIcon(iconURL string) *EmbedBuilder
- func (b *EmbedBuilder) SetFooterIconf(iconURL string, a ...any) *EmbedBuilder
- func (b *EmbedBuilder) SetFooterText(text string) *EmbedBuilder
- func (b *EmbedBuilder) SetFooterTextf(text string, a ...any) *EmbedBuilder
- func (b *EmbedBuilder) SetImage(url string) *EmbedBuilder
- func (b *EmbedBuilder) SetImagef(url string, a ...any) *EmbedBuilder
- func (b *EmbedBuilder) SetThumbnail(url string) *EmbedBuilder
- func (b *EmbedBuilder) SetThumbnailf(url string, a ...any) *EmbedBuilder
- func (b *EmbedBuilder) SetTimestamp(time time.Time) *EmbedBuilder
- func (b *EmbedBuilder) SetTitle(title string) *EmbedBuilder
- func (b *EmbedBuilder) SetTitlef(title string, a ...any) *EmbedBuilder
- func (b *EmbedBuilder) SetURL(url string) *EmbedBuilder
- func (b *EmbedBuilder) SetURLf(url string, a ...any) *EmbedBuilder
- type EmbedField
- type EmbedFieldPollResult
- type EmbedFooter
- type EmbedProvider
- type EmbedResource
- type EmbedType
- type Emoji
- type EmojiCreate
- type EmojiUpdate
- type Entitlement
- type EntitlementOwnerType
- type EntitlementType
- type EntityMetaData
- type EntryPointCommand
- func (c EntryPointCommand) ApplicationID() snowflake.ID
- func (c EntryPointCommand) Contexts() []InteractionContextType
- func (c EntryPointCommand) CreatedAt() time.Time
- func (c EntryPointCommand) DMPermission() bool
- func (c EntryPointCommand) DefaultMemberPermissions() Permissions
- func (c EntryPointCommand) GuildID() *snowflake.ID
- func (c EntryPointCommand) ID() snowflake.ID
- func (c EntryPointCommand) IntegrationTypes() []ApplicationIntegrationType
- func (c EntryPointCommand) MarshalJSON() ([]byte, error)
- func (c EntryPointCommand) NSFW() bool
- func (c EntryPointCommand) Name() string
- func (c EntryPointCommand) NameLocalizations() map[Locale]string
- func (c EntryPointCommand) NameLocalized() string
- func (EntryPointCommand) Type() ApplicationCommandType
- func (c *EntryPointCommand) UnmarshalJSON(data []byte) error
- func (c EntryPointCommand) Version() snowflake.ID
- type EntryPointCommandCreate
- type EntryPointCommandHandlerType
- type EntryPointCommandInteractionData
- func (d EntryPointCommandInteractionData) CommandID() snowflake.ID
- func (d EntryPointCommandInteractionData) CommandName() string
- func (d EntryPointCommandInteractionData) GuildID() *snowflake.ID
- func (d *EntryPointCommandInteractionData) MarshalJSON() ([]byte, error)
- func (EntryPointCommandInteractionData) Type() ApplicationCommandType
- func (d *EntryPointCommandInteractionData) UnmarshalJSON(data []byte) error
- type EntryPointCommandUpdate
- type ExplicitContentFilterLevel
- type ExtendedInvite
- type File
- type FileComponent
- func (c FileComponent) GetID() int
- func (c FileComponent) MarshalJSON() ([]byte, error)
- func (FileComponent) Type() ComponentType
- func (c FileComponent) WithID(id int) FileComponent
- func (c FileComponent) WithMediaURL(url string) FileComponent
- func (c FileComponent) WithSpoiler(spoiler bool) FileComponent
- type FileFlags
- type FileFormat
- type FileUploadComponent
- func (f FileUploadComponent) GetCustomID() string
- func (f FileUploadComponent) GetID() int
- func (f FileUploadComponent) MarshalJSON() ([]byte, error)
- func (FileUploadComponent) Type() ComponentType
- func (f FileUploadComponent) WithCustomID(customID string) FileUploadComponent
- func (f FileUploadComponent) WithID(id int) FileUploadComponent
- func (f FileUploadComponent) WithMaxValues(maxValues int) FileUploadComponent
- func (f FileUploadComponent) WithMinValues(minValues int) FileUploadComponent
- func (f FileUploadComponent) WithRequired(required bool) FileUploadComponent
- type FollowChannel
- type FollowedChannel
- type Gateway
- type GatewayBot
- type GatewayGuild
- type GetAllThreads
- type GetThreads
- type GrantType
- type GroupDMChannel
- func (c GroupDMChannel) CreatedAt() time.Time
- func (c GroupDMChannel) ID() snowflake.ID
- func (c GroupDMChannel) IconURL(opts ...CDNOpt) *string
- func (c GroupDMChannel) LastMessageID() *snowflake.ID
- func (c GroupDMChannel) LastPinTimestamp() *time.Time
- func (c GroupDMChannel) MarshalJSON() ([]byte, error)
- func (c GroupDMChannel) Name() string
- func (c GroupDMChannel) OwnerID() *snowflake.ID
- func (c GroupDMChannel) String() string
- func (GroupDMChannel) Type() ChannelType
- func (c *GroupDMChannel) UnmarshalJSON(data []byte) error
- type Guild
- type GuildActiveThreads
- type GuildAudioChannel
- type GuildCategoryChannel
- func (c GuildCategoryChannel) CreatedAt() time.Time
- func (c GuildCategoryChannel) GuildID() snowflake.ID
- func (c GuildCategoryChannel) ID() snowflake.ID
- func (c GuildCategoryChannel) MarshalJSON() ([]byte, error)
- func (c GuildCategoryChannel) Mention() string
- func (c GuildCategoryChannel) Name() string
- func (c GuildCategoryChannel) ParentID() *snowflake.ID
- func (c GuildCategoryChannel) PermissionOverwrites() PermissionOverwrites
- func (c GuildCategoryChannel) Position() int
- func (c GuildCategoryChannel) String() string
- func (GuildCategoryChannel) Type() ChannelType
- func (c *GuildCategoryChannel) UnmarshalJSON(data []byte) error
- type GuildCategoryChannelCreate
- type GuildCategoryChannelUpdate
- type GuildChannel
- type GuildChannelCreate
- type GuildChannelPositionUpdate
- type GuildChannelUpdate
- type GuildCreateChannel
- type GuildCreateRole
- type GuildFeature
- type GuildForumChannel
- func (c GuildForumChannel) CreatedAt() time.Time
- func (c GuildForumChannel) GuildID() snowflake.ID
- func (c GuildForumChannel) ID() snowflake.ID
- func (c GuildForumChannel) MarshalJSON() ([]byte, error)
- func (c GuildForumChannel) Mention() string
- func (c GuildForumChannel) Name() string
- func (c GuildForumChannel) ParentID() *snowflake.ID
- func (c GuildForumChannel) PermissionOverwrites() PermissionOverwrites
- func (c GuildForumChannel) Position() int
- func (c GuildForumChannel) String() string
- func (GuildForumChannel) Type() ChannelType
- func (c *GuildForumChannel) UnmarshalJSON(data []byte) error
- type GuildForumChannelCreate
- type GuildForumChannelUpdate
- type GuildFromTemplateCreate
- type GuildIncidentActionsUpdate
- type GuildIncidentsData
- type GuildMediaChannel
- func (c GuildMediaChannel) CreatedAt() time.Time
- func (c GuildMediaChannel) GuildID() snowflake.ID
- func (c GuildMediaChannel) ID() snowflake.ID
- func (c GuildMediaChannel) MarshalJSON() ([]byte, error)
- func (c GuildMediaChannel) Mention() string
- func (c GuildMediaChannel) Name() string
- func (c GuildMediaChannel) ParentID() *snowflake.ID
- func (c GuildMediaChannel) PermissionOverwrites() PermissionOverwrites
- func (c GuildMediaChannel) Position() int
- func (c GuildMediaChannel) String() string
- func (GuildMediaChannel) Type() ChannelType
- func (c *GuildMediaChannel) UnmarshalJSON(data []byte) error
- type GuildMediaChannelCreate
- type GuildMediaChannelUpdate
- type GuildMessageChannel
- type GuildNewsChannel
- func (c GuildNewsChannel) CreatedAt() time.Time
- func (c GuildNewsChannel) DefaultAutoArchiveDuration() AutoArchiveDuration
- func (c GuildNewsChannel) GuildID() snowflake.ID
- func (c GuildNewsChannel) ID() snowflake.ID
- func (c GuildNewsChannel) LastMessageID() *snowflake.ID
- func (c GuildNewsChannel) LastPinTimestamp() *time.Time
- func (c GuildNewsChannel) MarshalJSON() ([]byte, error)
- func (c GuildNewsChannel) Mention() string
- func (c GuildNewsChannel) NSFW() bool
- func (c GuildNewsChannel) Name() string
- func (c GuildNewsChannel) ParentID() *snowflake.ID
- func (c GuildNewsChannel) PermissionOverwrites() PermissionOverwrites
- func (c GuildNewsChannel) Position() int
- func (c GuildNewsChannel) RateLimitPerUser() int
- func (c GuildNewsChannel) String() string
- func (c GuildNewsChannel) Topic() *string
- func (GuildNewsChannel) Type() ChannelType
- func (c *GuildNewsChannel) UnmarshalJSON(data []byte) error
- type GuildNewsChannelCreate
- type GuildNewsChannelUpdate
- type GuildNewsThreadCreate
- type GuildOnboarding
- type GuildOnboardingMode
- type GuildOnboardingPrompt
- type GuildOnboardingPromptOption
- type GuildOnboardingPromptType
- type GuildOnboardingUpdate
- type GuildPostUpdate
- type GuildPreview
- type GuildPrivateThreadCreate
- type GuildPrune
- type GuildPruneResult
- type GuildPublicThreadCreate
- type GuildScheduledEvent
- type GuildScheduledEventCreate
- type GuildScheduledEventUpdate
- type GuildScheduledEventUser
- type GuildStageVoiceChannel
- func (c GuildStageVoiceChannel) Bitrate() int
- func (c GuildStageVoiceChannel) CreatedAt() time.Time
- func (c GuildStageVoiceChannel) DefaultAutoArchiveDuration() AutoArchiveDuration
- func (c GuildStageVoiceChannel) GuildID() snowflake.ID
- func (c GuildStageVoiceChannel) ID() snowflake.ID
- func (c GuildStageVoiceChannel) LastMessageID() *snowflake.ID
- func (c GuildStageVoiceChannel) LastPinTimestamp() *time.Time
- func (c GuildStageVoiceChannel) MarshalJSON() ([]byte, error)
- func (c GuildStageVoiceChannel) Mention() string
- func (c GuildStageVoiceChannel) NSFW() bool
- func (c GuildStageVoiceChannel) Name() string
- func (c GuildStageVoiceChannel) ParentID() *snowflake.ID
- func (c GuildStageVoiceChannel) PermissionOverwrites() PermissionOverwrites
- func (c GuildStageVoiceChannel) Position() int
- func (c GuildStageVoiceChannel) RTCRegion() string
- func (c GuildStageVoiceChannel) RateLimitPerUser() int
- func (c GuildStageVoiceChannel) String() string
- func (c GuildStageVoiceChannel) Topic() *string
- func (GuildStageVoiceChannel) Type() ChannelType
- func (c *GuildStageVoiceChannel) UnmarshalJSON(data []byte) error
- type GuildStageVoiceChannelCreate
- type GuildStageVoiceChannelUpdate
- type GuildSubscriptionIntegration
- type GuildTemplate
- type GuildTemplateCreate
- type GuildTemplateUpdate
- type GuildTextChannel
- func (c GuildTextChannel) CreatedAt() time.Time
- func (c GuildTextChannel) DefaultAutoArchiveDuration() AutoArchiveDuration
- func (c GuildTextChannel) GuildID() snowflake.ID
- func (c GuildTextChannel) ID() snowflake.ID
- func (c GuildTextChannel) LastMessageID() *snowflake.ID
- func (c GuildTextChannel) LastPinTimestamp() *time.Time
- func (c GuildTextChannel) MarshalJSON() ([]byte, error)
- func (c GuildTextChannel) Mention() string
- func (c GuildTextChannel) NSFW() bool
- func (c GuildTextChannel) Name() string
- func (c GuildTextChannel) ParentID() *snowflake.ID
- func (c GuildTextChannel) PermissionOverwrites() PermissionOverwrites
- func (c GuildTextChannel) Position() int
- func (c GuildTextChannel) RateLimitPerUser() int
- func (c GuildTextChannel) String() string
- func (c GuildTextChannel) Topic() *string
- func (GuildTextChannel) Type() ChannelType
- func (c *GuildTextChannel) UnmarshalJSON(data []byte) error
- type GuildTextChannelCreate
- type GuildTextChannelUpdate
- type GuildThread
- func (c GuildThread) CreatedAt() time.Time
- func (c GuildThread) DefaultAutoArchiveDuration() AutoArchiveDuration
- func (c GuildThread) GuildID() snowflake.ID
- func (c GuildThread) ID() snowflake.ID
- func (c GuildThread) LastMessageID() *snowflake.ID
- func (c GuildThread) LastPinTimestamp() *time.Time
- func (c GuildThread) MarshalJSON() ([]byte, error)
- func (c GuildThread) Mention() string
- func (c GuildThread) NSFW() bool
- func (c GuildThread) Name() string
- func (c GuildThread) ParentID() *snowflake.ID
- func (c GuildThread) PermissionOverwrites() PermissionOverwrites
- func (c GuildThread) Position() int
- func (c GuildThread) RateLimitPerUser() int
- func (c GuildThread) String() string
- func (c GuildThread) Topic() *string
- func (c GuildThread) Type() ChannelType
- func (c *GuildThread) UnmarshalJSON(data []byte) error
- type GuildThreadUpdate
- type GuildUpdate
- type GuildVoiceChannel
- func (c GuildVoiceChannel) Bitrate() int
- func (c GuildVoiceChannel) CreatedAt() time.Time
- func (c GuildVoiceChannel) DefaultAutoArchiveDuration() AutoArchiveDuration
- func (c GuildVoiceChannel) GuildID() snowflake.ID
- func (c GuildVoiceChannel) ID() snowflake.ID
- func (c GuildVoiceChannel) LastMessageID() *snowflake.ID
- func (c GuildVoiceChannel) LastPinTimestamp() *time.Time
- func (c GuildVoiceChannel) MarshalJSON() ([]byte, error)
- func (c GuildVoiceChannel) Mention() string
- func (c GuildVoiceChannel) NSFW() bool
- func (c GuildVoiceChannel) Name() string
- func (c GuildVoiceChannel) ParentID() *snowflake.ID
- func (c GuildVoiceChannel) PermissionOverwrites() PermissionOverwrites
- func (c GuildVoiceChannel) Position() int
- func (c GuildVoiceChannel) RTCRegion() string
- func (c GuildVoiceChannel) RateLimitPerUser() int
- func (c GuildVoiceChannel) String() string
- func (c GuildVoiceChannel) Topic() *string
- func (GuildVoiceChannel) Type() ChannelType
- func (c *GuildVoiceChannel) UnmarshalJSON(data []byte) error
- type GuildVoiceChannelCreate
- type GuildVoiceChannelUpdate
- type GuildWelcomeChannel
- type GuildWelcomeScreen
- type GuildWelcomeScreenUpdate
- type Icon
- type IconType
- type IncomingWebhook
- func (w IncomingWebhook) Avatar() *string
- func (w IncomingWebhook) AvatarURL(opts ...CDNOpt) *string
- func (w IncomingWebhook) CreatedAt() time.Time
- func (w IncomingWebhook) DefaultAvatarURL(opts ...CDNOpt) string
- func (w IncomingWebhook) EffectiveAvatarURL(opts ...CDNOpt) string
- func (w IncomingWebhook) ID() snowflake.ID
- func (w IncomingWebhook) MarshalJSON() ([]byte, error)
- func (w IncomingWebhook) Name() string
- func (IncomingWebhook) Type() WebhookType
- func (w IncomingWebhook) URL() string
- func (w *IncomingWebhook) UnmarshalJSON(data []byte) error
- type InstallParams
- type Integration
- type IntegrationAccount
- type IntegrationApplication
- type IntegrationExpireBehavior
- type IntegrationType
- type Interaction
- type InteractionCallback
- type InteractionCallbackActivityInstance
- type InteractionCallbackResource
- type InteractionCallbackResponse
- type InteractionChannel
- type InteractionContextType
- type InteractionGuild
- type InteractionMetadata
- type InteractionResponse
- type InteractionResponseCreator
- type InteractionResponseData
- type InteractionResponseType
- type InteractionType
- type InteractiveComponent
- type Invite
- type InviteChannel
- type InviteCreate
- type InviteFlags
- type InviteGuild
- type InviteTargetType
- type InviteTargetUsersUpdate
- type InviteType
- type LabelComponent
- func (c LabelComponent) GetID() int
- func (c LabelComponent) MarshalJSON() ([]byte, error)
- func (c LabelComponent) SubComponents() iter.Seq[Component]
- func (LabelComponent) Type() ComponentType
- func (c *LabelComponent) UnmarshalJSON(data []byte) error
- func (c LabelComponent) WithComponent(component LabelSubComponent) LabelComponent
- func (c LabelComponent) WithDescription(description string) LabelComponent
- func (c LabelComponent) WithID(id int) LabelComponent
- func (c LabelComponent) WithLabel(label string) LabelComponent
- type LabelSubComponent
- type LayoutComponent
- type Locale
- type MFALevel
- type MediaGalleryComponent
- func (c MediaGalleryComponent) GetID() int
- func (c MediaGalleryComponent) MarshalJSON() ([]byte, error)
- func (MediaGalleryComponent) Type() ComponentType
- func (c MediaGalleryComponent) WithID(id int) MediaGalleryComponent
- func (c MediaGalleryComponent) WithItems(items ...MediaGalleryItem) MediaGalleryComponent
- type MediaGalleryItem
- type Member
- func (m Member) AvatarDecorationURL(opts ...CDNOpt) *string
- func (m Member) AvatarURL(opts ...CDNOpt) *string
- func (m Member) BannerURL(opts ...CDNOpt) *string
- func (m Member) CreatedAt() time.Time
- func (m Member) EffectiveAvatarURL(opts ...CDNOpt) string
- func (m Member) EffectiveBannerURL(opts ...CDNOpt) string
- func (m Member) EffectiveName() string
- func (m Member) Mention() string
- func (m Member) String() string
- type MemberAdd
- type MemberFlags
- type MemberPermissionOverwrite
- type MemberPermissionOverwriteUpdate
- type MemberUpdate
- type MembershipState
- type MentionChannel
- type MentionType
- type Mentionable
- type MentionableSelectMenuComponent
- func (c MentionableSelectMenuComponent) AddDefaultValue(value SelectMenuDefaultValue) MentionableSelectMenuComponent
- func (c MentionableSelectMenuComponent) AsDisabled() MentionableSelectMenuComponent
- func (c MentionableSelectMenuComponent) AsEnabled() MentionableSelectMenuComponent
- func (c MentionableSelectMenuComponent) GetCustomID() string
- func (c MentionableSelectMenuComponent) GetID() int
- func (c MentionableSelectMenuComponent) MarshalJSON() ([]byte, error)
- func (c MentionableSelectMenuComponent) RemoveDefaultValue(index int) MentionableSelectMenuComponent
- func (c MentionableSelectMenuComponent) SetDefaultValues(defaultValues ...SelectMenuDefaultValue) MentionableSelectMenuComponent
- func (MentionableSelectMenuComponent) Type() ComponentType
- func (c MentionableSelectMenuComponent) WithCustomID(customID string) MentionableSelectMenuComponent
- func (c MentionableSelectMenuComponent) WithDisabled(disabled bool) MentionableSelectMenuComponent
- func (c MentionableSelectMenuComponent) WithID(id int) MentionableSelectMenuComponent
- func (c MentionableSelectMenuComponent) WithMaxValues(maxValue int) MentionableSelectMenuComponent
- func (c MentionableSelectMenuComponent) WithMinValues(minValue int) MentionableSelectMenuComponent
- func (c MentionableSelectMenuComponent) WithPlaceholder(placeholder string) MentionableSelectMenuComponent
- func (c MentionableSelectMenuComponent) WithRequired(required bool) MentionableSelectMenuComponent
- type MentionableSelectMenuInteractionData
- func (d MentionableSelectMenuInteractionData) CustomID() string
- func (d MentionableSelectMenuInteractionData) MarshalJSON() ([]byte, error)
- func (d MentionableSelectMenuInteractionData) Members() []ResolvedMember
- func (d MentionableSelectMenuInteractionData) Roles() []Role
- func (MentionableSelectMenuInteractionData) Type() ComponentType
- func (d *MentionableSelectMenuInteractionData) UnmarshalJSON(data []byte) error
- func (d MentionableSelectMenuInteractionData) Users() []User
- type MentionableSelectMenuResolved
- type MentionableValue
- type Message
- type MessageActivity
- type MessageActivityType
- type MessageApplication
- type MessageBulkDelete
- type MessageCall
- type MessageChannel
- type MessageCommand
- func (c MessageCommand) ApplicationID() snowflake.ID
- func (c MessageCommand) Contexts() []InteractionContextType
- func (c MessageCommand) CreatedAt() time.Time
- func (c MessageCommand) DMPermission() bool
- func (c MessageCommand) DefaultMemberPermissions() Permissions
- func (c MessageCommand) GuildID() *snowflake.ID
- func (c MessageCommand) ID() snowflake.ID
- func (c MessageCommand) IntegrationTypes() []ApplicationIntegrationType
- func (c MessageCommand) MarshalJSON() ([]byte, error)
- func (c MessageCommand) NSFW() bool
- func (c MessageCommand) Name() string
- func (c MessageCommand) NameLocalizations() map[Locale]string
- func (c MessageCommand) NameLocalized() string
- func (MessageCommand) Type() ApplicationCommandType
- func (c *MessageCommand) UnmarshalJSON(data []byte) error
- func (c MessageCommand) Version() snowflake.ID
- type MessageCommandCreate
- type MessageCommandInteractionData
- func (d MessageCommandInteractionData) CommandID() snowflake.ID
- func (d MessageCommandInteractionData) CommandName() string
- func (d MessageCommandInteractionData) GuildID() *snowflake.ID
- func (d *MessageCommandInteractionData) MarshalJSON() ([]byte, error)
- func (d MessageCommandInteractionData) TargetID() snowflake.ID
- func (d MessageCommandInteractionData) TargetMessage() Message
- func (MessageCommandInteractionData) Type() ApplicationCommandType
- func (d *MessageCommandInteractionData) UnmarshalJSON(data []byte) error
- type MessageCommandResolved
- type MessageCommandUpdate
- type MessageCreate
- func (m MessageCreate) AddActionRow(components ...InteractiveComponent) MessageCreate
- func (m MessageCreate) AddComponents(containers ...LayoutComponent) MessageCreate
- func (m MessageCreate) AddEmbeds(embeds ...Embed) MessageCreate
- func (m MessageCreate) AddFile(name string, description string, reader io.Reader, flags ...FileFlags) MessageCreate
- func (m MessageCreate) AddFiles(files ...*File) MessageCreate
- func (m MessageCreate) AddFlags(flags ...MessageFlags) MessageCreate
- func (m MessageCreate) AddStickers(stickerIds ...snowflake.ID) MessageCreate
- func (m MessageCreate) ClearAllowedMentions() MessageCreate
- func (m MessageCreate) ClearComponents() MessageCreate
- func (m MessageCreate) ClearEmbeds() MessageCreate
- func (m MessageCreate) ClearFiles() MessageCreate
- func (m MessageCreate) ClearFlags() MessageCreate
- func (m MessageCreate) ClearPoll() MessageCreate
- func (m MessageCreate) ClearStickers() MessageCreate
- func (m MessageCreate) RemoveComponent(id int) MessageCreate
- func (m MessageCreate) RemoveEmbed(i int) MessageCreate
- func (m MessageCreate) RemoveFile(i int) MessageCreate
- func (m MessageCreate) RemoveFlags(flags ...MessageFlags) MessageCreate
- func (m MessageCreate) RemoveSticker(stickerId snowflake.ID) MessageCreate
- func (m MessageCreate) ToBody() (any, error)
- func (m MessageCreate) ToResponseBody(response InteractionResponse) (any, error)
- func (m MessageCreate) UpdateComponent(id int, component LayoutComponent) MessageCreate
- func (m MessageCreate) UpdateFile(i int, file *File) MessageCreate
- func (m MessageCreate) WithAllowedMentions(allowedMentions *AllowedMentions) MessageCreate
- func (m MessageCreate) WithComponents(components ...LayoutComponent) MessageCreate
- func (m MessageCreate) WithContent(content string) MessageCreate
- func (m MessageCreate) WithContentf(content string, a ...any) MessageCreate
- func (m MessageCreate) WithEmbed(i int, embed Embed) MessageCreate
- func (m MessageCreate) WithEmbeds(embeds ...Embed) MessageCreate
- func (m MessageCreate) WithEnforceNonce(enforce bool) MessageCreate
- func (m MessageCreate) WithEphemeral(ephemeral bool) MessageCreate
- func (m MessageCreate) WithFiles(files ...*File) MessageCreate
- func (m MessageCreate) WithFlags(flags ...MessageFlags) MessageCreate
- func (m MessageCreate) WithIsComponentsV2(isComponentV2 bool) MessageCreate
- func (m MessageCreate) WithMessageReference(messageReference *MessageReference) MessageCreate
- func (m MessageCreate) WithMessageReferenceByID(messageID snowflake.ID) MessageCreate
- func (m MessageCreate) WithNonce(nonce string) MessageCreate
- func (m MessageCreate) WithPoll(poll PollCreate) MessageCreate
- func (m MessageCreate) WithStickers(stickerIds ...snowflake.ID) MessageCreate
- func (m MessageCreate) WithSuppressEmbeds(suppressEmbeds bool) MessageCreate
- func (m MessageCreate) WithSuppressNotifications(suppressNotifications bool) MessageCreate
- func (m MessageCreate) WithTTS(tts bool) MessageCreate
- type MessageFlags
- type MessageInteraction
- type MessageNotificationsLevel
- type MessagePin
- type MessageReaction
- type MessageReactionType
- type MessageReference
- type MessageReferenceType
- type MessageSnapshot
- type MessageSticker
- type MessageThread
- type MessageType
- type MessageUpdate
- func (m MessageUpdate) AddActionRow(components ...InteractiveComponent) MessageUpdate
- func (m MessageUpdate) AddComponents(containers ...LayoutComponent) MessageUpdate
- func (m MessageUpdate) AddEmbeds(embeds ...Embed) MessageUpdate
- func (m MessageUpdate) AddFile(name string, description string, reader io.Reader, flags ...FileFlags) MessageUpdate
- func (m MessageUpdate) AddFiles(files ...*File) MessageUpdate
- func (m MessageUpdate) AddFlags(flags ...MessageFlags) MessageUpdate
- func (m MessageUpdate) ClearAllowedMentions() MessageUpdate
- func (m MessageUpdate) ClearComponents() MessageUpdate
- func (m MessageUpdate) ClearContent() MessageUpdate
- func (m MessageUpdate) ClearEmbeds() MessageUpdate
- func (m MessageUpdate) ClearFiles() MessageUpdate
- func (m MessageUpdate) ClearFlags() MessageUpdate
- func (m MessageUpdate) RemoveComponent(id int) MessageUpdate
- func (m MessageUpdate) RemoveEmbed(i int) MessageUpdate
- func (m MessageUpdate) RemoveFile(i int) MessageUpdate
- func (m MessageUpdate) RemoveFlags(flags ...MessageFlags) MessageUpdate
- func (m MessageUpdate) RetainAttachments(attachments ...Attachment) MessageUpdate
- func (m MessageUpdate) RetainAttachmentsByID(attachmentIDs ...snowflake.ID) MessageUpdate
- func (m MessageUpdate) ToBody() (any, error)
- func (m MessageUpdate) ToResponseBody(response InteractionResponse) (any, error)
- func (m MessageUpdate) UpdateComponent(id int, component LayoutComponent) MessageUpdate
- func (m MessageUpdate) UpdateFile(i int, file *File) MessageUpdate
- func (m MessageUpdate) WithAllowedMentions(allowedMentions *AllowedMentions) MessageUpdate
- func (m MessageUpdate) WithComponents(components ...LayoutComponent) MessageUpdate
- func (m MessageUpdate) WithContent(content string) MessageUpdate
- func (m MessageUpdate) WithContentf(content string, a ...any) MessageUpdate
- func (m MessageUpdate) WithEmbed(i int, embed Embed) MessageUpdate
- func (m MessageUpdate) WithEmbeds(embeds ...Embed) MessageUpdate
- func (m MessageUpdate) WithFiles(files ...*File) MessageUpdate
- func (m MessageUpdate) WithFlags(flags MessageFlags) MessageUpdate
- func (m MessageUpdate) WithIsComponentsV2(isComponentV2 bool) MessageUpdate
- func (m MessageUpdate) WithSuppressEmbeds(suppressEmbeds bool) MessageUpdate
- type ModalCreate
- func (m ModalCreate) AddComponents(containers ...LayoutComponent) ModalCreate
- func (m ModalCreate) AddLabel(label string, component LabelSubComponent) ModalCreate
- func (m ModalCreate) ClearComponents() ModalCreate
- func (m ModalCreate) RemoveComponent(i int) ModalCreate
- func (m ModalCreate) UpdateComponent(i int, container LayoutComponent) ModalCreate
- func (m ModalCreate) WithComponents(components ...LayoutComponent) ModalCreate
- func (m ModalCreate) WithCustomID(customID string) ModalCreate
- func (m ModalCreate) WithTitle(title string) ModalCreate
- type ModalSubmitInteraction
- func (i ModalSubmitInteraction) AppPermissions() *Permissions
- func (i ModalSubmitInteraction) ApplicationID() snowflake.ID
- func (i ModalSubmitInteraction) AttachmentSizeLimit() int
- func (i ModalSubmitInteraction) AuthorizingIntegrationOwners() map[ApplicationIntegrationType]snowflake.ID
- func (i ModalSubmitInteraction) Channel() InteractionChannel
- func (i ModalSubmitInteraction) Context() InteractionContextType
- func (i ModalSubmitInteraction) CreatedAt() time.Time
- func (i ModalSubmitInteraction) Entitlements() []Entitlement
- func (i ModalSubmitInteraction) GuildID() *snowflake.ID
- func (i ModalSubmitInteraction) GuildLocale() *Locale
- func (i ModalSubmitInteraction) ID() snowflake.ID
- func (i ModalSubmitInteraction) Locale() Locale
- func (i ModalSubmitInteraction) MarshalJSON() ([]byte, error)
- func (i ModalSubmitInteraction) Member() *ResolvedMember
- func (i ModalSubmitInteraction) PartialGuild() *InteractionGuild
- func (i ModalSubmitInteraction) Token() string
- func (ModalSubmitInteraction) Type() InteractionType
- func (i *ModalSubmitInteraction) UnmarshalJSON(data []byte) error
- func (i ModalSubmitInteraction) User() User
- func (i ModalSubmitInteraction) Version() int
- type ModalSubmitInteractionData
- func (d ModalSubmitInteractionData) AllComponents() iter.Seq[Component]
- func (d ModalSubmitInteractionData) Attachments(customID string) []Attachment
- func (d ModalSubmitInteractionData) ChannelSelectMenu(customID string) (ChannelSelectMenuComponent, bool)
- func (d ModalSubmitInteractionData) Channels(customID string) []ResolvedChannel
- func (d ModalSubmitInteractionData) Component(customID string) (InteractiveComponent, bool)
- func (d ModalSubmitInteractionData) FileUpload(customID string) (FileUploadComponent, bool)
- func (d ModalSubmitInteractionData) MentionableSelectMenu(customID string) (MentionableSelectMenuComponent, bool)
- func (d ModalSubmitInteractionData) Mentionables(customID string) []Mentionable
- func (d ModalSubmitInteractionData) OptAttachments(customID string) ([]Attachment, bool)
- func (d ModalSubmitInteractionData) OptChannels(customID string) ([]ResolvedChannel, bool)
- func (d ModalSubmitInteractionData) OptMentionables(customID string) ([]Mentionable, bool)
- func (d ModalSubmitInteractionData) OptRoles(customID string) ([]Role, bool)
- func (d ModalSubmitInteractionData) OptStringValues(customID string) ([]string, bool)
- func (d ModalSubmitInteractionData) OptText(customID string) (string, bool)
- func (d ModalSubmitInteractionData) OptUsers(customID string) ([]User, bool)
- func (d ModalSubmitInteractionData) RoleSelectMenu(customID string) (RoleSelectMenuComponent, bool)
- func (d ModalSubmitInteractionData) Roles(customID string) []Role
- func (d ModalSubmitInteractionData) StringSelectMenu(customID string) (StringSelectMenuComponent, bool)
- func (d ModalSubmitInteractionData) StringValues(customID string) []string
- func (d ModalSubmitInteractionData) Text(customID string) string
- func (d ModalSubmitInteractionData) TextInput(customID string) (TextInputComponent, bool)
- func (d *ModalSubmitInteractionData) UnmarshalJSON(data []byte) error
- func (d ModalSubmitInteractionData) UserSelectMenu(customID string) (UserSelectMenuComponent, bool)
- func (d ModalSubmitInteractionData) Users(customID string) []User
- type MultipartBuffer
- type NSFWLevel
- type Nameplate
- type NameplatePalette
- type Nonce
- type OAuth2Guild
- type OAuth2Scope
- type OAuth2User
- type OnlineStatus
- type OptionalAuditLogEntryInfo
- type PartialApplication
- type PartialChannel
- type PartialEmoji
- type PartialInvite
- type PartialMessage
- type PartialRole
- type Payload
- type PermissionOverwrite
- type PermissionOverwriteType
- type PermissionOverwriteUpdate
- type PermissionOverwrites
- type Permissions
- func (p Permissions) Add(bits ...Permissions) Permissions
- func (p Permissions) Has(bits ...Permissions) bool
- func (p Permissions) MarshalJSON() ([]byte, error)
- func (p Permissions) Missing(bits ...Permissions) bool
- func (p Permissions) Remove(bits ...Permissions) Permissions
- func (p Permissions) String() string
- func (p *Permissions) UnmarshalJSON(data []byte) error
- type PingInteraction
- func (PingInteraction) AppPermissions() *Permissions
- func (i PingInteraction) ApplicationID() snowflake.ID
- func (PingInteraction) AttachmentSizeLimit() int
- func (PingInteraction) AuthorizingIntegrationOwners() map[ApplicationIntegrationType]snowflake.ID
- func (PingInteraction) Channel() InteractionChannel
- func (PingInteraction) ChannelID() snowflake.ID
- func (PingInteraction) Context() InteractionContextType
- func (i PingInteraction) CreatedAt() time.Time
- func (PingInteraction) Entitlements() []Entitlement
- func (PingInteraction) GuildID() *snowflake.ID
- func (PingInteraction) GuildLocale() *Locale
- func (i PingInteraction) ID() snowflake.ID
- func (PingInteraction) Locale() Locale
- func (i PingInteraction) MarshalJSON() ([]byte, error)
- func (PingInteraction) Member() *ResolvedMember
- func (PingInteraction) PartialGuild() *InteractionGuild
- func (i PingInteraction) Token() string
- func (PingInteraction) Type() InteractionType
- func (i *PingInteraction) UnmarshalJSON(data []byte) error
- func (PingInteraction) User() User
- func (i PingInteraction) Version() int
- type Poll
- type PollAnswer
- type PollAnswerCount
- type PollCreate
- type PollCreateBuilder
- func (b *PollCreateBuilder) AddAnswer(text string, emoji *PartialEmoji) *PollCreateBuilder
- func (b *PollCreateBuilder) Build() PollCreate
- func (b *PollCreateBuilder) ClearAnswers() *PollCreateBuilder
- func (b *PollCreateBuilder) RemoveAnswer(i int) *PollCreateBuilder
- func (b *PollCreateBuilder) SetAllowMultiselect(multiselect bool) *PollCreateBuilder
- func (b *PollCreateBuilder) SetAnswers(answers ...PollMedia) *PollCreateBuilder
- func (b *PollCreateBuilder) SetDuration(duration int) *PollCreateBuilder
- func (b *PollCreateBuilder) SetLayoutType(layout PollLayoutType) *PollCreateBuilder
- func (b *PollCreateBuilder) SetQuestion(text string) *PollCreateBuilder
- type PollLayoutType
- type PollMedia
- type PollResults
- type PremiumTier
- type PremiumType
- type Presence
- type PresenceUser
- type PrimaryGuild
- type QueryValues
- type RadioGroupComponent
- func (c RadioGroupComponent) GetCustomID() string
- func (c RadioGroupComponent) GetID() int
- func (c RadioGroupComponent) MarshalJSON() ([]byte, error)
- func (RadioGroupComponent) Type() ComponentType
- func (c RadioGroupComponent) WithCustomID(customID string) RadioGroupComponent
- func (c RadioGroupComponent) WithID(id int) RadioGroupComponent
- func (c RadioGroupComponent) WithOptions(options ...RadioGroupOption) RadioGroupComponent
- func (c RadioGroupComponent) WithRequired(required bool) RadioGroupComponent
- type RadioGroupOption
- type ReactionCountDetails
- type ResolvedChannel
- type ResolvedData
- type ResolvedMember
- type RestGuild
- type Role
- type RoleColors
- type RoleCreate
- type RoleFlags
- type RolePermissionOverwrite
- type RolePermissionOverwriteUpdate
- type RolePositionUpdate
- type RoleSelectMenuComponent
- func (c RoleSelectMenuComponent) AddDefaultValue(defaultValue snowflake.ID) RoleSelectMenuComponent
- func (c RoleSelectMenuComponent) AsDisabled() RoleSelectMenuComponent
- func (c RoleSelectMenuComponent) AsEnabled() RoleSelectMenuComponent
- func (c RoleSelectMenuComponent) GetCustomID() string
- func (c RoleSelectMenuComponent) GetID() int
- func (c RoleSelectMenuComponent) MarshalJSON() ([]byte, error)
- func (c RoleSelectMenuComponent) RemoveDefaultValue(index int) RoleSelectMenuComponent
- func (c RoleSelectMenuComponent) SetDefaultValues(defaultValues ...snowflake.ID) RoleSelectMenuComponent
- func (RoleSelectMenuComponent) Type() ComponentType
- func (c RoleSelectMenuComponent) WithCustomID(customID string) RoleSelectMenuComponent
- func (c RoleSelectMenuComponent) WithDisabled(disabled bool) RoleSelectMenuComponent
- func (c RoleSelectMenuComponent) WithID(id int) RoleSelectMenuComponent
- func (c RoleSelectMenuComponent) WithMaxValues(maxValue int) RoleSelectMenuComponent
- func (c RoleSelectMenuComponent) WithMinValues(minValue int) RoleSelectMenuComponent
- func (c RoleSelectMenuComponent) WithPlaceholder(placeholder string) RoleSelectMenuComponent
- func (c RoleSelectMenuComponent) WithRequired(required bool) RoleSelectMenuComponent
- type RoleSelectMenuInteractionData
- func (d RoleSelectMenuInteractionData) CustomID() string
- func (d RoleSelectMenuInteractionData) MarshalJSON() ([]byte, error)
- func (d RoleSelectMenuInteractionData) Roles() []Role
- func (RoleSelectMenuInteractionData) Type() ComponentType
- func (d *RoleSelectMenuInteractionData) UnmarshalJSON(data []byte) error
- type RoleSelectMenuResolved
- type RoleSubscriptionData
- type RoleTag
- type RoleUpdate
- type SKU
- type SKUFlags
- type SKUType
- type ScheduledEventEntityType
- type ScheduledEventPrivacyLevel
- type ScheduledEventRecurrenceRule
- type ScheduledEventRecurrenceRuleFrequency
- type ScheduledEventRecurrenceRuleMonth
- type ScheduledEventRecurrenceRuleNWeekday
- type ScheduledEventRecurrenceRuleWeekday
- type ScheduledEventStatus
- type SectionAccessoryComponent
- type SectionComponent
- func (c SectionComponent) AddComponents(components ...SectionSubComponent) SectionComponent
- func (c SectionComponent) GetID() int
- func (c SectionComponent) MarshalJSON() ([]byte, error)
- func (c SectionComponent) RemoveComponent(id int) SectionComponent
- func (c SectionComponent) SubComponents() iter.Seq[Component]
- func (SectionComponent) Type() ComponentType
- func (c *SectionComponent) UnmarshalJSON(data []byte) error
- func (c SectionComponent) UpdateComponent(id int, component SectionSubComponent) SectionComponent
- func (c SectionComponent) WithAccessory(accessory SectionAccessoryComponent) SectionComponent
- func (c SectionComponent) WithComponents(components ...SectionSubComponent) SectionComponent
- func (c SectionComponent) WithID(id int) SectionComponent
- type SectionSubComponent
- type SelectMenuComponent
- type SelectMenuDefaultValue
- type SelectMenuDefaultValueType
- type SelectMenuInteractionData
- type SendSoundboardSound
- type SeparatorComponent
- func (c SeparatorComponent) GetID() int
- func (c SeparatorComponent) MarshalJSON() ([]byte, error)
- func (SeparatorComponent) Type() ComponentType
- func (c SeparatorComponent) WithDivider(divider bool) SeparatorComponent
- func (c SeparatorComponent) WithID(i int) LayoutComponent
- func (c SeparatorComponent) WithSpacing(spacing SeparatorSpacingSize) SeparatorComponent
- type SeparatorSpacingSize
- type SessionStartLimit
- type SlashCommand
- func (c SlashCommand) ApplicationID() snowflake.ID
- func (c SlashCommand) Contexts() []InteractionContextType
- func (c SlashCommand) CreatedAt() time.Time
- func (c SlashCommand) DMPermission() bool
- func (c SlashCommand) DefaultMemberPermissions() Permissions
- func (c SlashCommand) GuildID() *snowflake.ID
- func (c SlashCommand) ID() snowflake.ID
- func (c SlashCommand) IntegrationTypes() []ApplicationIntegrationType
- func (c SlashCommand) MarshalJSON() ([]byte, error)
- func (c SlashCommand) Mention() string
- func (c SlashCommand) NSFW() bool
- func (c SlashCommand) Name() string
- func (c SlashCommand) NameLocalizations() map[Locale]string
- func (c SlashCommand) NameLocalized() string
- func (SlashCommand) Type() ApplicationCommandType
- func (c *SlashCommand) UnmarshalJSON(data []byte) error
- func (c SlashCommand) Version() snowflake.ID
- type SlashCommandCreate
- type SlashCommandInteractionData
- func (d SlashCommandInteractionData) All() []SlashCommandOption
- func (d SlashCommandInteractionData) Attachment(name string) Attachment
- func (d SlashCommandInteractionData) Bool(name string) bool
- func (d SlashCommandInteractionData) Channel(name string) ResolvedChannel
- func (d SlashCommandInteractionData) CommandID() snowflake.ID
- func (d SlashCommandInteractionData) CommandName() string
- func (d SlashCommandInteractionData) CommandPath() string
- func (d SlashCommandInteractionData) Find(optionFindFunc func(option SlashCommandOption) bool) (SlashCommandOption, bool)
- func (d SlashCommandInteractionData) FindAll(optionFindFunc func(option SlashCommandOption) bool) []SlashCommandOption
- func (d SlashCommandInteractionData) Float(name string) float64
- func (d SlashCommandInteractionData) GetByType(optionType ApplicationCommandOptionType) []SlashCommandOption
- func (d SlashCommandInteractionData) GuildID() *snowflake.ID
- func (d SlashCommandInteractionData) Int(name string) int
- func (d SlashCommandInteractionData) MarshalJSON() ([]byte, error)
- func (d SlashCommandInteractionData) Member(name string) ResolvedMember
- func (d SlashCommandInteractionData) Mentionable(name string) MentionableValue
- func (d SlashCommandInteractionData) OptAttachment(name string) (Attachment, bool)
- func (d SlashCommandInteractionData) OptBool(name string) (bool, bool)
- func (d SlashCommandInteractionData) OptChannel(name string) (ResolvedChannel, bool)
- func (d SlashCommandInteractionData) OptFloat(name string) (float64, bool)
- func (d SlashCommandInteractionData) OptInt(name string) (int, bool)
- func (d SlashCommandInteractionData) OptMember(name string) (ResolvedMember, bool)
- func (d SlashCommandInteractionData) OptMentionable(name string) (MentionableValue, bool)
- func (d SlashCommandInteractionData) OptRole(name string) (Role, bool)
- func (d SlashCommandInteractionData) OptSnowflake(name string) (snowflake.ID, bool)
- func (d SlashCommandInteractionData) OptString(name string) (string, bool)
- func (d SlashCommandInteractionData) OptUser(name string) (User, bool)
- func (d SlashCommandInteractionData) Option(name string) (SlashCommandOption, bool)
- func (d SlashCommandInteractionData) Role(name string) Role
- func (d SlashCommandInteractionData) Snowflake(name string) snowflake.ID
- func (d SlashCommandInteractionData) String(name string) string
- func (SlashCommandInteractionData) Type() ApplicationCommandType
- func (d *SlashCommandInteractionData) UnmarshalJSON(data []byte) error
- func (d SlashCommandInteractionData) User(name string) User
- type SlashCommandOption
- type SlashCommandOptionSubCommand
- type SlashCommandOptionSubCommandGroup
- type SlashCommandUpdate
- type Sound
- type SoundType
- type SoundboardSound
- type SoundboardSoundCreate
- type SoundboardSoundUpdate
- type StageInstance
- type StageInstanceCreate
- type StageInstanceUpdate
- type StagePrivacyLevel
- type Sticker
- type StickerCreate
- type StickerFormatType
- type StickerPack
- type StickerPacks
- type StickerType
- type StickerUpdate
- type StringSelectMenuComponent
- func (c StringSelectMenuComponent) AddOptions(options ...StringSelectMenuOption) StringSelectMenuComponent
- func (c StringSelectMenuComponent) AsDisabled() StringSelectMenuComponent
- func (c StringSelectMenuComponent) AsEnabled() StringSelectMenuComponent
- func (c StringSelectMenuComponent) GetCustomID() string
- func (c StringSelectMenuComponent) GetID() int
- func (c StringSelectMenuComponent) MarshalJSON() ([]byte, error)
- func (c StringSelectMenuComponent) RemoveOption(index int) StringSelectMenuComponent
- func (c StringSelectMenuComponent) SetOption(value string, option StringSelectMenuOption) StringSelectMenuComponent
- func (c StringSelectMenuComponent) SetOptions(options ...StringSelectMenuOption) StringSelectMenuComponent
- func (StringSelectMenuComponent) Type() ComponentType
- func (c StringSelectMenuComponent) WithCustomID(customID string) StringSelectMenuComponent
- func (c StringSelectMenuComponent) WithDisabled(disabled bool) StringSelectMenuComponent
- func (c StringSelectMenuComponent) WithID(id int) StringSelectMenuComponent
- func (c StringSelectMenuComponent) WithMaxValues(maxValue int) StringSelectMenuComponent
- func (c StringSelectMenuComponent) WithMinValues(minValue int) StringSelectMenuComponent
- func (c StringSelectMenuComponent) WithPlaceholder(placeholder string) StringSelectMenuComponent
- func (c StringSelectMenuComponent) WithRequired(required bool) StringSelectMenuComponent
- type StringSelectMenuInteractionData
- type StringSelectMenuOption
- func (o StringSelectMenuOption) WithDefault(defaultOption bool) StringSelectMenuOption
- func (o StringSelectMenuOption) WithDescription(description string) StringSelectMenuOption
- func (o StringSelectMenuOption) WithEmoji(emoji ComponentEmoji) StringSelectMenuOption
- func (o StringSelectMenuOption) WithLabel(label string) StringSelectMenuOption
- func (o StringSelectMenuOption) WithValue(value string) StringSelectMenuOption
- type Subscription
- type SubscriptionStatus
- type SystemChannelFlags
- type TargetUsersJobStatus
- type TargetUsersJobStatusCode
- type Team
- type TeamMember
- type TeamRole
- type TemplateGuild
- type TestEntitlementCreate
- type TextDisplayComponent
- type TextInputComponent
- func (c TextInputComponent) GetCustomID() string
- func (c TextInputComponent) GetID() int
- func (c TextInputComponent) MarshalJSON() ([]byte, error)
- func (TextInputComponent) Type() ComponentType
- func (c TextInputComponent) WithCustomID(customID string) TextInputComponent
- func (c TextInputComponent) WithID(id int) TextInputComponent
- func (c TextInputComponent) WithMaxLength(maxLength int) TextInputComponent
- func (c TextInputComponent) WithMinLength(minLength int) TextInputComponent
- func (c TextInputComponent) WithPlaceholder(placeholder string) TextInputComponent
- func (c TextInputComponent) WithRequired(required bool) TextInputComponent
- func (c TextInputComponent) WithStyle(style TextInputStyle) TextInputComponent
- func (c TextInputComponent) WithValue(value string) TextInputComponent
- type TextInputStyle
- type ThreadChannelPost
- type ThreadChannelPostCreate
- type ThreadCreate
- type ThreadCreateFromMessage
- type ThreadMember
- type ThreadMemberFlags
- type ThreadMetadata
- type ThumbnailComponent
- func (c ThumbnailComponent) GetID() int
- func (c ThumbnailComponent) MarshalJSON() ([]byte, error)
- func (ThumbnailComponent) Type() ComponentType
- func (c ThumbnailComponent) WithDescription(description string) ThumbnailComponent
- func (c ThumbnailComponent) WithID(id int) ThumbnailComponent
- func (c ThumbnailComponent) WithMediaURL(url string) ThumbnailComponent
- func (c ThumbnailComponent) WithSpoiler(spoiler bool) ThumbnailComponent
- type Timestamp
- type TimestampStyle
- type TokenType
- type TwitchIntegration
- type UnavailableGuild
- type UnfurledMediaItem
- type UnfurledMediaItemLoadingState
- type UnknownComponent
- type UnmarshalApplicationCommand
- type UnmarshalApplicationCommandOption
- type UnmarshalApplicationCommandPermission
- type UnmarshalAutocompleteOption
- type UnmarshalChannel
- type UnmarshalComponent
- type UnmarshalIntegration
- type UnmarshalPermissionOverwrite
- type UnmarshalSlashCommandOption
- type UnmarshalWebhook
- type User
- func (u User) AvatarDecorationURL(opts ...CDNOpt) *string
- func (u User) AvatarURL(opts ...CDNOpt) *string
- func (u User) BannerURL(opts ...CDNOpt) *string
- func (u User) CreatedAt() time.Time
- func (u User) DefaultAvatarURL(opts ...CDNOpt) string
- func (u User) EffectiveAvatarURL(opts ...CDNOpt) string
- func (u User) EffectiveName() string
- func (u User) GuildTagURL(opts ...CDNOpt) *string
- func (u User) Mention() string
- func (u User) String() string
- func (u User) Tag() string
- type UserCommand
- func (c UserCommand) ApplicationID() snowflake.ID
- func (c UserCommand) Contexts() []InteractionContextType
- func (c UserCommand) CreatedAt() time.Time
- func (c UserCommand) DMPermission() bool
- func (c UserCommand) DefaultMemberPermissions() Permissions
- func (c UserCommand) GuildID() *snowflake.ID
- func (c UserCommand) ID() snowflake.ID
- func (c UserCommand) IntegrationTypes() []ApplicationIntegrationType
- func (c UserCommand) MarshalJSON() ([]byte, error)
- func (c UserCommand) NSFW() bool
- func (c UserCommand) Name() string
- func (c UserCommand) NameLocalizations() map[Locale]string
- func (c UserCommand) NameLocalized() string
- func (c UserCommand) Type() ApplicationCommandType
- func (c *UserCommand) UnmarshalJSON(data []byte) error
- func (c UserCommand) Version() snowflake.ID
- type UserCommandCreate
- type UserCommandInteractionData
- func (d UserCommandInteractionData) CommandID() snowflake.ID
- func (d UserCommandInteractionData) CommandName() string
- func (d UserCommandInteractionData) GuildID() *snowflake.ID
- func (d *UserCommandInteractionData) MarshalJSON() ([]byte, error)
- func (d UserCommandInteractionData) TargetID() snowflake.ID
- func (d UserCommandInteractionData) TargetMember() ResolvedMember
- func (d UserCommandInteractionData) TargetUser() User
- func (UserCommandInteractionData) Type() ApplicationCommandType
- func (d *UserCommandInteractionData) UnmarshalJSON(data []byte) error
- type UserCommandResolved
- type UserCommandUpdate
- type UserFlags
- type UserSelectMenuComponent
- func (c UserSelectMenuComponent) AddDefaultValue(defaultValue snowflake.ID) UserSelectMenuComponent
- func (c UserSelectMenuComponent) AsDisabled() UserSelectMenuComponent
- func (c UserSelectMenuComponent) AsEnabled() UserSelectMenuComponent
- func (c UserSelectMenuComponent) GetCustomID() string
- func (c UserSelectMenuComponent) GetID() int
- func (c UserSelectMenuComponent) MarshalJSON() ([]byte, error)
- func (c UserSelectMenuComponent) RemoveDefaultValue(index int) UserSelectMenuComponent
- func (c UserSelectMenuComponent) SetDefaultValues(defaultValues ...snowflake.ID) UserSelectMenuComponent
- func (UserSelectMenuComponent) Type() ComponentType
- func (c UserSelectMenuComponent) WithCustomID(customID string) UserSelectMenuComponent
- func (c UserSelectMenuComponent) WithDisabled(disabled bool) UserSelectMenuComponent
- func (c UserSelectMenuComponent) WithID(id int) UserSelectMenuComponent
- func (c UserSelectMenuComponent) WithMaxValues(maxValue int) UserSelectMenuComponent
- func (c UserSelectMenuComponent) WithMinValues(minValue int) UserSelectMenuComponent
- func (c UserSelectMenuComponent) WithPlaceholder(placeholder string) UserSelectMenuComponent
- func (c UserSelectMenuComponent) WithRequired(required bool) UserSelectMenuComponent
- type UserSelectMenuInteractionData
- func (d UserSelectMenuInteractionData) CustomID() string
- func (d UserSelectMenuInteractionData) MarshalJSON() ([]byte, error)
- func (d UserSelectMenuInteractionData) Members() []ResolvedMember
- func (UserSelectMenuInteractionData) Type() ComponentType
- func (d *UserSelectMenuInteractionData) UnmarshalJSON(data []byte) error
- func (d UserSelectMenuInteractionData) Users() []User
- type UserSelectMenuResolved
- type UserUpdate
- type UserVoiceStateUpdate
- type VerificationLevel
- type VideoQualityMode
- type VisibilityType
- type VoiceChannelEffectAnimationType
- type VoiceRegion
- type VoiceState
- type Webhook
- type WebhookCreate
- type WebhookMessageCreate
- func (m WebhookMessageCreate) AddActionRow(components ...InteractiveComponent) WebhookMessageCreate
- func (m WebhookMessageCreate) AddAppliedTags(appliedTags ...snowflake.ID) WebhookMessageCreate
- func (m WebhookMessageCreate) AddComponents(containers ...LayoutComponent) WebhookMessageCreate
- func (m WebhookMessageCreate) AddEmbeds(embeds ...Embed) WebhookMessageCreate
- func (m WebhookMessageCreate) AddFile(name string, description string, reader io.Reader, flags ...FileFlags) WebhookMessageCreate
- func (m WebhookMessageCreate) AddFiles(files ...*File) WebhookMessageCreate
- func (m WebhookMessageCreate) AddFlags(flags ...MessageFlags) WebhookMessageCreate
- func (m WebhookMessageCreate) ClearAllowedMentions() WebhookMessageCreate
- func (m WebhookMessageCreate) ClearAppliedTags() WebhookMessageCreate
- func (m WebhookMessageCreate) ClearComponents() WebhookMessageCreate
- func (m WebhookMessageCreate) ClearEmbeds() WebhookMessageCreate
- func (m WebhookMessageCreate) ClearFiles() WebhookMessageCreate
- func (m WebhookMessageCreate) ClearFlags() WebhookMessageCreate
- func (m WebhookMessageCreate) ClearPoll() WebhookMessageCreate
- func (m WebhookMessageCreate) RemoveAppliedTag(tagId snowflake.ID) WebhookMessageCreate
- func (m WebhookMessageCreate) RemoveComponent(id int) WebhookMessageCreate
- func (m WebhookMessageCreate) RemoveEmbed(i int) WebhookMessageCreate
- func (m WebhookMessageCreate) RemoveFile(i int) WebhookMessageCreate
- func (m WebhookMessageCreate) RemoveFlags(flags ...MessageFlags) WebhookMessageCreate
- func (m WebhookMessageCreate) ToBody() (any, error)
- func (m WebhookMessageCreate) UpdateComponent(id int, component LayoutComponent) WebhookMessageCreate
- func (m WebhookMessageCreate) UpdateFile(i int, file *File) WebhookMessageCreate
- func (m WebhookMessageCreate) WithAllowedMentions(allowedMentions *AllowedMentions) WebhookMessageCreate
- func (m WebhookMessageCreate) WithAppliedTags(appliedTags ...snowflake.ID) WebhookMessageCreate
- func (m WebhookMessageCreate) WithAvatarURL(url string) WebhookMessageCreate
- func (m WebhookMessageCreate) WithComponents(components ...LayoutComponent) WebhookMessageCreate
- func (m WebhookMessageCreate) WithContent(content string) WebhookMessageCreate
- func (m WebhookMessageCreate) WithContentf(content string, a ...any) WebhookMessageCreate
- func (m WebhookMessageCreate) WithEmbed(i int, embed Embed) WebhookMessageCreate
- func (m WebhookMessageCreate) WithEmbeds(embeds ...Embed) WebhookMessageCreate
- func (m WebhookMessageCreate) WithFiles(files ...*File) WebhookMessageCreate
- func (m WebhookMessageCreate) WithFlags(flags ...MessageFlags) WebhookMessageCreate
- func (m WebhookMessageCreate) WithIsComponentsV2(isComponentV2 bool) WebhookMessageCreate
- func (m WebhookMessageCreate) WithPoll(poll PollCreate) WebhookMessageCreate
- func (m WebhookMessageCreate) WithSuppressEmbeds(suppressEmbeds bool) WebhookMessageCreate
- func (m WebhookMessageCreate) WithSuppressNotifications(suppressNotifications bool) WebhookMessageCreate
- func (m WebhookMessageCreate) WithTTS(tts bool) WebhookMessageCreate
- func (m WebhookMessageCreate) WithThreadName(threadName string) WebhookMessageCreate
- func (m WebhookMessageCreate) WithUsername(username string) WebhookMessageCreate
- type WebhookMessageUpdate
- func (m WebhookMessageUpdate) AddActionRow(components ...InteractiveComponent) WebhookMessageUpdate
- func (m WebhookMessageUpdate) AddComponents(containers ...LayoutComponent) WebhookMessageUpdate
- func (m WebhookMessageUpdate) AddEmbeds(embeds ...Embed) WebhookMessageUpdate
- func (m WebhookMessageUpdate) AddFile(name string, description string, reader io.Reader, flags ...FileFlags) WebhookMessageUpdate
- func (m WebhookMessageUpdate) AddFiles(files ...*File) WebhookMessageUpdate
- func (m WebhookMessageUpdate) AddFlags(flags ...MessageFlags) WebhookMessageUpdate
- func (m WebhookMessageUpdate) ClearAllowedMentions() WebhookMessageUpdate
- func (m WebhookMessageUpdate) ClearComponents() WebhookMessageUpdate
- func (m WebhookMessageUpdate) ClearContent() WebhookMessageUpdate
- func (m WebhookMessageUpdate) ClearEmbeds() WebhookMessageUpdate
- func (m WebhookMessageUpdate) ClearFiles() WebhookMessageUpdate
- func (m WebhookMessageUpdate) ClearFlags() WebhookMessageUpdate
- func (m WebhookMessageUpdate) ClearPoll() WebhookMessageUpdate
- func (m WebhookMessageUpdate) RemoveComponent(id int) WebhookMessageUpdate
- func (m WebhookMessageUpdate) RemoveEmbed(i int) WebhookMessageUpdate
- func (m WebhookMessageUpdate) RemoveFile(i int) WebhookMessageUpdate
- func (m WebhookMessageUpdate) RemoveFlags(flags ...MessageFlags) WebhookMessageUpdate
- func (m WebhookMessageUpdate) RetainAttachments(attachments ...Attachment) WebhookMessageUpdate
- func (m WebhookMessageUpdate) RetainAttachmentsByID(attachmentIDs ...snowflake.ID) WebhookMessageUpdate
- func (m WebhookMessageUpdate) ToBody() (any, error)
- func (m WebhookMessageUpdate) UpdateComponent(id int, component LayoutComponent) WebhookMessageUpdate
- func (m WebhookMessageUpdate) UpdateFile(i int, file *File) WebhookMessageUpdate
- func (m WebhookMessageUpdate) WithAllowedMentions(allowedMentions *AllowedMentions) WebhookMessageUpdate
- func (m WebhookMessageUpdate) WithComponents(components ...LayoutComponent) WebhookMessageUpdate
- func (m WebhookMessageUpdate) WithContent(content string) WebhookMessageUpdate
- func (m WebhookMessageUpdate) WithContentf(content string, a ...any) WebhookMessageUpdate
- func (m WebhookMessageUpdate) WithEmbed(i int, embed Embed) WebhookMessageUpdate
- func (m WebhookMessageUpdate) WithEmbeds(embeds ...Embed) WebhookMessageUpdate
- func (m WebhookMessageUpdate) WithFiles(files ...*File) WebhookMessageUpdate
- func (m WebhookMessageUpdate) WithFlags(flags MessageFlags) WebhookMessageUpdate
- func (m WebhookMessageUpdate) WithIsComponentsV2(isComponentV2 bool) WebhookMessageUpdate
- func (m WebhookMessageUpdate) WithPoll(poll PollCreate) WebhookMessageUpdate
- func (m WebhookMessageUpdate) WithSuppressEmbeds(suppressEmbeds bool) WebhookMessageUpdate
- type WebhookSourceChannel
- type WebhookSourceGuild
- type WebhookType
- type WebhookUpdate
- type WebhookUpdateWithToken
- type YouTubeIntegration
Constants ¶
const ( ApplicationFlagAutoModerationRuleCreateBadge = 1 << (iota + 6) ApplicationFlagGatewayPresence ApplicationFlagGatewayPresenceLimited ApplicationFlagGatewayGuildMembers ApplicationFlagGatewayGuildMemberLimited ApplicationFlagVerificationPendingGuildLimit ApplicationFlagEmbedded ApplicationFlagGatewayMessageContent ApplicationFlagGatewayMessageContentLimited ApplicationFlagApplicationCommandBadge )
const ( CDN = "https://cdn.discordapp.com" CDNMedia = "https://media.discordapp.net" )
const MessageURLFmt = "https://discord.com/channels/%s/%d/%d"
const ScopeSeparator = " "
Variables ¶
var ( CustomEmoji = NewCDN("/emojis/{emote.id}", FileFormatPNG, FileFormatWebP, FileFormatAVIF, FileFormatGIF) GuildIcon = NewCDN("/icons/{guild.id}/{guild.icon.hash}", FileFormatPNG, FileFormatJPEG, FileFormatWebP, FileFormatGIF) GuildSplash = NewCDN("/splashes/{guild.id}/{guild.splash.hash}", FileFormatPNG, FileFormatJPEG, FileFormatWebP) GuildDiscoverySplash = NewCDN("/discovery-splashes/{guild.id}/{guild.discovery.splash.hash}", FileFormatPNG, FileFormatJPEG, FileFormatWebP) GuildBanner = NewCDN("/banners/{guild.id}/{guild.banner.hash}", FileFormatPNG, FileFormatJPEG, FileFormatWebP, FileFormatGIF) GuildScheduledEventCover = NewCDN("/guild-events/{event.id}/{event.cover.hash}", FileFormatPNG, FileFormatJPEG, FileFormatWebP) RoleIcon = NewCDN("/role-icons/{role.id}/{role.icon.hash}", FileFormatPNG, FileFormatJPEG) UserBanner = NewCDN("/banners/{user.id}/{user.banner.hash}", FileFormatPNG, FileFormatJPEG, FileFormatWebP, FileFormatGIF) UserAvatar = NewCDN("/avatars/{user.id}/{user.avatar.hash}", FileFormatPNG, FileFormatJPEG, FileFormatWebP, FileFormatGIF) DefaultUserAvatar = NewCDN("/embed/avatars/{index}", FileFormatPNG) ChannelIcon = NewCDN("/channel-icons/{channel.id}/{channel.icon.hash}", FileFormatPNG, FileFormatJPEG, FileFormatWebP) MemberAvatar = NewCDN("/guilds/{guild.id}/users/{user.id}/avatars/{member.avatar.hash}", FileFormatPNG, FileFormatJPEG, FileFormatWebP, FileFormatGIF) MemberBanner = NewCDN("/guilds/{guild.id}/users/{user.id}/banners/{member.avatar.hash}", FileFormatPNG, FileFormatJPEG, FileFormatWebP, FileFormatGIF) AvatarDecoration = NewCDN("/avatar-decoration-presets/{user.avatar.decoration.hash}", FileFormatPNG) GuildTagBadge = NewCDN("/guild-tag-badges/{guild.id}/{badge.hash}", FileFormatPNG, FileFormatJPEG, FileFormatWebP) ApplicationIcon = NewCDN("/app-icons/{application.id}/{icon.hash}", FileFormatPNG, FileFormatJPEG, FileFormatWebP) ApplicationCover = NewCDN("/app-assets/{application.id}/{cover.image.hash}", FileFormatPNG, FileFormatJPEG, FileFormatWebP) ApplicationAsset = NewCDN("/app-assets/{application.id}/{asset.id}", FileFormatPNG, FileFormatJPEG, FileFormatWebP) AchievementIcon = NewCDN("/app-assets/{application.id}/achievements/{achievement.id}/icons/{icon.hash}", FileFormatPNG, FileFormatJPEG, FileFormatWebP) StorePageAsset = NewCDN("/app-assets/{application.id}/store/{asset.id}", FileFormatPNG, FileFormatJPEG, FileFormatWebP) TeamIcon = NewCDN("/team-icons/{team.id}/{team.icon.hash}", FileFormatPNG, FileFormatJPEG, FileFormatWebP) StickerPackBanner = NewCDN("/app-assets/710982414301790216/store/{banner.asset.id}", FileFormatPNG, FileFormatJPEG, FileFormatWebP) CustomSticker = NewCDN("/stickers/{sticker.id}", FileFormatPNG, FileFormatLottie, FileFormatGIF) AttachmentFile = NewCDN("/attachments/{channel.id}/{attachment.id}/{file.name}", FileFormatNone) SoundboardSoundFile = NewCDN("/soundboard-sounds/{sound.id}", FileFormatNone) NameplateAsset = NewCDN("/assets/collectibles/{nameplate.asset}/asset", FileFormatWebM) )
var ( ErrNoGatewayOrShardManager = errors.New("no gateway or shard manager configured") ErrNoGuildMembersIntent = errors.New("this operation requires the GUILD_MEMBERS intent") ErrNoShardManager = errors.New("no shard manager configured") ErrNoGateway = errors.New("no gateway configured") ErrGatewayAlreadyConnected = errors.New("gateway is already connected") ErrShardNotConnected = errors.New("shard is not connected") ErrShardNotReady = errors.New("shard is not ready") ErrShardNotFound = errors.New("shard not found in shard manager") ErrNoHTTPServer = errors.New("no http server configured") ErrInvalidBotToken = errors.New("token is not in a valid format") ErrNoBotToken = errors.New("please specify the token") ErrInteractionAlreadyReplied = errors.New("you already replied to this interaction") ErrInteractionExpired = errors.New("this interaction has expired") ErrCheckFailed = errors.New("check failed") )
var ( MentionTypeUser = MentionType{regexp.MustCompile(`<@!?(\d+)>`)} MentionTypeRole = MentionType{regexp.MustCompile(`<@&(\d+)>`)} MentionTypeChannel = MentionType{regexp.MustCompile(`<#(\d+)>`)} MentionTypeEmoji = MentionType{regexp.MustCompile(`<a?:(\w+):(\d+)>`)} MentionTypeTimestamp = MentionType{regexp.MustCompile(`<t:(?P<time>-?\d{1,17})(?::(?P<format>[tTdDfFsSR]))?>`)} MentionTypeSlashCommand = MentionType{regexp.MustCompile(`</(\w+) ?((\w+)|(\w+ \w+)):(\d+)>`)} MentionTypeHere = MentionType{regexp.MustCompile(`@here`)} MentionTypeEveryone = MentionType{regexp.MustCompile(`@everyone`)} MentionTypeLinkedRole = MentionType{regexp.MustCompile(`<id:linked-roles:(\d+)>`)} MentionTypeEmail = MentionType{regexp.MustCompile(`<.+@.+>`)} MentionTypePhoneNumber = MentionType{regexp.MustCompile(`<\+.+>`)} )
var ErrNoTimestampMatch = errors.New("no matching timestamp found in string")
ErrNoTimestampMatch is returned when no valid Timestamp is found in the Message
var Locales = map[Locale]string{ LocaleEnglishUS: "English (United States)", LocaleEnglishGB: "English (Great Britain)", LocaleBulgarian: "Bulgarian", LocaleChineseCN: "Chinese (China)", LocaleChineseTW: "Chinese (Taiwan)", LocaleCroatian: "Croatian", LocaleCzech: "Czech", LocaleDanish: "Danish", LocaleDutch: "Dutch", LocaleFinnish: "Finnish", LocaleFrench: "French", LocaleGerman: "German", LocaleGreek: "Greek", LocaleHindi: "Hindi", LocaleHungarian: "Hungarian", LocaleIndonesian: "Indonesian", LocaleItalian: "Italian", LocaleJapanese: "Japanese", LocaleKorean: "Korean", LocaleLithuanian: "Lithuanian", LocaleNorwegian: "Norwegian", LocalePolish: "Polish", LocalePortugueseBR: "Portuguese (Brazil)", LocaleRomanian: "Romanian", LocaleRussian: "Russian", LocaleSpanishES: "Spanish (Spain)", LocaleSwedish: "Swedish", LocaleThai: "Thai", LocaleTurkish: "Turkish", LocaleUkrainian: "Ukrainian", LocaleVietnamese: "Vietnamese", LocaleUnknown: "unknown", }
Functions ¶
func AuthorizeURL ¶ added in v0.13.11
func AuthorizeURL(values QueryValues) string
AuthorizeURL returns the OAuth2 authorize url with the given query params
func ChannelMention ¶
func EmailMention ¶ added in v0.19.0
func FormattedTimestampMention ¶
func FormattedTimestampMention(timestamp int64, style TimestampStyle) string
func HasScope ¶
func HasScope(scope OAuth2Scope, scopes ...OAuth2Scope) bool
func JoinScopes ¶
func JoinScopes(scopes []OAuth2Scope) string
func MessageURL ¶ added in v0.13.18
func NavigationBrowseMention ¶ added in v0.16.9
func NavigationBrowseMention() string
func NavigationCustomizeMention ¶ added in v0.16.9
func NavigationCustomizeMention() string
func NavigationGuideMention ¶ added in v0.16.9
func NavigationGuideMention() string
func NavigationLinkedRole ¶ added in v0.18.12
func NavigationLinkedRoles ¶ added in v0.18.12
func NavigationLinkedRoles() string
func PhoneNumberMention ¶ added in v0.19.0
func RoleMention ¶
func SlashCommandMention ¶ added in v0.13.17
SlashCommandMention creates a slash command mention. You can also pass a subcommand (and/or a subcommand group respectively) to the path.
mention := SlashCommandMention(id, "command group subcommand")
func TimestampMention ¶
func UserMention ¶
Types ¶
type AccessTokenResponse ¶ added in v0.12.0
type AccessTokenResponse struct {
AccessToken string `json:"access_token"`
TokenType TokenType `json:"token_type"`
ExpiresIn time.Duration `json:"expires_in"`
RefreshToken string `json:"refresh_token"`
Scope []OAuth2Scope `json:"scope"`
// Webhook is only present if scopes include the OAuth2ScopeWebhookIncoming
Webhook *IncomingWebhook `json:"webhook"`
}
AccessTokenResponse is the response from the OAuth2 exchange endpoint. See https://discord.com/developers/docs/topics/oauth2#authorization-code-grant for more information.
func (AccessTokenResponse) MarshalJSON ¶ added in v0.12.0
func (e AccessTokenResponse) MarshalJSON() ([]byte, error)
func (*AccessTokenResponse) UnmarshalJSON ¶ added in v0.12.0
func (e *AccessTokenResponse) UnmarshalJSON(data []byte) error
UnmarshalJSON implements json.Unmarshaler.
type ActionRowComponent ¶
type ActionRowComponent struct {
ID int `json:"id,omitempty"`
Components []InteractiveComponent `json:"components"`
}
func NewActionRow ¶
func NewActionRow(components ...InteractiveComponent) ActionRowComponent
func (ActionRowComponent) AddComponents ¶
func (c ActionRowComponent) AddComponents(components ...InteractiveComponent) ActionRowComponent
AddComponents returns a new ActionRowComponent with the provided Component(s) added
func (ActionRowComponent) GetID ¶ added in v0.19.0
func (c ActionRowComponent) GetID() int
func (ActionRowComponent) MarshalJSON ¶
func (c ActionRowComponent) MarshalJSON() ([]byte, error)
func (ActionRowComponent) RemoveComponent ¶
func (c ActionRowComponent) RemoveComponent(id int) ActionRowComponent
RemoveComponent returns a new ActionRowComponent with the provided Component which has the provided id removed.
func (ActionRowComponent) SubComponents ¶ added in v0.19.0
func (c ActionRowComponent) SubComponents() iter.Seq[Component]
SubComponents returns an [iter.Seq[Component]] over the sub Component(s) of the ActionRowComponent.
func (ActionRowComponent) Type ¶
func (ActionRowComponent) Type() ComponentType
func (*ActionRowComponent) UnmarshalJSON ¶
func (c *ActionRowComponent) UnmarshalJSON(data []byte) error
func (ActionRowComponent) UpdateComponent ¶
func (c ActionRowComponent) UpdateComponent(id int, component InteractiveComponent) ActionRowComponent
UpdateComponent returns a new ActionRowComponent with the Component which has the id replaced with the provided Component.
func (ActionRowComponent) WithComponents ¶ added in v0.19.0
func (c ActionRowComponent) WithComponents(components ...InteractiveComponent) ActionRowComponent
WithComponents returns a new ActionRowComponent with the provided Component(s)
func (ActionRowComponent) WithID ¶ added in v0.19.0
func (c ActionRowComponent) WithID(id int) ActionRowComponent
WithID returns a new ActionRowComponent with the provided id
type Activity ¶
type Activity struct {
ID string `json:"id"`
Name string `json:"name"`
Type ActivityType `json:"type"`
URL *string `json:"url,omitempty"`
CreatedAt time.Time `json:"created_at"`
Timestamps *ActivityTimestamps `json:"timestamps,omitempty"`
SyncID *string `json:"sync_id,omitempty"`
// ApplicationID is usually a snowflake.ID but for some fucking reason Discord sometimes sends it unquoted as an integer, fuck you Discord.
ApplicationID json.Number `json:"application_id,omitempty"`
StatusDisplayType *ActivityStatusDisplayType `json:"status_display_type,omitempty"`
Details *string `json:"details,omitempty"`
DetailsURL *string `json:"details_url,omitempty"`
State *string `json:"state,omitempty"`
StateURL *string `json:"state_url,omitempty"`
Emoji *PartialEmoji `json:"emoji,omitempty"`
Party *ActivityParty `json:"party,omitempty"`
Assets *ActivityAssets `json:"assets,omitempty"`
Secrets *ActivitySecrets `json:"secrets,omitempty"`
Instance *bool `json:"instance,omitempty"`
Flags ActivityFlags `json:"flags,omitempty"`
Buttons []string `json:"buttons,omitempty"`
}
Activity represents the fields of a user's presence
func (Activity) MarshalJSON ¶ added in v0.13.17
func (*Activity) UnmarshalJSON ¶ added in v0.13.17
type ActivityAssets ¶
type ActivityAssets struct {
LargeImage string `json:"large_image,omitempty"`
LargeText string `json:"large_text,omitempty"`
LargeURL string `json:"large_url,omitempty"`
SmallImage string `json:"small_image,omitempty"`
SmallText string `json:"small_text,omitempty"`
SmallURL string `json:"small_url,omitempty"`
}
ActivityAssets are the images for the presence and hover texts
type ActivityButton ¶
ActivityButton is a button in an activity
type ActivityFlags ¶ added in v0.12.0
type ActivityFlags int
ActivityFlags add additional information to an activity
const ( ActivityFlagInstance ActivityFlags = 1 << iota ActivityFlagJoin ActivityFlagSpectate ActivityFlagJoinRequest ActivityFlagSync ActivityFlagPlay ActivityFlagPartyPrivacyFriends ActivityFlagPartyPrivacyVoiceChannel ActivityFlagEmbedded )
Discord's supported ActivityFlags
func (ActivityFlags) Add ¶ added in v0.13.21
func (f ActivityFlags) Add(bits ...ActivityFlags) ActivityFlags
Add allows you to add multiple bits together, producing a new bit
func (ActivityFlags) Has ¶ added in v0.13.21
func (f ActivityFlags) Has(bits ...ActivityFlags) bool
Has will ensure that the bit includes all the bits entered
func (ActivityFlags) Missing ¶ added in v0.13.21
func (f ActivityFlags) Missing(bits ...ActivityFlags) bool
Missing will check whether the bit is missing any one of the bits
func (ActivityFlags) Remove ¶ added in v0.13.21
func (f ActivityFlags) Remove(bits ...ActivityFlags) ActivityFlags
Remove allows you to subtract multiple bits from the first, producing a new bit
type ActivityInstance ¶ added in v0.18.11
type ActivityLocation ¶ added in v0.18.11
type ActivityLocationKind ¶ added in v0.18.11
type ActivityLocationKind string
const ( ActivityLocationKindGC ActivityLocationKind = "gc" ActivityLocationKindPC ActivityLocationKind = "pc" )
type ActivityParty ¶
ActivityParty is information about the party of the player
type ActivitySecrets ¶
type ActivitySecrets struct {
Join string `json:"join,omitempty"`
Spectate string `json:"spectate,omitempty"`
Match string `json:"match,omitempty"`
}
ActivitySecrets contain secrets for Rich Presence joining and spectating
type ActivityStatusDisplayType ¶ added in v0.19.0
type ActivityStatusDisplayType int
const ( ActivityStatusDisplayTypeName ActivityStatusDisplayType = iota ActivityStatusDisplayTypeState ActivityStatusDisplayTypeDetails )
type ActivityTimestamps ¶
ActivityTimestamps represents when a user started and ended their activity
func (ActivityTimestamps) MarshalJSON ¶ added in v0.13.17
func (a ActivityTimestamps) MarshalJSON() ([]byte, error)
func (*ActivityTimestamps) UnmarshalJSON ¶ added in v0.13.17
func (a *ActivityTimestamps) UnmarshalJSON(data []byte) error
type ActivityType ¶
type ActivityType int
ActivityType represents the status of a user, one of Game, Streaming, Listening, Watching, Custom or Competing
const ( ActivityTypeGame ActivityType = iota ActivityTypeStreaming ActivityTypeListening ActivityTypeWatching ActivityTypeCustom ActivityTypeCompeting )
Constants for Activity(s)
type AddBan ¶
type AddBan struct {
DeleteMessageSeconds int `json:"delete_message_seconds,omitempty"`
}
AddBan is used to ban a User (https://discord.com/developers/docs/resources/guild#create-guild-ban-json-params)
type AllowedMentionType ¶
type AllowedMentionType string
AllowedMentionType ?
const ( AllowedMentionTypeRoles AllowedMentionType = "roles" AllowedMentionTypeUsers AllowedMentionType = "users" AllowedMentionTypeEveryone AllowedMentionType = "everyone" )
All AllowedMentionType(s)
type AllowedMentions ¶
type AllowedMentions struct {
Parse []AllowedMentionType `json:"parse"`
Roles []snowflake.ID `json:"roles"`
Users []snowflake.ID `json:"users"`
RepliedUser bool `json:"replied_user"`
}
AllowedMentions are used for avoiding mentioning users in Message and Interaction
type Application ¶
type Application struct {
ID snowflake.ID `json:"id"`
Name string `json:"name"`
Icon *string `json:"icon,omitempty"`
Description string `json:"description"`
RPCOrigins []string `json:"rpc_origins"`
BotPublic bool `json:"bot_public"`
BotRequireCodeGrant bool `json:"bot_require_code_grant"`
Bot *User `json:"bot,omitempty"`
TermsOfServiceURL *string `json:"terms_of_service_url,omitempty"`
PrivacyPolicyURL *string `json:"privacy_policy_url,omitempty"`
CustomInstallURL *string `json:"custom_install_url,omitempty"`
InteractionsEndpointURL *string `json:"interactions_endpoint_url,omitempty"`
RoleConnectionsVerificationURL *string `json:"role_connections_verification_url"`
InstallParams *InstallParams `json:"install_params"`
Tags []string `json:"tags"`
Owner *User `json:"owner,omitempty"`
VerifyKey string `json:"verify_key"`
Team *Team `json:"team,omitempty"`
GuildID *snowflake.ID `json:"guild_id,omitempty"`
Guild *Guild `json:"guild,omitempty"`
PrimarySkuID *snowflake.ID `json:"primary_sku_id,omitempty"`
Slug *string `json:"slug,omitempty"`
CoverImage *string `json:"cover_image,omitempty"`
Flags ApplicationFlags `json:"flags,omitempty"`
ApproximateGuildCount *int `json:"approximate_guild_count,omitempty"`
ApproximateUserInstallCount *int `json:"approximate_user_install_count,omitempty"`
ApproximateUserAuthorizationCount *int `json:"approximate_user_authorization_count,omitempty"`
IntegrationTypesConfig ApplicationIntegrationTypesConfig `json:"integration_types_config"`
}
func (Application) CoverImageURL ¶ added in v0.14.1
func (a Application) CoverImageURL(opts ...CDNOpt) *string
func (Application) CreatedAt ¶ added in v0.13.17
func (a Application) CreatedAt() time.Time
func (Application) IconURL ¶
func (a Application) IconURL(opts ...CDNOpt) *string
type ApplicationCommand ¶
type ApplicationCommand interface {
json.Marshaler
ID() snowflake.ID
Type() ApplicationCommandType
ApplicationID() snowflake.ID
GuildID() *snowflake.ID
Name() string
NameLocalizations() map[Locale]string
NameLocalized() string
DefaultMemberPermissions() Permissions
DMPermission() bool
Version() snowflake.ID
CreatedAt() time.Time
NSFW() bool
IntegrationTypes() []ApplicationIntegrationType
Contexts() []InteractionContextType
// contains filtered or unexported methods
}
type ApplicationCommandCreate ¶
type ApplicationCommandCreate interface {
json.Marshaler
Type() ApplicationCommandType
CommandName() string
// contains filtered or unexported methods
}
type ApplicationCommandInteraction ¶
type ApplicationCommandInteraction struct {
Data ApplicationCommandInteractionData `json:"data"`
// contains filtered or unexported fields
}
func (ApplicationCommandInteraction) AppPermissions ¶ added in v0.15.1
func (i ApplicationCommandInteraction) AppPermissions() *Permissions
func (ApplicationCommandInteraction) ApplicationID ¶ added in v0.15.1
func (ApplicationCommandInteraction) AttachmentSizeLimit ¶ added in v0.18.16
func (i ApplicationCommandInteraction) AttachmentSizeLimit() int
func (ApplicationCommandInteraction) AuthorizingIntegrationOwners ¶ added in v0.18.0
func (i ApplicationCommandInteraction) AuthorizingIntegrationOwners() map[ApplicationIntegrationType]snowflake.ID
func (ApplicationCommandInteraction) Channel ¶ added in v0.16.1
func (i ApplicationCommandInteraction) Channel() InteractionChannel
func (ApplicationCommandInteraction) Context ¶ added in v0.18.0
func (i ApplicationCommandInteraction) Context() InteractionContextType
func (ApplicationCommandInteraction) Entitlements ¶ added in v0.16.11
func (i ApplicationCommandInteraction) Entitlements() []Entitlement
func (ApplicationCommandInteraction) EntryPointCommandInteractionData ¶ added in v0.18.11
func (i ApplicationCommandInteraction) EntryPointCommandInteractionData() EntryPointCommandInteractionData
func (ApplicationCommandInteraction) GuildLocale ¶ added in v0.15.1
func (i ApplicationCommandInteraction) GuildLocale() *Locale
func (ApplicationCommandInteraction) Locale ¶ added in v0.15.1
func (i ApplicationCommandInteraction) Locale() Locale
func (ApplicationCommandInteraction) MarshalJSON ¶ added in v0.15.1
func (i ApplicationCommandInteraction) MarshalJSON() ([]byte, error)
func (ApplicationCommandInteraction) Member ¶ added in v0.15.1
func (i ApplicationCommandInteraction) Member() *ResolvedMember
func (ApplicationCommandInteraction) MessageCommandInteractionData ¶
func (i ApplicationCommandInteraction) MessageCommandInteractionData() MessageCommandInteractionData
func (ApplicationCommandInteraction) PartialGuild ¶ added in v0.18.6
func (i ApplicationCommandInteraction) PartialGuild() *InteractionGuild
func (ApplicationCommandInteraction) SlashCommandInteractionData ¶
func (i ApplicationCommandInteraction) SlashCommandInteractionData() SlashCommandInteractionData
func (ApplicationCommandInteraction) Token ¶ added in v0.15.1
func (i ApplicationCommandInteraction) Token() string
func (ApplicationCommandInteraction) Type ¶
func (ApplicationCommandInteraction) Type() InteractionType
func (*ApplicationCommandInteraction) UnmarshalJSON ¶
func (i *ApplicationCommandInteraction) UnmarshalJSON(data []byte) error
func (ApplicationCommandInteraction) User ¶ added in v0.15.1
func (i ApplicationCommandInteraction) User() User
func (ApplicationCommandInteraction) UserCommandInteractionData ¶
func (i ApplicationCommandInteraction) UserCommandInteractionData() UserCommandInteractionData
type ApplicationCommandOption ¶
type ApplicationCommandOption interface {
json.Marshaler
Type() ApplicationCommandOptionType
OptionName() string
OptionDescription() string
// contains filtered or unexported methods
}
type ApplicationCommandOptionAttachment ¶
type ApplicationCommandOptionAttachment struct {
Name string `json:"name"`
NameLocalizations map[Locale]string `json:"name_localizations,omitempty"`
Description string `json:"description"`
DescriptionLocalizations map[Locale]string `json:"description_localizations,omitempty"`
Required bool `json:"required,omitempty"`
}
func (ApplicationCommandOptionAttachment) MarshalJSON ¶
func (o ApplicationCommandOptionAttachment) MarshalJSON() ([]byte, error)
func (ApplicationCommandOptionAttachment) OptionDescription ¶ added in v0.13.17
func (o ApplicationCommandOptionAttachment) OptionDescription() string
func (ApplicationCommandOptionAttachment) OptionName ¶ added in v0.13.0
func (o ApplicationCommandOptionAttachment) OptionName() string
type ApplicationCommandOptionBool ¶
type ApplicationCommandOptionBool struct {
Name string `json:"name"`
NameLocalizations map[Locale]string `json:"name_localizations,omitempty"`
Description string `json:"description"`
DescriptionLocalizations map[Locale]string `json:"description_localizations,omitempty"`
Required bool `json:"required,omitempty"`
}
func (ApplicationCommandOptionBool) MarshalJSON ¶
func (o ApplicationCommandOptionBool) MarshalJSON() ([]byte, error)
func (ApplicationCommandOptionBool) OptionDescription ¶ added in v0.13.17
func (o ApplicationCommandOptionBool) OptionDescription() string
func (ApplicationCommandOptionBool) OptionName ¶ added in v0.13.0
func (o ApplicationCommandOptionBool) OptionName() string
func (ApplicationCommandOptionBool) Type ¶
func (ApplicationCommandOptionBool) Type() ApplicationCommandOptionType
type ApplicationCommandOptionChannel ¶
type ApplicationCommandOptionChannel struct {
Name string `json:"name"`
NameLocalizations map[Locale]string `json:"name_localizations,omitempty"`
Description string `json:"description"`
DescriptionLocalizations map[Locale]string `json:"description_localizations,omitempty"`
Required bool `json:"required,omitempty"`
ChannelTypes []ChannelType `json:"channel_types,omitempty"`
}
func (ApplicationCommandOptionChannel) MarshalJSON ¶
func (o ApplicationCommandOptionChannel) MarshalJSON() ([]byte, error)
func (ApplicationCommandOptionChannel) OptionDescription ¶ added in v0.13.17
func (o ApplicationCommandOptionChannel) OptionDescription() string
func (ApplicationCommandOptionChannel) OptionName ¶ added in v0.13.0
func (o ApplicationCommandOptionChannel) OptionName() string
func (ApplicationCommandOptionChannel) Type ¶
func (ApplicationCommandOptionChannel) Type() ApplicationCommandOptionType
type ApplicationCommandOptionChoice ¶
type ApplicationCommandOptionChoice interface {
ChoiceName() string
// contains filtered or unexported methods
}
type ApplicationCommandOptionChoiceFloat ¶
type ApplicationCommandOptionChoiceFloat struct {
Name string `json:"name"`
NameLocalizations map[Locale]string `json:"name_localizations,omitempty"`
Value float64 `json:"value"`
}
func (ApplicationCommandOptionChoiceFloat) ChoiceName ¶ added in v0.17.2
func (c ApplicationCommandOptionChoiceFloat) ChoiceName() string
type ApplicationCommandOptionChoiceInt ¶
type ApplicationCommandOptionChoiceInt struct {
Name string `json:"name"`
NameLocalizations map[Locale]string `json:"name_localizations,omitempty"`
Value int `json:"value"`
}
func (ApplicationCommandOptionChoiceInt) ChoiceName ¶ added in v0.17.2
func (c ApplicationCommandOptionChoiceInt) ChoiceName() string
type ApplicationCommandOptionChoiceString ¶
type ApplicationCommandOptionChoiceString struct {
Name string `json:"name"`
NameLocalizations map[Locale]string `json:"name_localizations,omitempty"`
Value string `json:"value"`
}
func (ApplicationCommandOptionChoiceString) ChoiceName ¶ added in v0.17.2
func (c ApplicationCommandOptionChoiceString) ChoiceName() string
type ApplicationCommandOptionFloat ¶
type ApplicationCommandOptionFloat struct {
Name string `json:"name"`
NameLocalizations map[Locale]string `json:"name_localizations,omitempty"`
Description string `json:"description"`
DescriptionLocalizations map[Locale]string `json:"description_localizations,omitempty"`
Required bool `json:"required,omitempty"`
Choices []ApplicationCommandOptionChoiceFloat `json:"choices,omitempty"`
Autocomplete bool `json:"autocomplete,omitempty"`
MinValue *float64 `json:"min_value,omitempty"`
MaxValue *float64 `json:"max_value,omitempty"`
}
func (ApplicationCommandOptionFloat) MarshalJSON ¶
func (o ApplicationCommandOptionFloat) MarshalJSON() ([]byte, error)
func (ApplicationCommandOptionFloat) OptionDescription ¶ added in v0.13.17
func (o ApplicationCommandOptionFloat) OptionDescription() string
func (ApplicationCommandOptionFloat) OptionName ¶ added in v0.13.0
func (o ApplicationCommandOptionFloat) OptionName() string
func (ApplicationCommandOptionFloat) Type ¶
func (ApplicationCommandOptionFloat) Type() ApplicationCommandOptionType
type ApplicationCommandOptionInt ¶
type ApplicationCommandOptionInt struct {
Name string `json:"name"`
NameLocalizations map[Locale]string `json:"name_localizations,omitempty"`
Description string `json:"description"`
DescriptionLocalizations map[Locale]string `json:"description_localizations,omitempty"`
Required bool `json:"required,omitempty"`
Choices []ApplicationCommandOptionChoiceInt `json:"choices,omitempty"`
Autocomplete bool `json:"autocomplete,omitempty"`
MinValue *int `json:"min_value,omitempty"`
MaxValue *int `json:"max_value,omitempty"`
}
func (ApplicationCommandOptionInt) MarshalJSON ¶
func (o ApplicationCommandOptionInt) MarshalJSON() ([]byte, error)
func (ApplicationCommandOptionInt) OptionDescription ¶ added in v0.13.17
func (o ApplicationCommandOptionInt) OptionDescription() string
func (ApplicationCommandOptionInt) OptionName ¶ added in v0.13.0
func (o ApplicationCommandOptionInt) OptionName() string
func (ApplicationCommandOptionInt) Type ¶
func (ApplicationCommandOptionInt) Type() ApplicationCommandOptionType
type ApplicationCommandOptionMentionable ¶
type ApplicationCommandOptionMentionable struct {
Name string `json:"name"`
NameLocalizations map[Locale]string `json:"name_localizations,omitempty"`
Description string `json:"description"`
DescriptionLocalizations map[Locale]string `json:"description_localizations,omitempty"`
Required bool `json:"required,omitempty"`
}
func (ApplicationCommandOptionMentionable) MarshalJSON ¶
func (o ApplicationCommandOptionMentionable) MarshalJSON() ([]byte, error)
func (ApplicationCommandOptionMentionable) OptionDescription ¶ added in v0.13.17
func (o ApplicationCommandOptionMentionable) OptionDescription() string
func (ApplicationCommandOptionMentionable) OptionName ¶ added in v0.13.0
func (o ApplicationCommandOptionMentionable) OptionName() string
type ApplicationCommandOptionRole ¶
type ApplicationCommandOptionRole struct {
Name string `json:"name"`
NameLocalizations map[Locale]string `json:"name_localizations,omitempty"`
Description string `json:"description"`
DescriptionLocalizations map[Locale]string `json:"description_localizations,omitempty"`
Required bool `json:"required,omitempty"`
}
func (ApplicationCommandOptionRole) MarshalJSON ¶
func (o ApplicationCommandOptionRole) MarshalJSON() ([]byte, error)
func (ApplicationCommandOptionRole) OptionDescription ¶ added in v0.13.17
func (o ApplicationCommandOptionRole) OptionDescription() string
func (ApplicationCommandOptionRole) OptionName ¶ added in v0.13.0
func (o ApplicationCommandOptionRole) OptionName() string
func (ApplicationCommandOptionRole) Type ¶
func (ApplicationCommandOptionRole) Type() ApplicationCommandOptionType
type ApplicationCommandOptionString ¶
type ApplicationCommandOptionString struct {
Name string `json:"name"`
NameLocalizations map[Locale]string `json:"name_localizations,omitempty"`
Description string `json:"description"`
DescriptionLocalizations map[Locale]string `json:"description_localizations,omitempty"`
Required bool `json:"required,omitempty"`
Choices []ApplicationCommandOptionChoiceString `json:"choices,omitempty"`
Autocomplete bool `json:"autocomplete,omitempty"`
MinLength *int `json:"min_length,omitempty"`
MaxLength *int `json:"max_length,omitempty"`
}
func (ApplicationCommandOptionString) MarshalJSON ¶
func (o ApplicationCommandOptionString) MarshalJSON() ([]byte, error)
func (ApplicationCommandOptionString) OptionDescription ¶ added in v0.13.17
func (o ApplicationCommandOptionString) OptionDescription() string
func (ApplicationCommandOptionString) OptionName ¶ added in v0.13.0
func (o ApplicationCommandOptionString) OptionName() string
func (ApplicationCommandOptionString) Type ¶
func (ApplicationCommandOptionString) Type() ApplicationCommandOptionType
type ApplicationCommandOptionSubCommand ¶
type ApplicationCommandOptionSubCommand struct {
Name string `json:"name"`
NameLocalizations map[Locale]string `json:"name_localizations,omitempty"`
Description string `json:"description"`
DescriptionLocalizations map[Locale]string `json:"description_localizations,omitempty"`
Options []ApplicationCommandOption `json:"options,omitempty"`
}
func (ApplicationCommandOptionSubCommand) MarshalJSON ¶
func (o ApplicationCommandOptionSubCommand) MarshalJSON() ([]byte, error)
func (ApplicationCommandOptionSubCommand) OptionDescription ¶ added in v0.13.17
func (o ApplicationCommandOptionSubCommand) OptionDescription() string
func (ApplicationCommandOptionSubCommand) OptionName ¶ added in v0.13.9
func (o ApplicationCommandOptionSubCommand) OptionName() string
func (*ApplicationCommandOptionSubCommand) UnmarshalJSON ¶
func (o *ApplicationCommandOptionSubCommand) UnmarshalJSON(data []byte) error
type ApplicationCommandOptionSubCommandGroup ¶
type ApplicationCommandOptionSubCommandGroup struct {
Name string `json:"name"`
NameLocalizations map[Locale]string `json:"name_localizations,omitempty"`
Description string `json:"description"`
DescriptionLocalizations map[Locale]string `json:"description_localizations,omitempty"`
Options []ApplicationCommandOptionSubCommand `json:"options,omitempty"`
}
func (ApplicationCommandOptionSubCommandGroup) MarshalJSON ¶
func (o ApplicationCommandOptionSubCommandGroup) MarshalJSON() ([]byte, error)
func (ApplicationCommandOptionSubCommandGroup) OptionDescription ¶ added in v0.13.17
func (o ApplicationCommandOptionSubCommandGroup) OptionDescription() string
func (ApplicationCommandOptionSubCommandGroup) OptionName ¶ added in v0.13.9
func (o ApplicationCommandOptionSubCommandGroup) OptionName() string
type ApplicationCommandOptionType ¶
type ApplicationCommandOptionType int
ApplicationCommandOptionType specifies the type of the arguments used in ApplicationCommand.Options
const ( ApplicationCommandOptionTypeSubCommand ApplicationCommandOptionType = iota + 1 ApplicationCommandOptionTypeSubCommandGroup ApplicationCommandOptionTypeString ApplicationCommandOptionTypeInt ApplicationCommandOptionTypeBool ApplicationCommandOptionTypeUser ApplicationCommandOptionTypeChannel ApplicationCommandOptionTypeRole ApplicationCommandOptionTypeMentionable ApplicationCommandOptionTypeFloat ApplicationCommandOptionTypeAttachment )
Constants for each slash command option type
type ApplicationCommandOptionUser ¶
type ApplicationCommandOptionUser struct {
Name string `json:"name"`
NameLocalizations map[Locale]string `json:"name_localizations,omitempty"`
Description string `json:"description"`
DescriptionLocalizations map[Locale]string `json:"description_localizations,omitempty"`
Required bool `json:"required,omitempty"`
}
func (ApplicationCommandOptionUser) MarshalJSON ¶
func (o ApplicationCommandOptionUser) MarshalJSON() ([]byte, error)
func (ApplicationCommandOptionUser) OptionDescription ¶ added in v0.13.17
func (o ApplicationCommandOptionUser) OptionDescription() string
func (ApplicationCommandOptionUser) OptionName ¶ added in v0.13.0
func (o ApplicationCommandOptionUser) OptionName() string
func (ApplicationCommandOptionUser) Type ¶
func (ApplicationCommandOptionUser) Type() ApplicationCommandOptionType
type ApplicationCommandPermission ¶
type ApplicationCommandPermission interface {
json.Marshaler
Type() ApplicationCommandPermissionType
ID() snowflake.ID
// contains filtered or unexported methods
}
ApplicationCommandPermission holds a User or Role and if they are allowed to use the ApplicationCommand
type ApplicationCommandPermissionChannel ¶ added in v0.10.0
type ApplicationCommandPermissionChannel struct {
ChannelID snowflake.ID `json:"id"`
Permission bool `json:"permission"`
}
func (ApplicationCommandPermissionChannel) ID ¶ added in v0.10.0
func (p ApplicationCommandPermissionChannel) ID() snowflake.ID
func (ApplicationCommandPermissionChannel) MarshalJSON ¶ added in v0.10.0
func (p ApplicationCommandPermissionChannel) MarshalJSON() ([]byte, error)
type ApplicationCommandPermissionRole ¶
type ApplicationCommandPermissionRole struct {
RoleID snowflake.ID `json:"id"`
Permission bool `json:"permission"`
}
func (ApplicationCommandPermissionRole) ID ¶
func (p ApplicationCommandPermissionRole) ID() snowflake.ID
func (ApplicationCommandPermissionRole) MarshalJSON ¶
func (p ApplicationCommandPermissionRole) MarshalJSON() ([]byte, error)
type ApplicationCommandPermissionType ¶
type ApplicationCommandPermissionType int
ApplicationCommandPermissionType is the type of the ApplicationCommandPermission
const ( ApplicationCommandPermissionTypeRole ApplicationCommandPermissionType = iota + 1 ApplicationCommandPermissionTypeUser ApplicationCommandPermissionTypeChannel )
types of ApplicationCommandPermissionType
type ApplicationCommandPermissionUser ¶
type ApplicationCommandPermissionUser struct {
UserID snowflake.ID `json:"id"`
Permission bool `json:"permission"`
}
func (ApplicationCommandPermissionUser) ID ¶
func (p ApplicationCommandPermissionUser) ID() snowflake.ID
func (ApplicationCommandPermissionUser) MarshalJSON ¶
func (p ApplicationCommandPermissionUser) MarshalJSON() ([]byte, error)
type ApplicationCommandPermissions ¶
type ApplicationCommandPermissions struct {
ID snowflake.ID `json:"id"`
ApplicationID snowflake.ID `json:"application_id"`
GuildID snowflake.ID `json:"guild_id"`
Permissions []ApplicationCommandPermission `json:"permissions"`
}
ApplicationCommandPermissions holds all permissions for an ApplicationCommand
func (*ApplicationCommandPermissions) UnmarshalJSON ¶
func (p *ApplicationCommandPermissions) UnmarshalJSON(data []byte) error
type ApplicationCommandPermissionsSet ¶
type ApplicationCommandPermissionsSet struct {
ID snowflake.ID `json:"id,omitempty"`
Permissions []ApplicationCommandPermission `json:"permissions"`
}
ApplicationCommandPermissionsSet is used to bulk overwrite all ApplicationCommandPermissions
type ApplicationCommandType ¶
type ApplicationCommandType int
const ( ApplicationCommandTypeSlash ApplicationCommandType = iota + 1 ApplicationCommandTypeUser ApplicationCommandTypeMessage ApplicationCommandTypePrimaryEntryPoint )
type ApplicationCommandUpdate ¶
type ApplicationCommandUpdate interface {
json.Marshaler
Type() ApplicationCommandType
CommandName() *string
// contains filtered or unexported methods
}
type ApplicationFlags ¶
type ApplicationFlags int
ApplicationFlags (https://discord.com/developers/docs/resources/application#application-object-application-flags)
func (ApplicationFlags) Add ¶
func (f ApplicationFlags) Add(bits ...ApplicationFlags) ApplicationFlags
Add allows you to add multiple bits together, producing a new bit
func (ApplicationFlags) Has ¶
func (f ApplicationFlags) Has(bits ...ApplicationFlags) bool
Has will ensure that the bit includes all the bits entered
func (ApplicationFlags) Missing ¶
func (f ApplicationFlags) Missing(bits ...ApplicationFlags) bool
Missing will check whether the bit is missing any one of the bits
func (ApplicationFlags) Remove ¶
func (f ApplicationFlags) Remove(bits ...ApplicationFlags) ApplicationFlags
Remove allows you to subtract multiple bits from the first, producing a new bit
type ApplicationIntegrationType ¶ added in v0.18.0
type ApplicationIntegrationType int
const ( ApplicationIntegrationTypeGuildInstall ApplicationIntegrationType = iota ApplicationIntegrationTypeUserInstall )
type ApplicationIntegrationTypeConfiguration ¶ added in v0.18.0
type ApplicationIntegrationTypeConfiguration struct {
OAuth2InstallParams *InstallParams `json:"oauth2_install_params"`
}
type ApplicationIntegrationTypesConfig ¶ added in v0.18.0
type ApplicationIntegrationTypesConfig map[ApplicationIntegrationType]ApplicationIntegrationTypeConfiguration
type ApplicationRoleConnection ¶ added in v0.14.1
type ApplicationRoleConnectionMetadata ¶ added in v0.14.1
type ApplicationRoleConnectionMetadata struct {
Type ApplicationRoleConnectionMetadataType `json:"type"`
Key string `json:"key"`
Name string `json:"name"`
NameLocalizations map[Locale]string `json:"name_localizations,omitempty"`
Description string `json:"description"`
DescriptionLocalizations map[Locale]string `json:"description_localizations,omitempty"`
}
type ApplicationRoleConnectionMetadataType ¶ added in v0.14.1
type ApplicationRoleConnectionMetadataType int
const ( ApplicationRoleConnectionMetadataTypeIntegerLessThanOrEqual ApplicationRoleConnectionMetadataType = iota + 1 ApplicationRoleConnectionMetadataTypeIntegerGreaterThanOrEqual ApplicationRoleConnectionMetadataTypeIntegerEqual ApplicationRoleConnectionMetadataTypeIntegerNotEqual ApplicationRoleConnectionMetadataTypeDateTimeLessThanOrEqual ApplicationRoleConnectionMetadataTypeDateTimeGreaterThanOrEqual ApplicationRoleConnectionMetadataTypeBooleanEqual ApplicationRoleConnectionMetadataTypeBooleanNotEqual )
type ApplicationRoleConnectionUpdate ¶ added in v0.14.1
type ApplicationUpdate ¶ added in v0.16.11
type ApplicationUpdate struct {
CustomInstallURL *string `json:"custom_install_url,omitempty"`
Description *string `json:"description,omitempty"`
RoleConnectionsVerificationURL *string `json:"role_connections_verification_url,omitempty"`
InstallParams *InstallParams `json:"install_params,omitempty"`
Flags *ApplicationFlags `json:"flags,omitempty"`
Icon omit.Omit[*Icon] `json:"icon,omitzero"`
CoverImage omit.Omit[*Icon] `json:"cover_image,omitzero"`
InteractionsEndpointURL *string `json:"interactions_endpoint_url,omitempty"`
Tags []string `json:"tags,omitempty"`
IntegrationTypesConfig *ApplicationIntegrationTypesConfig `json:"integration_types_config,omitempty"`
}
type ApplicationWebhook ¶
type ApplicationWebhook struct {
ApplicationID snowflake.ID
// contains filtered or unexported fields
}
func (ApplicationWebhook) Avatar ¶
func (w ApplicationWebhook) Avatar() *string
func (ApplicationWebhook) AvatarURL ¶
func (w ApplicationWebhook) AvatarURL(opts ...CDNOpt) *string
func (ApplicationWebhook) CreatedAt ¶ added in v0.13.17
func (w ApplicationWebhook) CreatedAt() time.Time
func (ApplicationWebhook) DefaultAvatarURL ¶
func (w ApplicationWebhook) DefaultAvatarURL(opts ...CDNOpt) string
func (ApplicationWebhook) EffectiveAvatarURL ¶
func (w ApplicationWebhook) EffectiveAvatarURL(opts ...CDNOpt) string
func (ApplicationWebhook) ID ¶
func (w ApplicationWebhook) ID() snowflake.ID
func (ApplicationWebhook) MarshalJSON ¶
func (w ApplicationWebhook) MarshalJSON() ([]byte, error)
func (ApplicationWebhook) Name ¶
func (w ApplicationWebhook) Name() string
func (ApplicationWebhook) Type ¶
func (ApplicationWebhook) Type() WebhookType
func (*ApplicationWebhook) UnmarshalJSON ¶
func (w *ApplicationWebhook) UnmarshalJSON(data []byte) error
type Attachment ¶
type Attachment struct {
ID snowflake.ID `json:"id,omitempty"`
Filename string `json:"filename,omitempty"`
Title *string `json:"title,omitempty"`
Description *string `json:"description,omitempty"`
ContentType *string `json:"content_type,omitempty"`
Size int `json:"size,omitempty"`
URL string `json:"url,omitempty"`
ProxyURL string `json:"proxy_url,omitempty"`
Height *int `json:"height,omitempty"`
Width *int `json:"width,omitempty"`
Ephemeral bool `json:"ephemeral,omitempty"`
DurationSecs *float64 `json:"duration_secs,omitempty"`
Waveform *string `json:"waveform,omitempty"`
Flags AttachmentFlags `json:"flags"`
}
Attachment is used for files sent in a Message
func (Attachment) CreatedAt ¶ added in v0.13.17
func (a Attachment) CreatedAt() time.Time
type AttachmentCreate ¶
type AttachmentFlags ¶ added in v0.16.8
type AttachmentFlags int
const ( AttachmentFlagIsClip AttachmentFlags = 1 << iota AttachmentFlagIsThumbnail AttachmentFlagIsRemix AttachmentFlagsNone AttachmentFlags = 0 )
type AttachmentKeep ¶
type AttachmentUpdate ¶
type AttachmentUpdate interface {
// contains filtered or unexported methods
}
type AuditLog ¶
type AuditLog struct {
ApplicationCommands []ApplicationCommand `json:"application_commands"`
AuditLogEntries []AuditLogEntry `json:"audit_log_entries"`
AutoModerationRules []AutoModerationRule `json:"auto_moderation_rules"`
GuildScheduledEvents []GuildScheduledEvent `json:"guild_scheduled_events"`
Integrations []Integration `json:"integrations"`
Threads []GuildThread `json:"threads"`
Users []User `json:"users"`
Webhooks []Webhook `json:"webhooks"`
}
AuditLog (https://discord.com/developers/docs/resources/audit-log) These are logs of events that occurred, accessible via the Discord
func (*AuditLog) UnmarshalJSON ¶
type AuditLogChange ¶ added in v0.18.10
type AuditLogChange struct {
// NewValue is the new value of the key after the change as a json.RawMessage.
NewValue json.RawMessage `json:"new_value"`
// OldValue is the old value of the key before the change as a json.RawMessage.
OldValue json.RawMessage `json:"old_value"`
// Key is the key of the change.
Key AuditLogChangeKey `json:"key"`
}
AuditLogChange (https://discord.com/developers/docs/resources/audit-log#audit-log-change-object) contains what was changed. For a list of possible keys & values see the discord documentation.
func (*AuditLogChange) UnmarshalNewValue ¶ added in v0.18.10
func (c *AuditLogChange) UnmarshalNewValue(v any) error
UnmarshalNewValue unmarshals the NewValue field into the provided type.
func (*AuditLogChange) UnmarshalOldValue ¶ added in v0.18.10
func (c *AuditLogChange) UnmarshalOldValue(v any) error
UnmarshalOldValue unmarshals the OldValue field into the provided type.
type AuditLogChangeKey ¶
type AuditLogChangeKey string
AuditLogChangeKey is a string representing a key in the audit log change object.
const ( AuditLogChangeKeyAFKChannelID AuditLogChangeKey = "afk_channel_id" AuditLogChangeKeyAFKTimeout AuditLogChangeKey = "afk_timeout" // AuditLogChangeKeyAllow is sent when a role's permission overwrites changed (stringy int) AuditLogChangeKeyAllow AuditLogChangeKey = "allow" AuditLogChangeKeyApplicationID AuditLogChangeKey = "application_id" // AuditLogChangeKeyArchived is sent when a channel thread is archived/unarchived (bool) AuditLogChangeKeyArchived AuditLogChangeKey = "archived" AuditLogChangeKeyAsset AuditLogChangeKey = "asset" // AuditLogChangeKeyAutoArchiveDuration is sent when a thread's auto archive duration is changed (int) AuditLogChangeKeyAutoArchiveDuration AuditLogChangeKey = "auto_archive_duration" AuditLogChangeKeyAvailable AuditLogChangeKey = "available" AuditLogChangeKeyAvatarHash AuditLogChangeKey = "avatar_hash" AuditLogChangeKeyBannerHash AuditLogChangeKey = "banner_hash" AuditLogChangeKeyBitrate AuditLogChangeKey = "bitrate" AuditLogChangeKeyChannelID AuditLogChangeKey = "channel_id" AuditLogChangeKeyCode AuditLogChangeKey = "code" // AuditLogChangeKeyColor is sent when a role's color is changed (int) AuditLogChangeKeyColor AuditLogChangeKey = "color" // AuditLogChangeKeyCommunicationDisabledUntil is sent when a user's communication disabled until datetime is changed (stringy ISO8601 datetime) AuditLogChangeKeyCommunicationDisabledUntil AuditLogChangeKey = "communication_disabled_until" // AuditLogChangeKeyDeaf is sent when a user is set to be server deafened/undeafened (bool) AuditLogChangeKeyDeaf AuditLogChangeKey = "deaf" AuditLogChangeKeyDefaultAutoArchiveDuration AuditLogChangeKey = "default_auto_archive_duration" AuditLogChangeKeyDefaultMessageNotifications AuditLogChangeKey = "default_message_notifications" // AuditLogChangeKeyDeny is sent when a role's permission overwrites changed (stringed int) AuditLogChangeKeyDeny AuditLogChangeKey = "deny" AuditLogChangeKeyDescription AuditLogChangeKey = "description" AuditLogChangeKeyDiscoverySplashHash AuditLogChangeKey = "discovery_splash_hash" AuditLogChangeKeyEnableEmoticons AuditLogChangeKey = "enable_emoticons" AuditLogChangeKeyEntityType AuditLogChangeKey = "entity_type" AuditLogChangeKeyExpireBehavior AuditLogChangeKey = "expire_behavior" AuditLogChangeKeyExpireGracePeriod AuditLogChangeKey = "expire_grace_period" AuditLogChangeKeyExplicitContentFilter AuditLogChangeKey = "explicit_content_filter" AuditLogChangeKeyFormatType AuditLogChangeKey = "format_type" AuditLogChangeKeyGuildID AuditLogChangeKey = "guild_id" // AuditLogChangeKeyHoist is sent when a role is set to be displayed separately from online members (bool) AuditLogChangeKeyHoist AuditLogChangeKey = "hoist" AuditLogChangeKeyIconHash AuditLogChangeKey = "icon_hash" AuditLogChangeKeyID AuditLogChangeKey = "id" AuditLogChangeKeyInvitable AuditLogChangeKey = "invitable" AuditLogChangeKeyInviterID AuditLogChangeKey = "inviter_id" AuditLogChangeKeyLocation AuditLogChangeKey = "location" // AuditLogChangeKeyLocked is sent when a channel thread is locked/unlocked (bool) AuditLogChangeKeyLocked AuditLogChangeKey = "locked" AuditLogChangeKeyMaxAge AuditLogChangeKey = "max_age" AuditLogChangeKeyMaxUses AuditLogChangeKey = "max_uses" // AuditLogChangeKeyMentionable is sent when a role changes its mentionable state (bool) AuditLogChangeKeyMentionable AuditLogChangeKey = "mentionable" AuditLogChangeKeyMFALevel AuditLogChangeKey = "mfa_level" // AuditLogChangeKeyMute is sent when a user is server muted/unmuted (bool) AuditLogChangeKeyMute AuditLogChangeKey = "mute" AuditLogChangeKeyName AuditLogChangeKey = "name" // AuditLogChangeKeyNick is sent when a user's nickname is changed (string) AuditLogChangeKeyNick AuditLogChangeKey = "nick" AuditLogChangeKeyNSFW AuditLogChangeKey = "nsfw" // AuditLogChangeKeyOwnerID is sent when owner id of a guild changed (snowflake.ID) AuditLogChangeKeyOwnerID AuditLogChangeKey = "owner_id" // AuditLogChangeKeyPermissionOverwrites is sent when a role's permission overwrites changed (string) AuditLogChangeKeyPermissionOverwrites AuditLogChangeKey = "permission_overwrites" // AuditLogChangeKeyPermissions is sent when a role's permissions changed (string) AuditLogChangeKeyPermissions AuditLogChangeKey = "permissions" // AuditLogChangeKeyPosition is sent when channel position changed (int) AuditLogChangeKeyPosition AuditLogChangeKey = "position" AuditLogChangeKeyPreferredLocale AuditLogChangeKey = "preferred_locale" AuditLogChangeKeyPrivacyLevel AuditLogChangeKey = "privacy_level" AuditLogChangeKeyPruneDeleteDays AuditLogChangeKey = "prune_delete_days" AuditLogChangeKeyPublicUpdatesChannelID AuditLogChangeKey = "public_updates_channel_id" AuditLogChangeKeyRateLimitPerUser AuditLogChangeKey = "rate_limit_per_user" AuditLogChangeKeyRegion AuditLogChangeKey = "region" AuditLogChangeKeyRulesChannelID AuditLogChangeKey = "rules_channel_id" AuditLogChangeKeySplashHash AuditLogChangeKey = "splash_hash" AuditLogChangeKeyStatus AuditLogChangeKey = "status" // AuditLogChangeKeySystemChannelID is sent when system channel id of a guild changed (snowflake.ID) AuditLogChangeKeySystemChannelID AuditLogChangeKey = "system_channel_id" AuditLogChangeKeyTags AuditLogChangeKey = "tags" AuditLogChangeKeyTemporary AuditLogChangeKey = "temporary" // AuditLogChangeKeyTopic is sent when channel topic changed (string) AuditLogChangeKeyTopic AuditLogChangeKey = "topic" AuditLogChangeKeyType AuditLogChangeKey = "type" AuditLogChangeKeyUnicodeEmoji AuditLogChangeKey = "unicode_emoji" // AuditLogChangeKeyUserLimit is sent when user limit of a voice channel changed (int) AuditLogChangeKeyUserLimit AuditLogChangeKey = "user_limit" AuditLogChangeKeyUses AuditLogChangeKey = "uses" AuditLogChangeKeyVanityURLCode AuditLogChangeKey = "vanity_url_code" // AuditLogChangeKeyVerificationLevel is sent when verification level of the server changed (int) AuditLogChangeKeyVerificationLevel AuditLogChangeKey = "verification_level" AuditLogChangeKeyWidgetChannelID AuditLogChangeKey = "widget_channel_id" // AuditLogChangeKeyWidgetEnabled is sent when a server widget is enabled/disabled (bool) AuditLogChangeKeyWidgetEnabled AuditLogChangeKey = "widget_enabled" // AuditLogChangeKeyRoleAdd is sent when roles are added to a user (array of discord.PartialRole JSON) AuditLogChangeKeyRoleAdd AuditLogChangeKey = "$add" // AuditLogChangeKeyRoleRemove is sent when roles are removed from a user (array of discord.PartialRole JSON) AuditLogChangeKeyRoleRemove AuditLogChangeKey = "$remove" )
type AuditLogEntry ¶
type AuditLogEntry struct {
TargetID *snowflake.ID `json:"target_id"`
Changes []AuditLogChange `json:"changes"`
UserID snowflake.ID `json:"user_id"`
ID snowflake.ID `json:"id"`
ActionType AuditLogEvent `json:"action_type"`
Options *OptionalAuditLogEntryInfo `json:"options"`
Reason *string `json:"reason"`
}
AuditLogEntry (https://discord.com/developers/docs/resources/audit-log#audit-log-entry-object)
type AuditLogEvent ¶
type AuditLogEvent int
AuditLogEvent is an 8-bit unsigned integer representing an audit log event.
const ( AuditLogEventChannelCreate AuditLogEvent = iota + 10 AuditLogEventChannelUpdate AuditLogEventChannelDelete AuditLogEventChannelOverwriteCreate AuditLogEventChannelOverwriteUpdate AuditLogEventChannelOverwriteDelete )
const ( AuditLogEventMemberKick AuditLogEvent = iota + 20 AuditLogEventMemberPrune AuditLogEventMemberBanAdd AuditLogEventMemberBanRemove AuditLogEventMemberUpdate AuditLogEventMemberRoleUpdate AuditLogEventMemberMove AuditLogEventMemberDisconnect AuditLogEventBotAdd )
const ( AuditLogEventRoleCreate AuditLogEvent = iota + 30 AuditLogEventRoleUpdate AuditLogEventRoleDelete )
const ( AuditLogEventInviteCreate AuditLogEvent = iota + 40 AuditLogEventInviteUpdate AuditLogEventInviteDelete )
const ( AuditLogEventWebhookCreate AuditLogEvent = iota + 50 AuditLogEventWebhookUpdate AuditLogEventWebhookDelete )
const ( AuditLogEventEmojiCreate AuditLogEvent = iota + 60 AuditLogEventEmojiUpdate AuditLogEventEmojiDelete )
const ( AuditLogEventMessageDelete AuditLogEvent = iota + 72 AuditLogEventMessageBulkDelete AuditLogEventMessagePin AuditLogEventMessageUnpin )
const ( AuditLogEventIntegrationCreate AuditLogEvent = iota + 80 AuditLogEventIntegrationUpdate AuditLogEventIntegrationDelete AuditLogEventStageInstanceCreate AuditLogEventStageInstanceUpdate AuditLogEventStageInstanceDelete )
const ( AuditLogEventStickerCreate AuditLogEvent = iota + 90 AuditLogEventStickerUpdate AuditLogEventStickerDelete )
const ( AuditLogGuildScheduledEventCreate AuditLogEvent = iota + 100 AuditLogGuildScheduledEventUpdate AuditLogGuildScheduledEventDelete )
const ( AuditLogThreadCreate AuditLogEvent = iota + 110 AuditLogThreadUpdate AuditLogThreadDelete )
const ( AuditLogSoundboardSoundCreate AuditLogEvent = iota + 130 AuditLogSoundboardSoundUpdate AuditLogSoundboardSoundDelete )
const ( AuditLogAutoModerationRuleCreate AuditLogEvent = iota + 140 AuditLogAutoModerationRuleUpdate AuditLogAutoModerationRuleDelete AuditLogAutoModerationBlockMessage AuditLogAutoModerationFlagToChannel AuditLogAutoModerationUserCommunicationDisabled AuditLogAutoModerationQuarantineUser )
const ( AuditLogCreatorMonetizationRequestCreated AuditLogEvent = iota + 150 AuditLogCreatorMonetizationTermsAccepted )
const ( AuditLogOnboardingPromptCreate AuditLogEvent = iota + 163 AuditLogOnboardingPromptUpdate AuditLogOnboardingPromptDelete AuditLogOnboardingCreate AuditLogOnboardingUpdate )
const ( AuditLogHomeSettingsCreate AuditLogEvent = iota + 190 AuditLogHomeSettingsUpdate )
const (
AuditLogApplicationCommandPermissionUpdate AuditLogEvent = 121
)
const (
AuditLogEventGuildUpdate AuditLogEvent = 1
)
type AuthorizationInformation ¶
type AuthorizationInformation struct {
Application Application `json:"application"`
Scopes []OAuth2Scope `json:"scopes"`
Expires time.Time `json:"expires"`
User *User `json:"user"`
}
type AutoArchiveDuration ¶
type AutoArchiveDuration int
const ( AutoArchiveDuration1h AutoArchiveDuration = 60 AutoArchiveDuration24h AutoArchiveDuration = 1440 AutoArchiveDuration3d AutoArchiveDuration = 4320 AutoArchiveDuration1w AutoArchiveDuration = 10080 )
type AutoModerationAction ¶ added in v0.12.7
type AutoModerationAction struct {
Type AutoModerationActionType `json:"type"`
Metadata *AutoModerationActionMetadata `json:"metadata,omitempty"`
}
type AutoModerationActionMetadata ¶ added in v0.12.7
type AutoModerationActionType ¶ added in v0.12.7
type AutoModerationActionType int
const ( AutoModerationActionTypeBlockMessage AutoModerationActionType = iota + 1 AutoModerationActionTypeSendAlertMessage AutoModerationActionTypeTimeout AutoModerationActionTypeBlockMemberInteraction )
type AutoModerationEventType ¶ added in v0.12.7
type AutoModerationEventType int
const ( AutoModerationEventTypeMessageSend AutoModerationEventType = iota + 1 AutoModerationEventTypeMemberUpdate )
type AutoModerationKeywordPreset ¶ added in v0.12.7
type AutoModerationKeywordPreset int
const ( AutoModerationKeywordPresetProfanity AutoModerationKeywordPreset = iota + 1 AutoModerationKeywordPresetSexualContent AutoModerationKeywordPresetSlurs )
type AutoModerationRule ¶ added in v0.12.7
type AutoModerationRule struct {
ID snowflake.ID `json:"id"`
GuildID snowflake.ID `json:"guild_id"`
Name string `json:"name"`
CreatorID snowflake.ID `json:"creator_id"`
EventType AutoModerationEventType `json:"event_type"`
TriggerType AutoModerationTriggerType `json:"trigger_type"`
TriggerMetadata AutoModerationTriggerMetadata `json:"trigger_metadata"`
Actions []AutoModerationAction `json:"actions"`
Enabled bool `json:"enabled"`
ExemptRoles []snowflake.ID `json:"exempt_roles"`
ExemptChannels []snowflake.ID `json:"exempt_channels"`
}
func (AutoModerationRule) CreatedAt ¶ added in v0.13.17
func (r AutoModerationRule) CreatedAt() time.Time
type AutoModerationRuleCreate ¶ added in v0.12.7
type AutoModerationRuleCreate struct {
Name string `json:"name"`
EventType AutoModerationEventType `json:"event_type"`
TriggerType AutoModerationTriggerType `json:"trigger_type"`
TriggerMetadata *AutoModerationTriggerMetadata `json:"trigger_metadata,omitempty"`
Actions []AutoModerationAction `json:"actions"`
Enabled *bool `json:"enabled,omitempty"`
ExemptRoles []snowflake.ID `json:"exempt_roles,omitempty"`
ExemptChannels []snowflake.ID `json:"exempt_channels,omitempty"`
}
type AutoModerationRuleUpdate ¶ added in v0.12.7
type AutoModerationRuleUpdate struct {
Name *string `json:"name,omitempty"`
EventType *AutoModerationEventType `json:"event_type,omitempty"`
TriggerMetadata *AutoModerationTriggerMetadata `json:"trigger_metadata,omitempty"`
Actions *[]AutoModerationAction `json:"actions,omitempty"`
Enabled *bool `json:"enabled,omitempty"`
ExemptRoles *[]snowflake.ID `json:"exempt_roles,omitempty"`
ExemptChannels *[]snowflake.ID `json:"exempt_channels,omitempty"`
}
type AutoModerationTriggerMetadata ¶ added in v0.12.7
type AutoModerationTriggerMetadata struct {
KeywordFilter []string `json:"keyword_filter"`
RegexPatterns []string `json:"regex_patterns"`
Presets []AutoModerationKeywordPreset `json:"presets"`
AllowList []string `json:"allow_list"`
MentionTotalLimit int `json:"mention_total_limit"`
MentionRaidProtectionEnabled bool `json:"mention_raid_protection_enabled"`
}
type AutoModerationTriggerType ¶ added in v0.12.7
type AutoModerationTriggerType int
const ( AutoModerationTriggerTypeKeyword AutoModerationTriggerType = iota + 1 AutoModerationTriggerTypeSpam AutoModerationTriggerTypeKeywordPresent AutoModerationTriggerTypeMentionSpam AutoModerationTriggerTypeMemberProfile )
type AutocompleteChoice ¶
type AutocompleteChoice interface {
ChoiceName() string
// contains filtered or unexported methods
}
type AutocompleteChoiceFloat ¶
type AutocompleteChoiceFloat struct {
Name string `json:"name"`
NameLocalizations map[Locale]string `json:"name_localizations,omitempty"`
Value float64 `json:"value"`
}
func (AutocompleteChoiceFloat) ChoiceName ¶ added in v0.17.2
func (c AutocompleteChoiceFloat) ChoiceName() string
type AutocompleteChoiceInt ¶
type AutocompleteChoiceInt struct {
Name string `json:"name"`
NameLocalizations map[Locale]string `json:"name_localizations,omitempty"`
Value int `json:"value"`
}
func (AutocompleteChoiceInt) ChoiceName ¶ added in v0.17.2
func (c AutocompleteChoiceInt) ChoiceName() string
type AutocompleteChoiceString ¶
type AutocompleteChoiceString struct {
Name string `json:"name"`
NameLocalizations map[Locale]string `json:"name_localizations,omitempty"`
Value string `json:"value"`
}
func (AutocompleteChoiceString) ChoiceName ¶ added in v0.17.2
func (c AutocompleteChoiceString) ChoiceName() string
type AutocompleteInteraction ¶
type AutocompleteInteraction struct {
Data AutocompleteInteractionData `json:"data"`
// contains filtered or unexported fields
}
func (AutocompleteInteraction) AppPermissions ¶ added in v0.15.1
func (i AutocompleteInteraction) AppPermissions() *Permissions
func (AutocompleteInteraction) ApplicationID ¶ added in v0.15.1
func (AutocompleteInteraction) AttachmentSizeLimit ¶ added in v0.18.16
func (i AutocompleteInteraction) AttachmentSizeLimit() int
func (AutocompleteInteraction) AuthorizingIntegrationOwners ¶ added in v0.18.0
func (i AutocompleteInteraction) AuthorizingIntegrationOwners() map[ApplicationIntegrationType]snowflake.ID
func (AutocompleteInteraction) Channel ¶ added in v0.16.1
func (i AutocompleteInteraction) Channel() InteractionChannel
func (AutocompleteInteraction) Context ¶ added in v0.18.0
func (i AutocompleteInteraction) Context() InteractionContextType
func (AutocompleteInteraction) Entitlements ¶ added in v0.16.11
func (i AutocompleteInteraction) Entitlements() []Entitlement
func (AutocompleteInteraction) GuildLocale ¶ added in v0.15.1
func (i AutocompleteInteraction) GuildLocale() *Locale
func (AutocompleteInteraction) Locale ¶ added in v0.15.1
func (i AutocompleteInteraction) Locale() Locale
func (AutocompleteInteraction) MarshalJSON ¶ added in v0.15.1
func (i AutocompleteInteraction) MarshalJSON() ([]byte, error)
func (AutocompleteInteraction) Member ¶ added in v0.15.1
func (i AutocompleteInteraction) Member() *ResolvedMember
func (AutocompleteInteraction) PartialGuild ¶ added in v0.18.6
func (i AutocompleteInteraction) PartialGuild() *InteractionGuild
func (AutocompleteInteraction) Token ¶ added in v0.15.1
func (i AutocompleteInteraction) Token() string
func (AutocompleteInteraction) Type ¶
func (AutocompleteInteraction) Type() InteractionType
func (*AutocompleteInteraction) UnmarshalJSON ¶
func (i *AutocompleteInteraction) UnmarshalJSON(data []byte) error
type AutocompleteInteractionData ¶
type AutocompleteInteractionData struct {
CommandID snowflake.ID
CommandName string
SubCommandName *string
SubCommandGroupName *string
GuildID *snowflake.ID
Options map[string]AutocompleteOption
}
func (AutocompleteInteractionData) All ¶
func (d AutocompleteInteractionData) All() []AutocompleteOption
func (AutocompleteInteractionData) Bool ¶
func (d AutocompleteInteractionData) Bool(name string) bool
func (AutocompleteInteractionData) CommandPath ¶ added in v0.15.0
func (d AutocompleteInteractionData) CommandPath() string
func (AutocompleteInteractionData) Find ¶
func (d AutocompleteInteractionData) Find(optionFindFunc func(option AutocompleteOption) bool) (AutocompleteOption, bool)
func (AutocompleteInteractionData) FindAll ¶
func (d AutocompleteInteractionData) FindAll(optionFindFunc func(option AutocompleteOption) bool) []AutocompleteOption
func (AutocompleteInteractionData) Float ¶
func (d AutocompleteInteractionData) Float(name string) float64
func (AutocompleteInteractionData) Focused ¶ added in v0.17.2
func (d AutocompleteInteractionData) Focused() AutocompleteOption
func (AutocompleteInteractionData) GetByType ¶
func (d AutocompleteInteractionData) GetByType(optionType ApplicationCommandOptionType) []AutocompleteOption
func (AutocompleteInteractionData) Int ¶
func (d AutocompleteInteractionData) Int(name string) int
func (AutocompleteInteractionData) MarshalJSON ¶
func (d AutocompleteInteractionData) MarshalJSON() ([]byte, error)
func (AutocompleteInteractionData) OptBool ¶
func (d AutocompleteInteractionData) OptBool(name string) (bool, bool)
func (AutocompleteInteractionData) OptFloat ¶
func (d AutocompleteInteractionData) OptFloat(name string) (float64, bool)
func (AutocompleteInteractionData) OptInt ¶
func (d AutocompleteInteractionData) OptInt(name string) (int, bool)
func (AutocompleteInteractionData) OptSnowflake ¶
func (d AutocompleteInteractionData) OptSnowflake(name string) (snowflake.ID, bool)
func (AutocompleteInteractionData) OptString ¶
func (d AutocompleteInteractionData) OptString(name string) (string, bool)
func (AutocompleteInteractionData) Option ¶
func (d AutocompleteInteractionData) Option(name string) (AutocompleteOption, bool)
func (AutocompleteInteractionData) Snowflake ¶
func (d AutocompleteInteractionData) Snowflake(name string) snowflake.ID
func (AutocompleteInteractionData) String ¶
func (d AutocompleteInteractionData) String(name string) string
func (*AutocompleteInteractionData) UnmarshalJSON ¶
func (d *AutocompleteInteractionData) UnmarshalJSON(data []byte) error
type AutocompleteOption ¶
type AutocompleteOption struct {
Name string `json:"name"`
Type ApplicationCommandOptionType `json:"type"`
Value json.RawMessage `json:"value"`
Focused bool `json:"focused"`
}
func (AutocompleteOption) Bool ¶ added in v0.19.0
func (o AutocompleteOption) Bool() bool
Bool returns the bool value of the option. If the type is not ApplicationCommandOptionTypeBool, it panics.
func (AutocompleteOption) Float ¶ added in v0.19.0
func (o AutocompleteOption) Float() float64
Float returns the float value of the option. If the type is not ApplicationCommandOptionTypeFloat, it panics.
func (AutocompleteOption) Int ¶ added in v0.19.0
func (o AutocompleteOption) Int() int
Int returns the int value of the option. If the type is not ApplicationCommandOptionTypeInt, it panics.
func (AutocompleteOption) Snowflake ¶ added in v0.19.0
func (o AutocompleteOption) Snowflake() snowflake.ID
Snowflake returns the snowflake value of the option. If the type is not ApplicationCommandOptionTypeUser, ApplicationCommandOptionTypeChannel, ApplicationCommandOptionTypeRole or ApplicationCommandOptionTypeMentionable, it panics.
func (AutocompleteOption) String ¶ added in v0.19.0
func (o AutocompleteOption) String() string
String returns the string value of the option. If the type is not ApplicationCommandOptionTypeString, it panics.
type AutocompleteOptionSubCommand ¶
type AutocompleteOptionSubCommand struct {
Name string `json:"name"`
Description string `json:"description"`
Type ApplicationCommandOptionType `json:"type"`
Options []AutocompleteOption `json:"options,omitempty"`
}
type AutocompleteOptionSubCommandGroup ¶
type AutocompleteOptionSubCommandGroup struct {
Name string `json:"name"`
Description string `json:"description"`
Type ApplicationCommandOptionType `json:"type"`
Options []AutocompleteOptionSubCommand `json:"options,omitempty"`
}
type AutocompleteResult ¶
type AutocompleteResult struct {
Choices []AutocompleteChoice `json:"choices"`
}
type AvatarDecorationData ¶ added in v0.18.0
type Ban ¶
Ban represents a banned User from a Guild (https://discord.com/developers/docs/resources/guild#ban-object)
type BotIntegration ¶
type BotIntegration struct {
IntegrationID snowflake.ID `json:"id"`
Name string `json:"name"`
Enabled bool `json:"enabled"`
Account IntegrationAccount `json:"account"`
Application IntegrationApplication `json:"application"`
Scopes []OAuth2Scope `json:"scopes"`
}
func (BotIntegration) CreatedAt ¶ added in v0.13.17
func (i BotIntegration) CreatedAt() time.Time
func (BotIntegration) ID ¶
func (i BotIntegration) ID() snowflake.ID
func (BotIntegration) MarshalJSON ¶
func (i BotIntegration) MarshalJSON() ([]byte, error)
func (BotIntegration) Type ¶
func (BotIntegration) Type() IntegrationType
type BulkBan ¶ added in v0.18.0
type BulkBan struct {
UserIDs []snowflake.ID `json:"user_ids"`
DeleteMessageSeconds int `json:"delete_message_seconds,omitempty"`
}
BulkBan is used to bulk ban Users
type BulkBanResult ¶ added in v0.18.0
type BulkBanResult struct {
BannedUsers []snowflake.ID `json:"banned_users"`
FailedUsers []snowflake.ID `json:"failed_users"`
}
BulkBanResult is the result of a BulkBan request
type ButtonComponent ¶
type ButtonComponent struct {
ID int `json:"id,omitempty"`
Style ButtonStyle `json:"style"`
Label string `json:"label,omitempty"`
Emoji *ComponentEmoji `json:"emoji,omitempty"`
CustomID string `json:"custom_id,omitempty"`
SkuID snowflake.ID `json:"sku_id,omitempty"`
URL string `json:"url,omitempty"`
Disabled bool `json:"disabled,omitempty"`
}
func NewButton ¶
func NewButton(style ButtonStyle, label string, customID string, url string, skuID snowflake.ID) ButtonComponent
NewButton creates a new ButtonComponent with the provided parameters. Link ButtonComponent(s) need a URL and other ButtonComponent(s) need a customID
func NewDangerButton ¶
func NewDangerButton(label string, customID string) ButtonComponent
NewDangerButton creates a new ButtonComponent with ButtonStyleDanger & the provided parameters
func NewLinkButton ¶
func NewLinkButton(label string, url string) ButtonComponent
NewLinkButton creates a new link ButtonComponent with ButtonStyleLink & the provided parameters
func NewPremiumButton ¶ added in v0.18.8
func NewPremiumButton(skuID snowflake.ID) ButtonComponent
NewPremiumButton creates a new ButtonComponent with ButtonStylePremium & the provided parameters
func NewPrimaryButton ¶
func NewPrimaryButton(label string, customID string) ButtonComponent
NewPrimaryButton creates a new ButtonComponent with ButtonStylePrimary & the provided parameters
func NewSecondaryButton ¶
func NewSecondaryButton(label string, customID string) ButtonComponent
NewSecondaryButton creates a new ButtonComponent with ButtonStyleSecondary & the provided parameters
func NewSuccessButton ¶
func NewSuccessButton(label string, customID string) ButtonComponent
NewSuccessButton creates a new ButtonComponent with ButtonStyleSuccess & the provided parameters
func (ButtonComponent) AsDisabled ¶
func (c ButtonComponent) AsDisabled() ButtonComponent
AsDisabled returns a new ButtonComponent but disabled
func (ButtonComponent) AsEnabled ¶
func (c ButtonComponent) AsEnabled() ButtonComponent
AsEnabled returns a new ButtonComponent but enabled
func (ButtonComponent) GetCustomID ¶ added in v0.19.0
func (c ButtonComponent) GetCustomID() string
func (ButtonComponent) GetID ¶ added in v0.19.0
func (c ButtonComponent) GetID() int
func (ButtonComponent) MarshalJSON ¶
func (c ButtonComponent) MarshalJSON() ([]byte, error)
func (ButtonComponent) Type ¶
func (ButtonComponent) Type() ComponentType
func (ButtonComponent) WithCustomID ¶
func (c ButtonComponent) WithCustomID(customID string) ButtonComponent
WithCustomID returns a new ButtonComponent with the provided custom id
func (ButtonComponent) WithDisabled ¶
func (c ButtonComponent) WithDisabled(disabled bool) ButtonComponent
WithDisabled returns a new ButtonComponent but disabled/enabled
func (ButtonComponent) WithEmoji ¶
func (c ButtonComponent) WithEmoji(emoji ComponentEmoji) ButtonComponent
WithEmoji returns a new ButtonComponent with the provided Emoji
func (ButtonComponent) WithID ¶ added in v0.19.0
func (c ButtonComponent) WithID(id int) ButtonComponent
WithID returns a new ButtonComponent with the provided id
func (ButtonComponent) WithLabel ¶
func (c ButtonComponent) WithLabel(label string) ButtonComponent
WithLabel returns a new ButtonComponent with the provided label
func (ButtonComponent) WithSkuID ¶ added in v0.18.8
func (c ButtonComponent) WithSkuID(skuID snowflake.ID) ButtonComponent
WithSkuID returns a new ButtonComponent with the provided skuID
func (ButtonComponent) WithStyle ¶
func (c ButtonComponent) WithStyle(style ButtonStyle) ButtonComponent
WithStyle returns a new ButtonComponent with the provided style
func (ButtonComponent) WithURL ¶
func (c ButtonComponent) WithURL(url string) ButtonComponent
WithURL returns a new ButtonComponent with the provided URL
type ButtonInteractionData ¶
type ButtonInteractionData struct {
// contains filtered or unexported fields
}
func (ButtonInteractionData) CustomID ¶
func (d ButtonInteractionData) CustomID() string
func (*ButtonInteractionData) MarshalJSON ¶
func (d *ButtonInteractionData) MarshalJSON() ([]byte, error)
func (ButtonInteractionData) Type ¶
func (ButtonInteractionData) Type() ComponentType
func (*ButtonInteractionData) UnmarshalJSON ¶
func (d *ButtonInteractionData) UnmarshalJSON(data []byte) error
type ButtonStyle ¶
type ButtonStyle int
ButtonStyle defines how the ButtonComponent looks like. Discord Docs
const ( ButtonStylePrimary ButtonStyle = iota + 1 ButtonStyleSecondary ButtonStyleSuccess ButtonStyleDanger ButtonStyleLink ButtonStylePremium )
Supported ButtonStyle(s)
type CDNConfig ¶
type CDNConfig struct {
Format FileFormat
Values QueryValues
}
func DefaultCDNConfig ¶
func DefaultCDNConfig(format FileFormat) *CDNConfig
type CDNEndpoint ¶ added in v0.13.11
type CDNEndpoint struct {
Route string
Formats []FileFormat
}
func NewCDN ¶ added in v0.13.11
func NewCDN(route string, fileFormats ...FileFormat) *CDNEndpoint
func (CDNEndpoint) URL ¶ added in v0.13.11
func (e CDNEndpoint) URL(format FileFormat, values QueryValues, params ...any) string
type CDNOpt ¶
type CDNOpt func(config *CDNConfig)
func WithFormat ¶
func WithFormat(format FileFormat) CDNOpt
type Channel ¶
type Channel interface {
json.Marshaler
fmt.Stringer
// Type returns the ChannelType of the Channel.
Type() ChannelType
// ID returns the Snowflake ID of the Channel.
ID() snowflake.ID
// Name returns the name of the Channel.
Name() string
// CreatedAt returns the creation time of the Channel.
CreatedAt() time.Time
// contains filtered or unexported methods
}
type ChannelCreate ¶
type ChannelCreate interface {
json.Marshaler
Type() ChannelType
// contains filtered or unexported methods
}
type ChannelFlags ¶ added in v0.13.12
type ChannelFlags int
const ( ChannelFlagPinned ChannelFlags = 1 << (iota + 1) ChannelFlagRequireTag ChannelFlagHideMediaDownloadOptions ChannelFlags = 1 << 15 ChannelFlagsNone ChannelFlags = 0 )
func (ChannelFlags) Add ¶ added in v0.13.12
func (f ChannelFlags) Add(bits ...ChannelFlags) ChannelFlags
Add allows you to add multiple bits together, producing a new bit
func (ChannelFlags) Has ¶ added in v0.13.12
func (f ChannelFlags) Has(bits ...ChannelFlags) bool
Has will ensure that the bit includes all the bits entered
func (ChannelFlags) Missing ¶ added in v0.13.12
func (f ChannelFlags) Missing(bits ...ChannelFlags) bool
Missing will check whether the bit is missing any one of the bits
func (ChannelFlags) Remove ¶ added in v0.13.12
func (f ChannelFlags) Remove(bits ...ChannelFlags) ChannelFlags
Remove allows you to subtract multiple bits from the first, producing a new bit
type ChannelFollowerWebhook ¶
type ChannelFollowerWebhook struct {
ChannelID snowflake.ID `json:"channel_id"`
GuildID snowflake.ID `json:"guild_id"`
SourceGuild WebhookSourceGuild `json:"source_guild"`
SourceChannel WebhookSourceChannel `json:"source_channel"`
User User `json:"user"`
// contains filtered or unexported fields
}
func (ChannelFollowerWebhook) Avatar ¶
func (w ChannelFollowerWebhook) Avatar() *string
func (ChannelFollowerWebhook) AvatarURL ¶
func (w ChannelFollowerWebhook) AvatarURL(opts ...CDNOpt) *string
func (ChannelFollowerWebhook) CreatedAt ¶ added in v0.13.17
func (w ChannelFollowerWebhook) CreatedAt() time.Time
func (ChannelFollowerWebhook) DefaultAvatarURL ¶
func (w ChannelFollowerWebhook) DefaultAvatarURL(opts ...CDNOpt) string
func (ChannelFollowerWebhook) EffectiveAvatarURL ¶
func (w ChannelFollowerWebhook) EffectiveAvatarURL(opts ...CDNOpt) string
func (ChannelFollowerWebhook) ID ¶
func (w ChannelFollowerWebhook) ID() snowflake.ID
func (ChannelFollowerWebhook) MarshalJSON ¶
func (w ChannelFollowerWebhook) MarshalJSON() ([]byte, error)
func (ChannelFollowerWebhook) Name ¶
func (w ChannelFollowerWebhook) Name() string
func (ChannelFollowerWebhook) Type ¶
func (ChannelFollowerWebhook) Type() WebhookType
func (*ChannelFollowerWebhook) UnmarshalJSON ¶
func (w *ChannelFollowerWebhook) UnmarshalJSON(data []byte) error
type ChannelPins ¶ added in v0.19.0
type ChannelPins struct {
Items []MessagePin `json:"items"`
HasMore bool `json:"has_more"`
}
type ChannelSelectMenuComponent ¶ added in v0.14.0
type ChannelSelectMenuComponent struct {
ID int `json:"id,omitempty"`
CustomID string `json:"custom_id"`
Placeholder string `json:"placeholder,omitempty"`
DefaultValues []SelectMenuDefaultValue `json:"default_values,omitempty"`
MinValues *int `json:"min_values,omitempty"`
MaxValues int `json:"max_values,omitempty"`
ChannelTypes []ChannelType `json:"channel_types,omitempty"`
// Required Indicates if the select menu is required to submit the Modal.
Required bool `json:"required"`
// Disabled whether the select menu is disabled (only supported in messages)
Disabled bool `json:"disabled"`
// Values is only set when the ChannelSelectMenuComponent is received from an InteractionTypeModalSubmit
Values []snowflake.ID `json:"values,omitempty"`
}
func NewChannelSelectMenu ¶ added in v0.14.0
func NewChannelSelectMenu(customID string, placeholder string) ChannelSelectMenuComponent
NewChannelSelectMenu builds a new SelectMenuComponent from the provided values
func (ChannelSelectMenuComponent) AddDefaultValue ¶ added in v0.16.10
func (c ChannelSelectMenuComponent) AddDefaultValue(defaultValue snowflake.ID) ChannelSelectMenuComponent
AddDefaultValue returns a new ChannelSelectMenuComponent with the provided default value added
func (ChannelSelectMenuComponent) AsDisabled ¶ added in v0.14.0
func (c ChannelSelectMenuComponent) AsDisabled() ChannelSelectMenuComponent
AsDisabled returns a new ChannelSelectMenuComponent but disabled
func (ChannelSelectMenuComponent) AsEnabled ¶ added in v0.14.0
func (c ChannelSelectMenuComponent) AsEnabled() ChannelSelectMenuComponent
AsEnabled returns a new ChannelSelectMenuComponent but enabled
func (ChannelSelectMenuComponent) GetCustomID ¶ added in v0.19.0
func (c ChannelSelectMenuComponent) GetCustomID() string
func (ChannelSelectMenuComponent) GetID ¶ added in v0.19.0
func (c ChannelSelectMenuComponent) GetID() int
func (ChannelSelectMenuComponent) MarshalJSON ¶ added in v0.14.0
func (c ChannelSelectMenuComponent) MarshalJSON() ([]byte, error)
func (ChannelSelectMenuComponent) RemoveDefaultValue ¶ added in v0.16.10
func (c ChannelSelectMenuComponent) RemoveDefaultValue(index int) ChannelSelectMenuComponent
RemoveDefaultValue returns a new ChannelSelectMenuComponent with the provided default value at the index removed
func (ChannelSelectMenuComponent) SetDefaultValues ¶ added in v0.16.10
func (c ChannelSelectMenuComponent) SetDefaultValues(defaultValues ...snowflake.ID) ChannelSelectMenuComponent
SetDefaultValues returns a new ChannelSelectMenuComponent with the provided default values
func (ChannelSelectMenuComponent) Type ¶ added in v0.14.0
func (ChannelSelectMenuComponent) Type() ComponentType
func (ChannelSelectMenuComponent) WithChannelTypes ¶ added in v0.15.1
func (c ChannelSelectMenuComponent) WithChannelTypes(channelTypes ...ChannelType) ChannelSelectMenuComponent
WithChannelTypes returns a new ChannelSelectMenuComponent with the provided channelTypes
func (ChannelSelectMenuComponent) WithCustomID ¶ added in v0.14.0
func (c ChannelSelectMenuComponent) WithCustomID(customID string) ChannelSelectMenuComponent
WithCustomID returns a new ChannelSelectMenuComponent with the provided customID
func (ChannelSelectMenuComponent) WithDisabled ¶ added in v0.14.0
func (c ChannelSelectMenuComponent) WithDisabled(disabled bool) ChannelSelectMenuComponent
WithDisabled returns a new ChannelSelectMenuComponent with the provided disabled
func (ChannelSelectMenuComponent) WithID ¶ added in v0.19.0
func (c ChannelSelectMenuComponent) WithID(id int) ChannelSelectMenuComponent
WithID returns a new ChannelSelectMenuComponent with the provided ID
func (ChannelSelectMenuComponent) WithMaxValues ¶ added in v0.14.0
func (c ChannelSelectMenuComponent) WithMaxValues(maxValue int) ChannelSelectMenuComponent
WithMaxValues returns a new ChannelSelectMenuComponent with the provided maxValue
func (ChannelSelectMenuComponent) WithMinValues ¶ added in v0.14.0
func (c ChannelSelectMenuComponent) WithMinValues(minValue int) ChannelSelectMenuComponent
WithMinValues returns a new ChannelSelectMenuComponent with the provided minValue
func (ChannelSelectMenuComponent) WithPlaceholder ¶ added in v0.14.0
func (c ChannelSelectMenuComponent) WithPlaceholder(placeholder string) ChannelSelectMenuComponent
WithPlaceholder returns a new ChannelSelectMenuComponent with the provided placeholder
func (ChannelSelectMenuComponent) WithRequired ¶ added in v0.19.0
func (c ChannelSelectMenuComponent) WithRequired(required bool) ChannelSelectMenuComponent
WithRequired returns a new ChannelSelectMenuComponent with the provided required value
type ChannelSelectMenuInteractionData ¶ added in v0.14.0
type ChannelSelectMenuInteractionData struct {
Resolved ChannelSelectMenuResolved `json:"resolved"`
Values []snowflake.ID `json:"values"`
// contains filtered or unexported fields
}
func (ChannelSelectMenuInteractionData) Channels ¶ added in v0.14.0
func (d ChannelSelectMenuInteractionData) Channels() []ResolvedChannel
func (ChannelSelectMenuInteractionData) CustomID ¶ added in v0.14.0
func (d ChannelSelectMenuInteractionData) CustomID() string
func (ChannelSelectMenuInteractionData) MarshalJSON ¶ added in v0.14.0
func (d ChannelSelectMenuInteractionData) MarshalJSON() ([]byte, error)
func (ChannelSelectMenuInteractionData) Type ¶ added in v0.14.0
func (ChannelSelectMenuInteractionData) Type() ComponentType
func (*ChannelSelectMenuInteractionData) UnmarshalJSON ¶ added in v0.14.0
func (d *ChannelSelectMenuInteractionData) UnmarshalJSON(data []byte) error
type ChannelSelectMenuResolved ¶ added in v0.14.0
type ChannelSelectMenuResolved struct {
Channels map[snowflake.ID]ResolvedChannel `json:"channels"`
}
type ChannelTag ¶ added in v0.16.8
type ChannelType ¶
type ChannelType int
ChannelType for interacting with discord's channels
const ( ChannelTypeGuildText ChannelType = iota ChannelTypeDM ChannelTypeGuildVoice ChannelTypeGroupDM ChannelTypeGuildCategory ChannelTypeGuildNews ChannelTypeGuildNewsThread ChannelTypeGuildPublicThread ChannelTypeGuildPrivateThread ChannelTypeGuildStageVoice ChannelTypeGuildDirectory ChannelTypeGuildForum ChannelTypeGuildMedia )
Channel constants
type ChannelUpdate ¶
type ChannelUpdate interface {
// contains filtered or unexported methods
}
type CheckboxComponent ¶ added in v0.19.1
type CheckboxComponent struct {
// ID is the identifier for the file checkbox component.
ID int `json:"id,omitempty"`
// CustomID is the custom identifier for the checkbox component.
CustomID string `json:"custom_id"`
// Default indicates whether the checkbox is selected by default.
Default bool `json:"default"`
// Value is only set when the [CheckboxComponent] is received from an [InteractionTypeModalSubmit].
Value bool `json:"value"`
}
CheckboxComponent is a component that allows users to select a single checkbox.
func (CheckboxComponent) GetCustomID ¶ added in v0.19.1
func (c CheckboxComponent) GetCustomID() string
func (CheckboxComponent) GetID ¶ added in v0.19.1
func (c CheckboxComponent) GetID() int
func (CheckboxComponent) MarshalJSON ¶ added in v0.19.1
func (c CheckboxComponent) MarshalJSON() ([]byte, error)
func (CheckboxComponent) Type ¶ added in v0.19.1
func (CheckboxComponent) Type() ComponentType
func (CheckboxComponent) WithCustomID ¶ added in v0.19.1
func (c CheckboxComponent) WithCustomID(customID string) CheckboxComponent
WithCustomID returns a new CheckboxComponent with the provided customID
func (CheckboxComponent) WithDefault ¶ added in v0.19.1
func (c CheckboxComponent) WithDefault(def bool) CheckboxComponent
WithDefault returns a new CheckboxComponent with the provided default
func (CheckboxComponent) WithID ¶ added in v0.19.1
func (c CheckboxComponent) WithID(id int) CheckboxComponent
WithID returns a new CheckboxComponent with the provided id
type CheckboxGroupComponent ¶ added in v0.19.1
type CheckboxGroupComponent struct {
// ID is the identifier for the checkbox component.
ID int `json:"id,omitempty"`
// CustomID is the custom identifier for the checkbox component.
CustomID string `json:"custom_id"`
// Required specifies whether the checkbox is required. (default: false)
Required bool `json:"required"`
// Options is the options available in the radio group. (min: 1, max: 10)
Options []CheckboxGroupOption `json:"options"`
// MinValues is the minimum number of options that must be selected. (default: 1, min: 0, max: 10)
MinValues *int `json:"min_values,omitempty"`
// MaxValues is the maximum number of options that can be selected. (default: len(options), min: 1, max: 10)
MaxValues int `json:"max_values,omitempty"`
// Values is only set when the [CheckboxGroupComponent] is received from an [InteractionTypeModalSubmit].
Values []string `json:"values,omitempty"`
}
CheckboxGroupComponent is a component that allows users to select multiple options from a list.
func (CheckboxGroupComponent) GetCustomID ¶ added in v0.19.1
func (c CheckboxGroupComponent) GetCustomID() string
func (CheckboxGroupComponent) GetID ¶ added in v0.19.1
func (c CheckboxGroupComponent) GetID() int
func (CheckboxGroupComponent) MarshalJSON ¶ added in v0.19.1
func (c CheckboxGroupComponent) MarshalJSON() ([]byte, error)
func (CheckboxGroupComponent) Type ¶ added in v0.19.1
func (CheckboxGroupComponent) Type() ComponentType
func (CheckboxGroupComponent) WithCustomID ¶ added in v0.19.1
func (c CheckboxGroupComponent) WithCustomID(customID string) CheckboxGroupComponent
WithCustomID returns a new CheckboxGroupComponent with the provided customID
func (CheckboxGroupComponent) WithID ¶ added in v0.19.1
func (c CheckboxGroupComponent) WithID(id int) CheckboxGroupComponent
WithID returns a new CheckboxGroupComponent with the provided id
func (CheckboxGroupComponent) WithMaxValues ¶ added in v0.19.1
func (c CheckboxGroupComponent) WithMaxValues(maxValues int) CheckboxGroupComponent
WithMaxValues returns a new CheckboxGroupComponent with the provided maxValues
func (CheckboxGroupComponent) WithMinValues ¶ added in v0.19.1
func (c CheckboxGroupComponent) WithMinValues(minValues int) CheckboxGroupComponent
WithMinValues returns a new CheckboxGroupComponent with the provided minValues
func (CheckboxGroupComponent) WithOptions ¶ added in v0.19.1
func (c CheckboxGroupComponent) WithOptions(options ...CheckboxGroupOption) CheckboxGroupComponent
WithOptions returns a new CheckboxGroupComponent with the provided options
func (CheckboxGroupComponent) WithRequired ¶ added in v0.19.1
func (c CheckboxGroupComponent) WithRequired(required bool) CheckboxGroupComponent
WithRequired returns a new CheckboxGroupComponent with the provided required
type CheckboxGroupOption ¶ added in v0.19.1
type CheckboxGroupOption struct {
// Value is the value of the option. (max: 100 characters)
Value string `json:"value"`
// Label is the label of the option. (max: 100 characters)
Label string `json:"label"`
// Description is the description of the option. (max: 100 characters)
Description string `json:"description,omitempty"`
// Default indicates whether the option is selected by default.
Default bool `json:"default"`
}
CheckboxGroupOption is an option in a CheckboxGroupComponent.
func NewCheckboxGroupOption ¶ added in v0.19.1
func NewCheckboxGroupOption(value string, label string) CheckboxGroupOption
NewCheckboxGroupOption creates a new CheckboxGroupOption with the provided value and label.
func (CheckboxGroupOption) WithDefault ¶ added in v0.19.1
func (o CheckboxGroupOption) WithDefault(def bool) CheckboxGroupOption
WithDefault returns a new CheckboxGroupOption with the provided default
func (CheckboxGroupOption) WithDescription ¶ added in v0.19.1
func (o CheckboxGroupOption) WithDescription(description string) CheckboxGroupOption
WithDescription returns a new CheckboxGroupOption with the provided description
func (CheckboxGroupOption) WithLabel ¶ added in v0.19.1
func (o CheckboxGroupOption) WithLabel(label string) CheckboxGroupOption
WithLabel returns a new CheckboxGroupOption with the provided label
func (CheckboxGroupOption) WithValue ¶ added in v0.19.1
func (o CheckboxGroupOption) WithValue(value string) CheckboxGroupOption
WithValue returns a new CheckboxGroupOption with the provided value
type ClientStatus ¶
type ClientStatus struct {
Desktop OnlineStatus `json:"desktop,omitempty"`
Mobile OnlineStatus `json:"mobile,omitempty"`
Web OnlineStatus `json:"web,omitempty"`
}
ClientStatus (https://discord.com/developers/docs/topics/gateway#client-status-object)
type Collectibles ¶ added in v0.19.0
type Collectibles struct {
Nameplate *Nameplate `json:"nameplate"`
}
type Component ¶
type Component interface {
json.Marshaler
// Type returns the ComponentType of the Component.
Type() ComponentType
// GetID returns the id of the Component. This is used to uniquely identify a Component in a [Message] and needs to be unique.
GetID() int
// contains filtered or unexported methods
}
Component is an interface for all components. ActionRowComponent ButtonComponent StringSelectMenuComponent TextInputComponent (only supported in modals) UserSelectMenuComponent RoleSelectMenuComponent MentionableSelectMenuComponent ChannelSelectMenuComponent SectionComponent TextDisplayComponent ThumbnailComponent MediaGalleryComponent FileComponent SeparatorComponent ContainerComponent FileUploadComponent RadioGroupComponent (only supported in modals) CheckboxGroupComponent (only supported in modals) CheckboxComponent (only supported in modals) UnknownComponent
type ComponentEmoji ¶
type ComponentEmoji struct {
ID snowflake.ID `json:"id,omitempty"`
Name string `json:"name,omitempty"`
Animated bool `json:"animated,omitempty"`
}
func NewComponentEmoji ¶ added in v0.19.0
func NewComponentEmoji(name string) ComponentEmoji
NewComponentEmoji creates a new ComponentEmoji with the provided name (for Unicode emojis)
func NewCustomComponentEmoji ¶ added in v0.19.0
func NewCustomComponentEmoji(id snowflake.ID) ComponentEmoji
NewCustomComponentEmoji creates a new ComponentEmoji with the provided id (for custom Discord emojis)
func (ComponentEmoji) WithAnimated ¶ added in v0.19.0
func (c ComponentEmoji) WithAnimated(animated bool) ComponentEmoji
WithAnimated returns a new ComponentEmoji with the provided animated flag
type ComponentInteraction ¶
type ComponentInteraction struct {
Data ComponentInteractionData `json:"data"`
Message Message `json:"message"`
// contains filtered or unexported fields
}
func (ComponentInteraction) AppPermissions ¶ added in v0.15.1
func (i ComponentInteraction) AppPermissions() *Permissions
func (ComponentInteraction) ApplicationID ¶ added in v0.15.1
func (ComponentInteraction) AttachmentSizeLimit ¶ added in v0.18.16
func (i ComponentInteraction) AttachmentSizeLimit() int
func (ComponentInteraction) AuthorizingIntegrationOwners ¶ added in v0.18.0
func (i ComponentInteraction) AuthorizingIntegrationOwners() map[ApplicationIntegrationType]snowflake.ID
func (ComponentInteraction) ButtonInteractionData ¶
func (i ComponentInteraction) ButtonInteractionData() ButtonInteractionData
func (ComponentInteraction) Channel ¶ added in v0.16.1
func (i ComponentInteraction) Channel() InteractionChannel
func (ComponentInteraction) ChannelSelectMenuInteractionData ¶ added in v0.14.0
func (i ComponentInteraction) ChannelSelectMenuInteractionData() ChannelSelectMenuInteractionData
func (ComponentInteraction) Context ¶ added in v0.18.0
func (i ComponentInteraction) Context() InteractionContextType
func (ComponentInteraction) Entitlements ¶ added in v0.16.11
func (i ComponentInteraction) Entitlements() []Entitlement
func (ComponentInteraction) GuildLocale ¶ added in v0.15.1
func (i ComponentInteraction) GuildLocale() *Locale
func (ComponentInteraction) MarshalJSON ¶ added in v0.15.1
func (i ComponentInteraction) MarshalJSON() ([]byte, error)
func (ComponentInteraction) Member ¶ added in v0.15.1
func (i ComponentInteraction) Member() *ResolvedMember
func (ComponentInteraction) MentionableSelectMenuInteractionData ¶ added in v0.14.0
func (i ComponentInteraction) MentionableSelectMenuInteractionData() MentionableSelectMenuInteractionData
func (ComponentInteraction) PartialGuild ¶ added in v0.18.6
func (i ComponentInteraction) PartialGuild() *InteractionGuild
func (ComponentInteraction) RoleSelectMenuInteractionData ¶ added in v0.14.0
func (i ComponentInteraction) RoleSelectMenuInteractionData() RoleSelectMenuInteractionData
func (ComponentInteraction) SelectMenuInteractionData ¶
func (i ComponentInteraction) SelectMenuInteractionData() SelectMenuInteractionData
func (ComponentInteraction) StringSelectMenuInteractionData ¶ added in v0.14.0
func (i ComponentInteraction) StringSelectMenuInteractionData() StringSelectMenuInteractionData
func (ComponentInteraction) Type ¶
func (ComponentInteraction) Type() InteractionType
func (*ComponentInteraction) UnmarshalJSON ¶
func (i *ComponentInteraction) UnmarshalJSON(data []byte) error
func (ComponentInteraction) UserSelectMenuInteractionData ¶ added in v0.14.0
func (i ComponentInteraction) UserSelectMenuInteractionData() UserSelectMenuInteractionData
type ComponentInteractionData ¶
type ComponentInteractionData interface {
Type() ComponentType
CustomID() string
// contains filtered or unexported methods
}
type ComponentIter ¶ added in v0.19.0
ComponentIter is an optional interface a Component can implement to return an iterator over its sub components.
type ComponentType ¶
type ComponentType int
ComponentType defines different Component(s)
const ( ComponentTypeActionRow ComponentType = iota + 1 ComponentTypeButton ComponentTypeStringSelectMenu ComponentTypeTextInput ComponentTypeUserSelectMenu ComponentTypeRoleSelectMenu ComponentTypeMentionableSelectMenu ComponentTypeChannelSelectMenu ComponentTypeSection ComponentTypeTextDisplay ComponentTypeThumbnail ComponentTypeMediaGallery ComponentTypeFile ComponentTypeSeparator // ComponentTypeContentInventoryEntry cannot be used by bots. ComponentTypeContentInventoryEntry ComponentTypeContainer ComponentTypeLabel ComponentTypeFileUpload ComponentTypeRadioGroup ComponentTypeCheckboxGroup ComponentTypeCheckbox )
Supported ComponentType(s)
type Connection ¶
type Connection struct {
ID string `json:"id"`
Name string `json:"name"`
Type ConnectionType `json:"type"`
Revoked bool `json:"revoked,omitempty"`
Integrations []Integration `json:"integrations,omitempty"`
Verified bool `json:"verified"`
FriendSync bool `json:"friend_sync"`
ShowActivity bool `json:"show_activity"`
Visibility VisibilityType `json:"visibility"`
}
type ConnectionType ¶
type ConnectionType string
const ( ConnectionTypeAmazonMusic ConnectionType = "amazon-music" ConnectionTypeBattleNet ConnectionType = "battlenet" ConnectionTypeBluesky ConnectionType = "bluesky" ConnectionTypeBungie ConnectionType = "bungie" ConnectionTypeCrunchyroll ConnectionType = "crunchyroll" ConnectionTypeDomain ConnectionType = "domain" ConnectionTypeEbay ConnectionType = "ebay" ConnectionTypeEpicGames ConnectionType = "epicgames" ConnectionTypeFacebook ConnectionType = "facebook" ConnectionTypeGitHub ConnectionType = "github" ConnectionTypeInstagram ConnectionType = "instagram" ConnectionTypeLeagueOfLegends ConnectionType = "leagueoflegends" ConnectionTypeMastodon ConnectionType = "mastodon" ConnectionTypePayPal ConnectionType = "paypal" ConnectionTypePlayStationNetwork ConnectionType = "playstation" ConnectionTypeReddit ConnectionType = "reddit" ConnectionTypeRiotGames ConnectionType = "riotgames" ConnectionTypeRoblox ConnectionType = "roblox" ConnectionTypeSpotify ConnectionType = "spotify" ConnectionTypeSkype ConnectionType = "skype" ConnectionTypeSteam ConnectionType = "steam" ConnectionTypeTikTok ConnectionType = "tiktok" ConnectionTypeTwitch ConnectionType = "twitch" ConnectionTypeX ConnectionType = "twitter" ConnectionTypeXbox ConnectionType = "xbox" ConnectionTypeYouTube ConnectionType = "youtube" )
type ContainerComponent ¶
type ContainerComponent struct {
ID int `json:"id,omitempty"`
// AccentColor is the color of the left border of the container. (use 0 for no color)
AccentColor int `json:"accent_color,omitempty"`
Spoiler bool `json:"spoiler,omitempty"`
Components []ContainerSubComponent `json:"components"`
}
ContainerComponent is a component which lets you group components together. It looks similar to embeds and supports an accent color and spoiler state.
func NewContainer ¶ added in v0.19.0
func NewContainer(components ...ContainerSubComponent) ContainerComponent
NewContainer creates a new ContainerComponent with the provided components.
func (ContainerComponent) AddComponents ¶ added in v0.19.0
func (c ContainerComponent) AddComponents(components ...ContainerSubComponent) ContainerComponent
func (ContainerComponent) GetID ¶ added in v0.19.0
func (c ContainerComponent) GetID() int
func (ContainerComponent) MarshalJSON ¶ added in v0.19.0
func (c ContainerComponent) MarshalJSON() ([]byte, error)
func (ContainerComponent) RemoveComponent ¶ added in v0.19.0
func (c ContainerComponent) RemoveComponent(id int) ContainerComponent
func (ContainerComponent) SubComponents ¶ added in v0.19.0
func (c ContainerComponent) SubComponents() iter.Seq[Component]
func (ContainerComponent) Type ¶ added in v0.19.0
func (ContainerComponent) Type() ComponentType
func (*ContainerComponent) UnmarshalJSON ¶ added in v0.19.0
func (c *ContainerComponent) UnmarshalJSON(data []byte) error
func (ContainerComponent) UpdateComponent ¶ added in v0.19.0
func (c ContainerComponent) UpdateComponent(id int, component ContainerSubComponent) ContainerComponent
func (ContainerComponent) WithAccentColor ¶ added in v0.19.0
func (c ContainerComponent) WithAccentColor(accentColor int) ContainerComponent
func (ContainerComponent) WithComponents ¶ added in v0.19.0
func (c ContainerComponent) WithComponents(components ...ContainerSubComponent) ContainerComponent
func (ContainerComponent) WithID ¶ added in v0.19.0
func (c ContainerComponent) WithID(id int) ContainerComponent
func (ContainerComponent) WithSpoiler ¶ added in v0.19.0
func (c ContainerComponent) WithSpoiler(spoiler bool) ContainerComponent
type ContainerSubComponent ¶ added in v0.19.0
type ContainerSubComponent interface {
Component
// contains filtered or unexported methods
}
ContainerSubComponent is an interface for all components that can be present in a ContainerComponent. ActionRowComponent SectionComponent TextDisplayComponent MediaGalleryComponent FileComponent SeparatorComponent UnknownComponent
type ContextCommandInteractionData ¶
type ContextCommandInteractionData interface {
ApplicationCommandInteractionData
TargetID() snowflake.ID
// contains filtered or unexported methods
}
type CurrentMemberUpdate ¶ added in v0.13.19
type CurrentMemberUpdate struct {
Nick *string `json:"nick,omitempty"`
Banner omit.Omit[*Icon] `json:"banner,omitzero"`
Avatar omit.Omit[*Icon] `json:"avatar,omitzero"`
Bio *string `json:"bio,omitempty"`
}
CurrentMemberUpdate is used to update the current member
type CurrentUserVoiceStateUpdate ¶ added in v0.13.19
type DMChannel ¶
type DMChannel struct {
Recipients []User
// contains filtered or unexported fields
}
func (DMChannel) LastMessageID ¶
func (DMChannel) LastPinTimestamp ¶
func (DMChannel) MarshalJSON ¶
func (DMChannel) Type ¶
func (DMChannel) Type() ChannelType
func (*DMChannel) UnmarshalJSON ¶
type DMChannelCreate ¶
type DefaultForumLayout ¶ added in v0.14.1
type DefaultForumLayout int
const ( DefaultForumLayoutNotSet DefaultForumLayout = iota DefaultForumLayoutListView DefaultForumLayoutGalleryView )
type DefaultReactionEmoji ¶ added in v0.13.20
type DefaultSortOrder ¶ added in v0.13.21
type DefaultSortOrder int
const ( DefaultSortOrderLatestActivity DefaultSortOrder = iota DefaultSortOrderCreationDate )
type Embed ¶
type Embed struct {
Title string `json:"title,omitempty"`
Type EmbedType `json:"type,omitempty"`
Description string `json:"description,omitempty"`
URL string `json:"url,omitempty"`
Timestamp *time.Time `json:"timestamp,omitempty"`
Color int `json:"color,omitempty"`
Image *EmbedResource `json:"image,omitempty"`
Thumbnail *EmbedResource `json:"thumbnail,omitempty"`
Video *EmbedResource `json:"video,omitempty"`
Provider *EmbedProvider `json:"provider,omitempty"`
Author *EmbedAuthor `json:"author,omitempty"`
Fields []EmbedField `json:"fields,omitempty"`
}
Embed allows you to send embeds to discord
func (Embed) FindAllFields ¶ added in v0.18.11
func (e Embed) FindAllFields(fieldFindFunc func(field EmbedField) bool) []EmbedField
func (Embed) FindField ¶ added in v0.18.11
func (e Embed) FindField(fieldFindFunc func(field EmbedField) bool) (EmbedField, bool)
type EmbedAuthor ¶
type EmbedAuthor struct {
Name string `json:"name,omitempty"`
URL string `json:"url,omitempty"`
IconURL string `json:"icon_url,omitempty"`
ProxyIconURL string `json:"proxy_icon_url,omitempty"`
}
The EmbedAuthor of an Embed
type EmbedBuilder ¶
type EmbedBuilder struct {
Embed
}
EmbedBuilder allows you to create embeds and use methods to set values
func NewEmbedBuilder ¶
func NewEmbedBuilder() *EmbedBuilder
NewEmbedBuilder returns a new embed builder
func (*EmbedBuilder) AddField ¶
func (b *EmbedBuilder) AddField(name string, value string, inline bool) *EmbedBuilder
AddField adds a field to the EmbedBuilder by name and value
func (*EmbedBuilder) AddFields ¶
func (b *EmbedBuilder) AddFields(fields ...EmbedField) *EmbedBuilder
AddFields adds multiple fields to the EmbedBuilder
func (*EmbedBuilder) ClearFields ¶
func (b *EmbedBuilder) ClearFields() *EmbedBuilder
ClearFields removes all the fields from the EmbedBuilder
func (*EmbedBuilder) RemoveField ¶
func (b *EmbedBuilder) RemoveField(i int) *EmbedBuilder
RemoveField removes a field from the EmbedBuilder
func (*EmbedBuilder) SetAuthor ¶
func (b *EmbedBuilder) SetAuthor(name string, url string, iconURL string) *EmbedBuilder
SetAuthor sets the author of the EmbedBuilder with all properties
func (*EmbedBuilder) SetAuthorIcon ¶
func (b *EmbedBuilder) SetAuthorIcon(iconURL string) *EmbedBuilder
SetAuthorIcon sets the author icon of the EmbedBuilder
func (*EmbedBuilder) SetAuthorIconf ¶ added in v0.13.21
func (b *EmbedBuilder) SetAuthorIconf(iconURL string, a ...any) *EmbedBuilder
SetAuthorIconf sets the author icon of the EmbedBuilder with format
func (*EmbedBuilder) SetAuthorName ¶
func (b *EmbedBuilder) SetAuthorName(name string) *EmbedBuilder
SetAuthorName sets the author name of the EmbedBuilder
func (*EmbedBuilder) SetAuthorNamef ¶ added in v0.13.21
func (b *EmbedBuilder) SetAuthorNamef(name string, a ...any) *EmbedBuilder
SetAuthorNamef sets the author name of the EmbedBuilder with format
func (*EmbedBuilder) SetAuthorURL ¶
func (b *EmbedBuilder) SetAuthorURL(url string) *EmbedBuilder
SetAuthorURL sets the author URL of the EmbedBuilder
func (*EmbedBuilder) SetAuthorURLf ¶ added in v0.13.21
func (b *EmbedBuilder) SetAuthorURLf(url string, a ...any) *EmbedBuilder
SetAuthorURLf sets the author URL of the EmbedBuilder with format
func (*EmbedBuilder) SetColor ¶
func (b *EmbedBuilder) SetColor(color int) *EmbedBuilder
SetColor sets the color of the EmbedBuilder
func (*EmbedBuilder) SetDescription ¶
func (b *EmbedBuilder) SetDescription(description string) *EmbedBuilder
SetDescription sets the description of the EmbedBuilder
func (*EmbedBuilder) SetDescriptionf ¶
func (b *EmbedBuilder) SetDescriptionf(description string, a ...any) *EmbedBuilder
SetDescriptionf sets the description of the EmbedBuilder with format
func (*EmbedBuilder) SetEmbedAuthor ¶
func (b *EmbedBuilder) SetEmbedAuthor(author *EmbedAuthor) *EmbedBuilder
SetEmbedAuthor sets the author of the EmbedBuilder using an EmbedAuthor struct
func (*EmbedBuilder) SetEmbedFooter ¶
func (b *EmbedBuilder) SetEmbedFooter(footer *EmbedFooter) *EmbedBuilder
SetEmbedFooter sets the footer of the EmbedBuilder
func (*EmbedBuilder) SetField ¶
func (b *EmbedBuilder) SetField(i int, name string, value string, inline bool) *EmbedBuilder
SetField sets a field to the EmbedBuilder by name and value
func (*EmbedBuilder) SetFields ¶
func (b *EmbedBuilder) SetFields(fields ...EmbedField) *EmbedBuilder
SetFields sets fields of the EmbedBuilder
func (*EmbedBuilder) SetFooter ¶
func (b *EmbedBuilder) SetFooter(text string, iconURL string) *EmbedBuilder
SetFooter sets the footer icon of the EmbedBuilder
func (*EmbedBuilder) SetFooterIcon ¶
func (b *EmbedBuilder) SetFooterIcon(iconURL string) *EmbedBuilder
SetFooterIcon sets the footer icon of the EmbedBuilder
func (*EmbedBuilder) SetFooterIconf ¶ added in v0.13.21
func (b *EmbedBuilder) SetFooterIconf(iconURL string, a ...any) *EmbedBuilder
SetFooterIconf sets the footer icon of the EmbedBuilder
func (*EmbedBuilder) SetFooterText ¶
func (b *EmbedBuilder) SetFooterText(text string) *EmbedBuilder
SetFooterText sets the footer text of the EmbedBuilder
func (*EmbedBuilder) SetFooterTextf ¶ added in v0.13.21
func (b *EmbedBuilder) SetFooterTextf(text string, a ...any) *EmbedBuilder
SetFooterTextf sets the footer text of the EmbedBuilder with format
func (*EmbedBuilder) SetImage ¶
func (b *EmbedBuilder) SetImage(url string) *EmbedBuilder
SetImage sets the image of the EmbedBuilder
func (*EmbedBuilder) SetImagef ¶ added in v0.13.21
func (b *EmbedBuilder) SetImagef(url string, a ...any) *EmbedBuilder
SetImagef sets the image of the EmbedBuilder with format
func (*EmbedBuilder) SetThumbnail ¶
func (b *EmbedBuilder) SetThumbnail(url string) *EmbedBuilder
SetThumbnail sets the thumbnail of the EmbedBuilder
func (*EmbedBuilder) SetThumbnailf ¶ added in v0.13.21
func (b *EmbedBuilder) SetThumbnailf(url string, a ...any) *EmbedBuilder
SetThumbnailf sets the thumbnail of the EmbedBuilder with format
func (*EmbedBuilder) SetTimestamp ¶
func (b *EmbedBuilder) SetTimestamp(time time.Time) *EmbedBuilder
SetTimestamp sets the timestamp of the EmbedBuilder
func (*EmbedBuilder) SetTitle ¶
func (b *EmbedBuilder) SetTitle(title string) *EmbedBuilder
SetTitle sets the title of the EmbedBuilder
func (*EmbedBuilder) SetTitlef ¶
func (b *EmbedBuilder) SetTitlef(title string, a ...any) *EmbedBuilder
SetTitlef sets the title of the EmbedBuilder with format
func (*EmbedBuilder) SetURL ¶
func (b *EmbedBuilder) SetURL(url string) *EmbedBuilder
SetURL sets the URL of the EmbedBuilder
func (*EmbedBuilder) SetURLf ¶ added in v0.13.21
func (b *EmbedBuilder) SetURLf(url string, a ...any) *EmbedBuilder
SetURLf sets the URL of the EmbedBuilder with format
type EmbedField ¶
type EmbedField struct {
Name string `json:"name"`
Value string `json:"value"`
Inline *bool `json:"inline,omitempty"`
}
EmbedField (s) of an Embed
type EmbedFieldPollResult ¶ added in v0.18.11
type EmbedFieldPollResult string
const ( EmbedFieldPollResultQuestionText EmbedFieldPollResult = "poll_question_text" EmbedFieldPollResultVictorAnswerVotes EmbedFieldPollResult = "victor_answer_votes" EmbedFieldPollResultTotalVotes EmbedFieldPollResult = "total_votes" EmbedFieldPollResultVictorAnswerID EmbedFieldPollResult = "victor_answer_id" EmbedFieldPollResultVictorAnswerText EmbedFieldPollResult = "victor_answer_text" EmbedFieldPollResultVictorAnswerEmojiID EmbedFieldPollResult = "victor_answer_emoji_id" EmbedFieldPollResultVictorAnswerEmojiName EmbedFieldPollResult = "victor_answer_emoji_name" EmbedFieldPollResultVictorAnswerEmojiAnimated EmbedFieldPollResult = "victor_answer_emoji_animated" )
type EmbedProvider ¶
The EmbedProvider of an Embed
type EmbedResource ¶
type EmbedResource struct {
URL string `json:"url,omitempty"`
ProxyURL string `json:"proxy_url,omitempty"`
Height int `json:"height,omitempty"`
Width int `json:"width,omitempty"`
}
The EmbedResource of an Embed.Image/Embed.Thumbnail/Embed.Video
type EmbedType ¶
type EmbedType string
EmbedType is the type of Embed
const ( EmbedTypeRich EmbedType = "rich" EmbedTypeImage EmbedType = "image" EmbedTypeVideo EmbedType = "video" EmbedTypeGifV EmbedType = "gifv" EmbedTypeArticle EmbedType = "article" EmbedTypeLink EmbedType = "link" EmbedTypeAutoModerationMessage EmbedType = "auto_moderation_message" EmbedTypePollResult EmbedType = "poll_result" )
Constants for EmbedType
type Emoji ¶
type Emoji struct {
ID snowflake.ID `json:"id,omitempty"`
GuildID snowflake.ID `json:"guild_id,omitempty"` // not present in the API but we need it
Name string `json:"name,omitempty"` // may be empty for deleted emojis
Roles []snowflake.ID `json:"roles,omitempty"`
Creator *User `json:"user,omitempty"`
RequireColons bool `json:"require_colons,omitempty"`
Managed bool `json:"managed,omitempty"`
Animated bool `json:"animated,omitempty"`
Available bool `json:"available,omitempty"`
}
Emoji allows you to interact with emojis & emotes
type EmojiCreate ¶
type EmojiUpdate ¶
type Entitlement ¶ added in v0.16.11
type Entitlement struct {
ID snowflake.ID `json:"id"`
SkuID snowflake.ID `json:"sku_id"`
ApplicationID snowflake.ID `json:"application_id"`
UserID *snowflake.ID `json:"user_id"`
PromotionID *snowflake.ID `json:"promotion_id"`
Type EntitlementType `json:"type"`
Deleted bool `json:"deleted"`
GiftCodeFlags int `json:"gift_code_flags"`
Consumed *bool `json:"consumed"`
StartsAt *time.Time `json:"starts_at"`
EndsAt *time.Time `json:"ends_at"`
GuildID *snowflake.ID `json:"guild_id"`
SubscriptionID *snowflake.ID `json:"subscription_id"`
}
type EntitlementOwnerType ¶ added in v0.16.11
type EntitlementOwnerType int
const ( EntitlementOwnerTypeGuild EntitlementOwnerType = iota + 1 EntitlementOwnerTypeUser )
type EntitlementType ¶ added in v0.16.11
type EntitlementType int
const ( EntitlementTypePurchase EntitlementType = iota + 1 EntitlementTypePremiumSubscription EntitlementTypeDeveloperGift EntitlementTypeTestModePurchase EntitlementTypeFreePurchase EntitlementTypeUserGift EntitlementTypePremiumPurchase EntitlementTypeApplicationSubscription )
type EntityMetaData ¶
type EntityMetaData struct {
Location string `json:"location"`
}
EntityMetaData additional metadata for the scheduled event (https://discord.com/developers/docs/resources/guild-scheduled-event#guild-scheduled-event-object-guild-scheduled-event-entity-metadata)
type EntryPointCommand ¶ added in v0.18.11
type EntryPointCommand struct {
Handler EntryPointCommandHandlerType
// contains filtered or unexported fields
}
func (EntryPointCommand) ApplicationID ¶ added in v0.18.11
func (c EntryPointCommand) ApplicationID() snowflake.ID
func (EntryPointCommand) Contexts ¶ added in v0.18.11
func (c EntryPointCommand) Contexts() []InteractionContextType
func (EntryPointCommand) CreatedAt ¶ added in v0.18.11
func (c EntryPointCommand) CreatedAt() time.Time
func (EntryPointCommand) DMPermission ¶ added in v0.18.11
func (c EntryPointCommand) DMPermission() bool
func (EntryPointCommand) DefaultMemberPermissions ¶ added in v0.18.11
func (c EntryPointCommand) DefaultMemberPermissions() Permissions
func (EntryPointCommand) GuildID ¶ added in v0.18.11
func (c EntryPointCommand) GuildID() *snowflake.ID
func (EntryPointCommand) ID ¶ added in v0.18.11
func (c EntryPointCommand) ID() snowflake.ID
func (EntryPointCommand) IntegrationTypes ¶ added in v0.18.11
func (c EntryPointCommand) IntegrationTypes() []ApplicationIntegrationType
func (EntryPointCommand) MarshalJSON ¶ added in v0.18.11
func (c EntryPointCommand) MarshalJSON() ([]byte, error)
func (EntryPointCommand) NSFW ¶ added in v0.18.11
func (c EntryPointCommand) NSFW() bool
func (EntryPointCommand) Name ¶ added in v0.18.11
func (c EntryPointCommand) Name() string
func (EntryPointCommand) NameLocalizations ¶ added in v0.18.11
func (c EntryPointCommand) NameLocalizations() map[Locale]string
func (EntryPointCommand) NameLocalized ¶ added in v0.18.11
func (c EntryPointCommand) NameLocalized() string
func (EntryPointCommand) Type ¶ added in v0.18.11
func (EntryPointCommand) Type() ApplicationCommandType
func (*EntryPointCommand) UnmarshalJSON ¶ added in v0.18.11
func (c *EntryPointCommand) UnmarshalJSON(data []byte) error
func (EntryPointCommand) Version ¶ added in v0.18.11
func (c EntryPointCommand) Version() snowflake.ID
type EntryPointCommandCreate ¶ added in v0.18.11
type EntryPointCommandCreate struct {
Name string `json:"name"`
NameLocalizations map[Locale]string `json:"name_localizations,omitempty"`
DefaultMemberPermissions omit.Omit[*Permissions] `json:"default_member_permissions,omitzero"`
IntegrationTypes []ApplicationIntegrationType `json:"integration_types,omitempty"`
Contexts []InteractionContextType `json:"contexts,omitempty"`
NSFW *bool `json:"nsfw,omitempty"`
Handler EntryPointCommandHandlerType `json:"handler,omitempty"`
}
func (EntryPointCommandCreate) CommandName ¶ added in v0.18.11
func (c EntryPointCommandCreate) CommandName() string
func (EntryPointCommandCreate) MarshalJSON ¶ added in v0.18.11
func (c EntryPointCommandCreate) MarshalJSON() ([]byte, error)
func (EntryPointCommandCreate) Type ¶ added in v0.18.11
func (EntryPointCommandCreate) Type() ApplicationCommandType
type EntryPointCommandHandlerType ¶ added in v0.18.11
type EntryPointCommandHandlerType int
const ( EntryPointCommandHandlerTypeAppHandler EntryPointCommandHandlerType = iota + 1 EntryPointCommandHandlerTypeDiscordLaunchActivity )
type EntryPointCommandInteractionData ¶ added in v0.18.11
type EntryPointCommandInteractionData struct {
// contains filtered or unexported fields
}
func (EntryPointCommandInteractionData) CommandID ¶ added in v0.18.11
func (d EntryPointCommandInteractionData) CommandID() snowflake.ID
func (EntryPointCommandInteractionData) CommandName ¶ added in v0.18.11
func (d EntryPointCommandInteractionData) CommandName() string
func (EntryPointCommandInteractionData) GuildID ¶ added in v0.18.11
func (d EntryPointCommandInteractionData) GuildID() *snowflake.ID
func (*EntryPointCommandInteractionData) MarshalJSON ¶ added in v0.18.11
func (d *EntryPointCommandInteractionData) MarshalJSON() ([]byte, error)
func (EntryPointCommandInteractionData) Type ¶ added in v0.18.11
func (EntryPointCommandInteractionData) Type() ApplicationCommandType
func (*EntryPointCommandInteractionData) UnmarshalJSON ¶ added in v0.18.11
func (d *EntryPointCommandInteractionData) UnmarshalJSON(data []byte) error
type EntryPointCommandUpdate ¶ added in v0.18.11
type EntryPointCommandUpdate struct {
Name *string `json:"name,omitempty"`
NameLocalizations *map[Locale]string `json:"name_localizations,omitempty"`
DefaultMemberPermissions omit.Omit[*Permissions] `json:"default_member_permissions,omitzero"`
IntegrationTypes *[]ApplicationIntegrationType `json:"integration_types,omitempty"`
Contexts *[]InteractionContextType `json:"contexts,omitempty"`
NSFW *bool `json:"nsfw,omitempty"`
Handler *EntryPointCommandHandlerType `json:"handler,omitempty"`
}
func (EntryPointCommandUpdate) CommandName ¶ added in v0.18.11
func (c EntryPointCommandUpdate) CommandName() *string
func (EntryPointCommandUpdate) MarshalJSON ¶ added in v0.18.11
func (c EntryPointCommandUpdate) MarshalJSON() ([]byte, error)
func (EntryPointCommandUpdate) Type ¶ added in v0.18.11
func (EntryPointCommandUpdate) Type() ApplicationCommandType
type ExplicitContentFilterLevel ¶
type ExplicitContentFilterLevel int
The ExplicitContentFilterLevel of a Guild
const ( ExplicitContentFilterLevelDisabled ExplicitContentFilterLevel = iota ExplicitContentFilterLevelMembersWithoutRoles ExplicitContentFilterLevelAllMembers )
Constants for ExplicitContentFilterLevel
type ExtendedInvite ¶
type FileComponent ¶ added in v0.19.0
type FileComponent struct {
ID int `json:"id,omitempty"`
// File only supports attachment://<filename> references
File UnfurledMediaItem `json:"file"`
Spoiler bool `json:"spoiler,omitempty"`
Name string `json:"name,omitempty"`
Size int `json:"size,omitempty"`
}
FileComponent is a component that displays a file.
func NewFileComponent ¶ added in v0.19.0
func NewFileComponent(url string) FileComponent
NewFileComponent creates a new FileComponent with the provided url.
func (FileComponent) GetID ¶ added in v0.19.0
func (c FileComponent) GetID() int
func (FileComponent) MarshalJSON ¶ added in v0.19.0
func (c FileComponent) MarshalJSON() ([]byte, error)
func (FileComponent) Type ¶ added in v0.19.0
func (FileComponent) Type() ComponentType
func (FileComponent) WithID ¶ added in v0.19.0
func (c FileComponent) WithID(id int) FileComponent
func (FileComponent) WithMediaURL ¶ added in v0.19.0
func (c FileComponent) WithMediaURL(url string) FileComponent
func (FileComponent) WithSpoiler ¶ added in v0.19.0
func (c FileComponent) WithSpoiler(spoiler bool) FileComponent
type FileFlags ¶
type FileFlags int
FileFlags are used to mark Attachments as Spoiler
type FileFormat ¶ added in v0.16.8
type FileFormat string
FileFormat is the type of file on Discord's CDN (https://discord.com/developers/docs/reference#image-formatting-image-formats)
const ( FileFormatNone FileFormat = "" FileFormatPNG FileFormat = "png" FileFormatJPEG FileFormat = "jpg" FileFormatWebP FileFormat = "webp" FileFormatAVIF FileFormat = "avif" FileFormatGIF FileFormat = "gif" FileFormatLottie FileFormat = "json" FileFormatWebM FileFormat = "webm" )
The available FileFormat(s)
func (FileFormat) Animated ¶ added in v0.16.8
func (f FileFormat) Animated() bool
Animated returns true if the FileFormat is animated
func (FileFormat) String ¶ added in v0.16.8
func (f FileFormat) String() string
String returns the string representation of the FileFormat
type FileUploadComponent ¶ added in v0.19.0
type FileUploadComponent struct {
// ID is the identifier for the file upload component.
ID int `json:"id,omitempty"`
// CustomID is the custom identifier for the file upload component.
CustomID string `json:"custom_id"`
// MinValues is the minimum number of files that must be uploaded. (default: 1, min: 0, max: 10)
MinValues *int `json:"min_values,omitempty"`
// MaxValues is the maximum number of files that can be uploaded. (default: 1, min: 1, max: 10)
MaxValues int `json:"max_values,omitempty"`
// Required specifies whether the file upload is required. (default: false)
Required bool `json:"required"`
// Values is only set when the FileUploadComponent is received from an InteractionTypeModalSubmit
Values []snowflake.ID `json:"values,omitempty"`
}
FileUploadComponent is a component that allows users to upload files via modals.
func NewFileUpload ¶ added in v0.19.0
func NewFileUpload(customID string) FileUploadComponent
NewFileUpload creates a new FileUploadComponent.
func (FileUploadComponent) GetCustomID ¶ added in v0.19.0
func (f FileUploadComponent) GetCustomID() string
func (FileUploadComponent) GetID ¶ added in v0.19.0
func (f FileUploadComponent) GetID() int
func (FileUploadComponent) MarshalJSON ¶ added in v0.19.0
func (f FileUploadComponent) MarshalJSON() ([]byte, error)
func (FileUploadComponent) Type ¶ added in v0.19.0
func (FileUploadComponent) Type() ComponentType
func (FileUploadComponent) WithCustomID ¶ added in v0.19.0
func (f FileUploadComponent) WithCustomID(customID string) FileUploadComponent
WithCustomID returns a new FileUploadComponent with the provided customID
func (FileUploadComponent) WithID ¶ added in v0.19.0
func (f FileUploadComponent) WithID(id int) FileUploadComponent
WithID returns a new FileUploadComponent with the provided id
func (FileUploadComponent) WithMaxValues ¶ added in v0.19.0
func (f FileUploadComponent) WithMaxValues(maxValues int) FileUploadComponent
WithMaxValues returns a new FileUploadComponent with the provided maxValues
func (FileUploadComponent) WithMinValues ¶ added in v0.19.0
func (f FileUploadComponent) WithMinValues(minValues int) FileUploadComponent
WithMinValues returns a new FileUploadComponent with the provided minValues
func (FileUploadComponent) WithRequired ¶ added in v0.19.0
func (f FileUploadComponent) WithRequired(required bool) FileUploadComponent
WithRequired returns a new FileUploadComponent with the provided required
type FollowChannel ¶ added in v0.8.9
type FollowedChannel ¶ added in v0.8.9
type GatewayBot ¶
type GatewayBot struct {
URL string `json:"url"`
Shards int `json:"shards"`
SessionStartLimit SessionStartLimit `json:"session_start_limit"`
}
type GatewayGuild ¶
type GatewayGuild struct {
RestGuild
Large bool `json:"large"`
VoiceStates []VoiceState `json:"voice_states"`
Members []Member `json:"members"`
Channels []GuildChannel `json:"channels"`
Threads []GuildThread `json:"threads"`
Presences []Presence `json:"presences"`
StageInstances []StageInstance `json:"stage_instances"`
GuildScheduledEvents []GuildScheduledEvent `json:"guild_scheduled_events"`
SoundboardSounds []SoundboardSound `json:"soundboard_sounds"`
}
func (*GatewayGuild) UnmarshalJSON ¶
func (g *GatewayGuild) UnmarshalJSON(data []byte) error
type GetAllThreads ¶
type GetAllThreads struct {
Threads []GuildThread `json:"threads"`
Members []ThreadMember `json:"members"`
}
type GetThreads ¶
type GetThreads struct {
Threads []GuildThread `json:"threads"`
Members []ThreadMember `json:"members"`
HasMore bool `json:"has_more"`
}
type GrantType ¶
type GrantType string
GrantType defines what type of request is being made.
type GroupDMChannel ¶ added in v0.18.6
type GroupDMChannel struct {
// contains filtered or unexported fields
}
func (GroupDMChannel) CreatedAt ¶ added in v0.18.6
func (c GroupDMChannel) CreatedAt() time.Time
func (GroupDMChannel) ID ¶ added in v0.18.6
func (c GroupDMChannel) ID() snowflake.ID
func (GroupDMChannel) IconURL ¶ added in v0.18.6
func (c GroupDMChannel) IconURL(opts ...CDNOpt) *string
IconURL returns the icon URL of this group DM or nil if not set
func (GroupDMChannel) LastMessageID ¶ added in v0.18.6
func (c GroupDMChannel) LastMessageID() *snowflake.ID
func (GroupDMChannel) LastPinTimestamp ¶ added in v0.18.6
func (c GroupDMChannel) LastPinTimestamp() *time.Time
func (GroupDMChannel) MarshalJSON ¶ added in v0.18.6
func (c GroupDMChannel) MarshalJSON() ([]byte, error)
func (GroupDMChannel) Name ¶ added in v0.18.6
func (c GroupDMChannel) Name() string
func (GroupDMChannel) OwnerID ¶ added in v0.18.6
func (c GroupDMChannel) OwnerID() *snowflake.ID
func (GroupDMChannel) String ¶ added in v0.18.6
func (c GroupDMChannel) String() string
func (GroupDMChannel) Type ¶ added in v0.18.6
func (GroupDMChannel) Type() ChannelType
func (*GroupDMChannel) UnmarshalJSON ¶ added in v0.18.6
func (c *GroupDMChannel) UnmarshalJSON(data []byte) error
type Guild ¶
type Guild struct {
ID snowflake.ID `json:"id"`
Name string `json:"name"`
Icon *string `json:"icon"`
Splash *string `json:"splash"`
DiscoverySplash *string `json:"discovery_splash"`
OwnerID snowflake.ID `json:"owner_id"`
AfkChannelID *snowflake.ID `json:"afk_channel_id"`
AfkTimeout int `json:"afk_timeout"`
WidgetEnabled bool `json:"widget_enabled"`
WidgetChannelID snowflake.ID `json:"widget_channel_id"`
VerificationLevel VerificationLevel `json:"verification_level"`
DefaultMessageNotifications MessageNotificationsLevel `json:"default_message_notifications"`
ExplicitContentFilter ExplicitContentFilterLevel `json:"explicit_content_filter"`
Features []GuildFeature `json:"features"`
MFALevel MFALevel `json:"mfa_level"`
ApplicationID *snowflake.ID `json:"application_id"`
SystemChannelID *snowflake.ID `json:"system_channel_id"`
SystemChannelFlags SystemChannelFlags `json:"system_channel_flags"`
RulesChannelID *snowflake.ID `json:"rules_channel_id"`
MemberCount int `json:"member_count"`
MaxPresences *int `json:"max_presences"`
MaxMembers int `json:"max_members"`
VanityURLCode *string `json:"vanity_url_code"`
Description *string `json:"description"`
Banner *string `json:"banner"`
PremiumTier PremiumTier `json:"premium_tier"`
PremiumSubscriptionCount int `json:"premium_subscription_count"`
PreferredLocale string `json:"preferred_locale"`
PublicUpdatesChannelID *snowflake.ID `json:"public_updates_channel_id"`
MaxVideoChannelUsers int `json:"max_video_channel_users"`
MaxStageVideoChannelUsers int `json:"max_stage_video_channel_users"`
WelcomeScreen GuildWelcomeScreen `json:"welcome_screen"`
NSFWLevel NSFWLevel `json:"nsfw_level"`
PremiumProgressBarEnabled bool `json:"premium_progress_bar_enabled"`
JoinedAt time.Time `json:"joined_at"`
SafetyAlertsChannelID *snowflake.ID `json:"safety_alerts_channel_id"`
IncidentsData *GuildIncidentsData `json:"incidents_data"`
// only over GET /guilds/{guild.id}
ApproximateMemberCount int `json:"approximate_member_count"`
ApproximatePresenceCount int `json:"approximate_presence_count"`
}
Guild represents a discord Guild
func (Guild) DiscoverySplashURL ¶
type GuildActiveThreads ¶ added in v0.18.11
type GuildActiveThreads struct {
Threads []GuildThread `json:"threads"`
Members []ThreadMember `json:"members"`
}
type GuildAudioChannel ¶
type GuildAudioChannel interface {
GuildChannel
// Bitrate returns the configured bitrate of the GuildAudioChannel.
Bitrate() int
// RTCRegion returns the configured voice server region of the GuildAudioChannel.
RTCRegion() string
// contains filtered or unexported methods
}
type GuildCategoryChannel ¶
type GuildCategoryChannel struct {
// contains filtered or unexported fields
}
func (GuildCategoryChannel) CreatedAt ¶ added in v0.13.17
func (c GuildCategoryChannel) CreatedAt() time.Time
func (GuildCategoryChannel) GuildID ¶
func (c GuildCategoryChannel) GuildID() snowflake.ID
func (GuildCategoryChannel) ID ¶
func (c GuildCategoryChannel) ID() snowflake.ID
func (GuildCategoryChannel) MarshalJSON ¶
func (c GuildCategoryChannel) MarshalJSON() ([]byte, error)
func (GuildCategoryChannel) Mention ¶
func (c GuildCategoryChannel) Mention() string
func (GuildCategoryChannel) Name ¶
func (c GuildCategoryChannel) Name() string
func (GuildCategoryChannel) ParentID ¶
func (c GuildCategoryChannel) ParentID() *snowflake.ID
ParentID always returns nil for GuildCategoryChannel as they can't be nested.
func (GuildCategoryChannel) PermissionOverwrites ¶
func (c GuildCategoryChannel) PermissionOverwrites() PermissionOverwrites
func (GuildCategoryChannel) Position ¶
func (c GuildCategoryChannel) Position() int
func (GuildCategoryChannel) String ¶
func (c GuildCategoryChannel) String() string
func (GuildCategoryChannel) Type ¶
func (GuildCategoryChannel) Type() ChannelType
func (*GuildCategoryChannel) UnmarshalJSON ¶
func (c *GuildCategoryChannel) UnmarshalJSON(data []byte) error
type GuildCategoryChannelCreate ¶
type GuildCategoryChannelCreate struct {
Name string `json:"name"`
Topic string `json:"topic,omitempty"`
Position int `json:"position,omitempty"`
PermissionOverwrites []PermissionOverwrite `json:"permission_overwrites,omitempty"`
}
func (GuildCategoryChannelCreate) MarshalJSON ¶
func (c GuildCategoryChannelCreate) MarshalJSON() ([]byte, error)
func (GuildCategoryChannelCreate) Type ¶
func (c GuildCategoryChannelCreate) Type() ChannelType
type GuildCategoryChannelUpdate ¶
type GuildCategoryChannelUpdate struct {
Name *string `json:"name,omitempty"`
Position *int `json:"position,omitempty"`
PermissionOverwrites *[]PermissionOverwrite `json:"permission_overwrites,omitempty"`
}
type GuildChannel ¶
type GuildChannel interface {
Channel
Mentionable
// GuildID returns the Guild ID of the GuildChannel
GuildID() snowflake.ID
// Position returns the position of the GuildChannel in the channel list.
// This is always 0 for GuildThread(s).
Position() int
// ParentID returns the parent Channel ID of the GuildChannel.
// This is never nil for GuildThread(s).
ParentID() *snowflake.ID
// PermissionOverwrites returns the GuildChannel's PermissionOverwrites for Role(s) and Member(s).
// This is always nil for GuildThread(s).
PermissionOverwrites() PermissionOverwrites
// contains filtered or unexported methods
}
func ApplyGuildIDToChannel ¶ added in v0.8.5
func ApplyGuildIDToChannel(channel GuildChannel, guildID snowflake.ID) GuildChannel
type GuildChannelCreate ¶
type GuildChannelCreate interface {
ChannelCreate
// contains filtered or unexported methods
}
type GuildChannelUpdate ¶
type GuildChannelUpdate interface {
ChannelUpdate
// contains filtered or unexported methods
}
type GuildCreateChannel ¶
type GuildCreateChannel struct {
ChannelCreate
ID int `json:"id,omitempty"`
ParentID int `json:"parent_id,omitempty"`
}
type GuildCreateRole ¶
type GuildCreateRole struct {
RoleCreate
ID int `json:"id,omitempty"`
}
type GuildFeature ¶
type GuildFeature string
The GuildFeature (s) that a Guild contains
const ( GuildFeatureAnimatedBanner GuildFeature = "ANIMATED_BANNER" GuildFeatureAnimatedIcon GuildFeature = "ANIMATED_ICON" GuildFeatureAutoModeration GuildFeature = "AUTO_MODERATION" GuildFeatureBanner GuildFeature = "BANNER" GuildFeatureCommunity GuildFeature = "COMMUNITY" GuildFeatureCreatorMonetizableProvisional GuildFeature = "CREATOR_MONETIZABLE_PROVISIONAL" GuildFeatureCreatorStorePage GuildFeature = "CREATOR_STORE_PAGE" GuildFeatureDeveloperSupportServer GuildFeature = "DEVELOPER_SUPPORT_SERVER" GuildFeatureDiscoverable GuildFeature = "DISCOVERABLE" GuildFeatureEnhancedRoleColors GuildFeature = "ENHANCED_ROLE_COLORS" GuildFeatureFeaturable GuildFeature = "FEATURABLE" GuildFeatureGuestsEnabled GuildFeature = "GUESTS_ENABLED" GuildFeatureGuildTags GuildFeature = "GUILD_TAGS" GuildFeatureInvitesDisabled GuildFeature = "INVITES_DISABLED" GuildFeatureInviteSplash GuildFeature = "INVITE_SPLASH" GuildFeatureMemberVerificationGateEnabled GuildFeature = "MEMBER_VERIFICATION_GATE_ENABLED" GuildFeatureMoreSoundboard GuildFeature = "MORE_SOUNDBOARD" GuildFeatureMoreStickers GuildFeature = "MORE_STICKERS" GuildFeatureNews GuildFeature = "NEWS" GuildFeaturePartnered GuildFeature = "PARTNERED" GuildFeaturePreviewEnabled GuildFeature = "PREVIEW_ENABLED" GuildFeatureRaidAlertsDisabled GuildFeature = "RAID_ALERTS_DISABLED" GuildFeatureRoleIcons GuildFeature = "ROLE_ICONS" GuildFeatureRoleSubscriptionsAvailableForPurchase GuildFeature = "ROLE_SUBSCRIPTIONS_AVAILABLE_FOR_PURCHASE" GuildFeatureRoleSubscriptionsEnabled GuildFeature = "ROLE_SUBSCRIPTIONS_ENABLED" GuildFeatureSoundboard GuildFeature = "SOUNDBOARD" GuildFeatureTicketedEventsEnabled GuildFeature = "TICKETED_EVENTS_ENABLED" GuildFeatureVanityURL GuildFeature = "VANITY_URL" GuildFeatureVerified GuildFeature = "VERIFIED" GuildFeatureVipRegions GuildFeature = "VIP_REGIONS" GuildFeatureWelcomeScreenEnabled GuildFeature = "WELCOME_SCREEN_ENABLED" )
Constants for GuildFeature
type GuildForumChannel ¶ added in v0.13.12
type GuildForumChannel struct {
LastPostID *snowflake.ID
Topic *string
NSFW bool
RateLimitPerUser int
Flags ChannelFlags
AvailableTags []ChannelTag
DefaultReactionEmoji *DefaultReactionEmoji
DefaultThreadRateLimitPerUser int
DefaultSortOrder *DefaultSortOrder
DefaultForumLayout DefaultForumLayout
// contains filtered or unexported fields
}
func (GuildForumChannel) CreatedAt ¶ added in v0.13.17
func (c GuildForumChannel) CreatedAt() time.Time
func (GuildForumChannel) GuildID ¶ added in v0.13.12
func (c GuildForumChannel) GuildID() snowflake.ID
func (GuildForumChannel) ID ¶ added in v0.13.12
func (c GuildForumChannel) ID() snowflake.ID
func (GuildForumChannel) MarshalJSON ¶ added in v0.13.12
func (c GuildForumChannel) MarshalJSON() ([]byte, error)
func (GuildForumChannel) Mention ¶ added in v0.13.12
func (c GuildForumChannel) Mention() string
func (GuildForumChannel) Name ¶ added in v0.13.12
func (c GuildForumChannel) Name() string
func (GuildForumChannel) ParentID ¶ added in v0.13.12
func (c GuildForumChannel) ParentID() *snowflake.ID
func (GuildForumChannel) PermissionOverwrites ¶ added in v0.13.12
func (c GuildForumChannel) PermissionOverwrites() PermissionOverwrites
func (GuildForumChannel) Position ¶ added in v0.13.12
func (c GuildForumChannel) Position() int
func (GuildForumChannel) String ¶ added in v0.13.12
func (c GuildForumChannel) String() string
func (GuildForumChannel) Type ¶ added in v0.13.12
func (GuildForumChannel) Type() ChannelType
func (*GuildForumChannel) UnmarshalJSON ¶ added in v0.13.12
func (c *GuildForumChannel) UnmarshalJSON(data []byte) error
type GuildForumChannelCreate ¶ added in v0.13.12
type GuildForumChannelCreate struct {
Name string `json:"name"`
Topic string `json:"topic,omitempty"`
Position int `json:"position,omitempty"`
PermissionOverwrites []PermissionOverwrite `json:"permission_overwrites,omitempty"`
ParentID snowflake.ID `json:"parent_id,omitempty"`
RateLimitPerUser int `json:"rate_limit_per_user,omitempty"`
DefaultReactionEmoji DefaultReactionEmoji `json:"default_reaction_emoji"`
AvailableTags []ChannelTag `json:"available_tags"`
DefaultSortOrder DefaultSortOrder `json:"default_sort_order"`
DefaultForumLayout DefaultForumLayout `json:"default_forum_layout"`
DefaultThreadRateLimitPerUser int `json:"default_thread_rate_limit_per_user,omitempty"`
}
func (GuildForumChannelCreate) MarshalJSON ¶ added in v0.13.12
func (c GuildForumChannelCreate) MarshalJSON() ([]byte, error)
func (GuildForumChannelCreate) Type ¶ added in v0.13.12
func (c GuildForumChannelCreate) Type() ChannelType
type GuildForumChannelUpdate ¶ added in v0.13.12
type GuildForumChannelUpdate struct {
Name *string `json:"name,omitempty"`
Position *int `json:"position,omitempty"`
Topic *string `json:"topic,omitempty"`
NSFW *bool `json:"nsfw,omitempty"`
PermissionOverwrites *[]PermissionOverwrite `json:"permission_overwrites,omitempty"`
ParentID *snowflake.ID `json:"parent_id,omitempty"`
RateLimitPerUser *int `json:"rate_limit_per_user"`
AvailableTags *[]ChannelTag `json:"available_tags,omitempty"`
Flags *ChannelFlags `json:"flags,omitempty"`
DefaultReactionEmoji omit.Omit[*DefaultReactionEmoji] `json:"default_reaction_emoji,omitzero"`
DefaultThreadRateLimitPerUser *int `json:"default_thread_rate_limit_per_user,omitempty"`
DefaultSortOrder omit.Omit[*DefaultSortOrder] `json:"default_sort_order,omitzero"`
DefaultForumLayout omit.Omit[*DefaultForumLayout] `json:"default_forum_layout,omitzero"`
}
type GuildFromTemplateCreate ¶
type GuildFromTemplateCreate struct {
Name string `json:"name"`
Icon *Icon `json:"icon,omitempty"`
}
GuildFromTemplateCreate is the data used to create a Guild from a GuildTemplate
type GuildIncidentActionsUpdate ¶ added in v0.18.15
type GuildIncidentsData ¶ added in v0.18.15
type GuildMediaChannel ¶ added in v0.16.8
type GuildMediaChannel struct {
LastPostID *snowflake.ID
Topic *string
NSFW bool
RateLimitPerUser int
Flags ChannelFlags
AvailableTags []ChannelTag
DefaultReactionEmoji *DefaultReactionEmoji
DefaultThreadRateLimitPerUser int
DefaultSortOrder *DefaultSortOrder
// contains filtered or unexported fields
}
func (GuildMediaChannel) CreatedAt ¶ added in v0.16.8
func (c GuildMediaChannel) CreatedAt() time.Time
func (GuildMediaChannel) GuildID ¶ added in v0.16.8
func (c GuildMediaChannel) GuildID() snowflake.ID
func (GuildMediaChannel) ID ¶ added in v0.16.8
func (c GuildMediaChannel) ID() snowflake.ID
func (GuildMediaChannel) MarshalJSON ¶ added in v0.16.8
func (c GuildMediaChannel) MarshalJSON() ([]byte, error)
func (GuildMediaChannel) Mention ¶ added in v0.16.8
func (c GuildMediaChannel) Mention() string
func (GuildMediaChannel) Name ¶ added in v0.16.8
func (c GuildMediaChannel) Name() string
func (GuildMediaChannel) ParentID ¶ added in v0.16.8
func (c GuildMediaChannel) ParentID() *snowflake.ID
func (GuildMediaChannel) PermissionOverwrites ¶ added in v0.16.8
func (c GuildMediaChannel) PermissionOverwrites() PermissionOverwrites
func (GuildMediaChannel) Position ¶ added in v0.16.8
func (c GuildMediaChannel) Position() int
func (GuildMediaChannel) String ¶ added in v0.16.8
func (c GuildMediaChannel) String() string
func (GuildMediaChannel) Type ¶ added in v0.16.8
func (GuildMediaChannel) Type() ChannelType
func (*GuildMediaChannel) UnmarshalJSON ¶ added in v0.16.8
func (c *GuildMediaChannel) UnmarshalJSON(data []byte) error
type GuildMediaChannelCreate ¶ added in v0.16.8
type GuildMediaChannelCreate struct {
Name string `json:"name"`
Topic string `json:"topic,omitempty"`
Position int `json:"position,omitempty"`
PermissionOverwrites []PermissionOverwrite `json:"permission_overwrites,omitempty"`
ParentID snowflake.ID `json:"parent_id,omitempty"`
RateLimitPerUser int `json:"rate_limit_per_user,omitempty"`
DefaultReactionEmoji DefaultReactionEmoji `json:"default_reaction_emoji"`
AvailableTags []ChannelTag `json:"available_tags"`
DefaultSortOrder DefaultSortOrder `json:"default_sort_order"`
DefaultThreadRateLimitPerUser int `json:"default_thread_rate_limit_per_user,omitempty"`
}
func (GuildMediaChannelCreate) MarshalJSON ¶ added in v0.16.8
func (c GuildMediaChannelCreate) MarshalJSON() ([]byte, error)
func (GuildMediaChannelCreate) Type ¶ added in v0.16.8
func (c GuildMediaChannelCreate) Type() ChannelType
type GuildMediaChannelUpdate ¶ added in v0.16.8
type GuildMediaChannelUpdate struct {
Name *string `json:"name,omitempty"`
Position *int `json:"position,omitempty"`
Topic *string `json:"topic,omitempty"`
NSFW *bool `json:"nsfw,omitempty"`
PermissionOverwrites *[]PermissionOverwrite `json:"permission_overwrites,omitempty"`
ParentID *snowflake.ID `json:"parent_id,omitempty"`
RateLimitPerUser *int `json:"rate_limit_per_user"`
AvailableTags *[]ChannelTag `json:"available_tags,omitempty"`
Flags *ChannelFlags `json:"flags,omitempty"`
DefaultReactionEmoji omit.Omit[*DefaultReactionEmoji] `json:"default_reaction_emoji,omitzero"`
DefaultThreadRateLimitPerUser *int `json:"default_thread_rate_limit_per_user,omitempty"`
DefaultSortOrder omit.Omit[*DefaultSortOrder] `json:"default_sort_order,omitzero"`
}
type GuildMessageChannel ¶
type GuildMessageChannel interface {
GuildChannel
MessageChannel
// Topic returns the topic of a GuildMessageChannel.
// This is always nil for GuildThread(s).
Topic() *string
// NSFW returns whether the GuildMessageChannel is marked as not safe for work.
// This is always false for GuildThread(s).
NSFW() bool
// DefaultAutoArchiveDuration returns the default AutoArchiveDuration for GuildThread(s) in this GuildMessageChannel.
// This is always 0 for GuildThread(s).
DefaultAutoArchiveDuration() AutoArchiveDuration
RateLimitPerUser() int
// contains filtered or unexported methods
}
func ApplyLastMessageIDToChannel ¶ added in v0.12.1
func ApplyLastMessageIDToChannel(channel GuildMessageChannel, lastMessageID snowflake.ID) GuildMessageChannel
func ApplyLastPinTimestampToChannel ¶ added in v0.13.0
func ApplyLastPinTimestampToChannel(channel GuildMessageChannel, lastPinTimestamp *time.Time) GuildMessageChannel
type GuildNewsChannel ¶
type GuildNewsChannel struct {
// contains filtered or unexported fields
}
func (GuildNewsChannel) CreatedAt ¶ added in v0.13.17
func (c GuildNewsChannel) CreatedAt() time.Time
func (GuildNewsChannel) DefaultAutoArchiveDuration ¶
func (c GuildNewsChannel) DefaultAutoArchiveDuration() AutoArchiveDuration
func (GuildNewsChannel) GuildID ¶
func (c GuildNewsChannel) GuildID() snowflake.ID
func (GuildNewsChannel) ID ¶
func (c GuildNewsChannel) ID() snowflake.ID
func (GuildNewsChannel) LastMessageID ¶
func (c GuildNewsChannel) LastMessageID() *snowflake.ID
func (GuildNewsChannel) LastPinTimestamp ¶
func (c GuildNewsChannel) LastPinTimestamp() *time.Time
func (GuildNewsChannel) MarshalJSON ¶
func (c GuildNewsChannel) MarshalJSON() ([]byte, error)
func (GuildNewsChannel) Mention ¶
func (c GuildNewsChannel) Mention() string
func (GuildNewsChannel) NSFW ¶
func (c GuildNewsChannel) NSFW() bool
func (GuildNewsChannel) Name ¶
func (c GuildNewsChannel) Name() string
func (GuildNewsChannel) ParentID ¶
func (c GuildNewsChannel) ParentID() *snowflake.ID
func (GuildNewsChannel) PermissionOverwrites ¶
func (c GuildNewsChannel) PermissionOverwrites() PermissionOverwrites
func (GuildNewsChannel) Position ¶
func (c GuildNewsChannel) Position() int
func (GuildNewsChannel) RateLimitPerUser ¶ added in v0.13.12
func (c GuildNewsChannel) RateLimitPerUser() int
func (GuildNewsChannel) String ¶
func (c GuildNewsChannel) String() string
func (GuildNewsChannel) Topic ¶
func (c GuildNewsChannel) Topic() *string
func (GuildNewsChannel) Type ¶
func (GuildNewsChannel) Type() ChannelType
func (*GuildNewsChannel) UnmarshalJSON ¶
func (c *GuildNewsChannel) UnmarshalJSON(data []byte) error
type GuildNewsChannelCreate ¶
type GuildNewsChannelCreate struct {
Name string `json:"name"`
Topic string `json:"topic,omitempty"`
RateLimitPerUser int `json:"rate_limit_per_user,omitempty"`
Position int `json:"position,omitempty"`
PermissionOverwrites []PermissionOverwrite `json:"permission_overwrites,omitempty"`
ParentID snowflake.ID `json:"parent_id,omitempty"`
NSFW bool `json:"nsfw,omitempty"`
DefaultAutoArchiveDuration AutoArchiveDuration `json:"default_auto_archive_days,omitempty"`
DefaultThreadRateLimitPerUser int `json:"default_thread_rate_limit_per_user,omitempty"`
}
func (GuildNewsChannelCreate) MarshalJSON ¶
func (c GuildNewsChannelCreate) MarshalJSON() ([]byte, error)
func (GuildNewsChannelCreate) Type ¶
func (c GuildNewsChannelCreate) Type() ChannelType
type GuildNewsChannelUpdate ¶
type GuildNewsChannelUpdate struct {
Name *string `json:"name,omitempty"`
Type *ChannelType `json:"type,omitempty"`
Position *int `json:"position,omitempty"`
Topic *string `json:"topic,omitempty"`
RateLimitPerUser *int `json:"rate_limit_per_user,omitempty"`
PermissionOverwrites *[]PermissionOverwrite `json:"permission_overwrites,omitempty"`
ParentID *snowflake.ID `json:"parent_id,omitempty"`
DefaultAutoArchiveDuration *int `json:"default_auto_archive_duration,omitempty"`
}
type GuildNewsThreadCreate ¶
type GuildNewsThreadCreate struct {
Name string `json:"name"`
AutoArchiveDuration AutoArchiveDuration `json:"auto_archive_duration,omitempty"`
}
func (GuildNewsThreadCreate) MarshalJSON ¶
func (c GuildNewsThreadCreate) MarshalJSON() ([]byte, error)
func (GuildNewsThreadCreate) Type ¶
func (GuildNewsThreadCreate) Type() ChannelType
type GuildOnboarding ¶ added in v0.16.0
type GuildOnboarding struct {
GuildID snowflake.ID `json:"guild_id"`
Prompts []GuildOnboardingPrompt `json:"prompts"`
DefaultChannelIDs []snowflake.ID `json:"default_channel_ids"`
Enabled bool `json:"enabled"`
Mode GuildOnboardingMode `json:"mode"`
}
type GuildOnboardingMode ¶ added in v0.16.8
type GuildOnboardingMode int
const ( GuildOnboardingModeDefault GuildOnboardingMode = iota GuildOnboardingModeAdvanced )
type GuildOnboardingPrompt ¶ added in v0.16.0
type GuildOnboardingPrompt struct {
ID snowflake.ID `json:"id"`
Options []GuildOnboardingPromptOption `json:"options"`
Title string `json:"title"`
SingleSelect bool `json:"single_select"`
Required bool `json:"required"`
InOnboarding bool `json:"in_onboarding"`
Type GuildOnboardingPromptType `json:"type"`
}
type GuildOnboardingPromptOption ¶ added in v0.16.0
type GuildOnboardingPromptOption struct {
ID snowflake.ID `json:"id"`
ChannelIDs []snowflake.ID `json:"channel_ids"`
RoleIDs []snowflake.ID `json:"role_ids"`
// When creating or updating prompts and their options, this field will be broken down into 3 separate fields in the payload: https://github.com/discord/discord-api-docs/pull/6479
Emoji PartialEmoji `json:"emoji"`
Title string `json:"title"`
Description *string `json:"description"`
}
func (GuildOnboardingPromptOption) MarshalJSON ¶ added in v0.17.0
func (o GuildOnboardingPromptOption) MarshalJSON() ([]byte, error)
type GuildOnboardingPromptType ¶ added in v0.16.0
type GuildOnboardingPromptType int
const ( GuildOnboardingPromptTypeMultipleChoice GuildOnboardingPromptType = iota GuildOnboardingPromptTypeDropdown )
type GuildOnboardingUpdate ¶ added in v0.16.8
type GuildOnboardingUpdate struct {
Prompts *[]GuildOnboardingPrompt `json:"prompts,omitempty"`
DefaultChannelIDs *[]snowflake.ID `json:"default_channel_ids,omitempty"`
Enabled *bool `json:"enabled,omitempty"`
Mode *GuildOnboardingMode `json:"mode,omitempty"`
}
type GuildPostUpdate ¶ added in v0.16.8
type GuildPostUpdate struct {
Name *string `json:"name,omitempty"`
Archived *bool `json:"archived,omitempty"`
AutoArchiveDuration *AutoArchiveDuration `json:"auto_archive_duration,omitempty"`
Locked *bool `json:"locked,omitempty"`
Invitable *bool `json:"invitable,omitempty"`
RateLimitPerUser *int `json:"rate_limit_per_user,omitempty"`
Flags *ChannelFlags `json:"flags,omitempty"`
AppliedTags *[]snowflake.ID `json:"applied_tags,omitempty"`
}
type GuildPreview ¶
type GuildPreview struct {
ID snowflake.ID `json:"id"`
Name string `json:"name"`
Icon *string `json:"icon"`
DiscoverySplash *string `json:"discovery_splash"`
Splash *string `json:"splash"`
Features []GuildFeature `json:"features"`
Description *string `json:"description"`
ApproximateMemberCount *int `json:"approximate_member_count"`
ApproximatePresenceCount *int `json:"approximate_presence_count"`
Emojis []Emoji `json:"emojis"`
Stickers []Sticker `json:"stickers"`
}
GuildPreview is used for previewing public Guild(s) before joining them
type GuildPrivateThreadCreate ¶
type GuildPrivateThreadCreate struct {
Name string `json:"name"`
AutoArchiveDuration AutoArchiveDuration `json:"auto_archive_duration,omitempty"`
Invitable *bool `json:"invitable,omitempty"`
}
func (GuildPrivateThreadCreate) MarshalJSON ¶
func (c GuildPrivateThreadCreate) MarshalJSON() ([]byte, error)
func (GuildPrivateThreadCreate) Type ¶
func (GuildPrivateThreadCreate) Type() ChannelType
type GuildPrune ¶ added in v0.14.1
type GuildPruneResult ¶ added in v0.14.1
type GuildPruneResult struct {
Pruned *int `json:"pruned"`
}
type GuildPublicThreadCreate ¶
type GuildPublicThreadCreate struct {
Name string `json:"name"`
AutoArchiveDuration AutoArchiveDuration `json:"auto_archive_duration,omitempty"`
}
func (GuildPublicThreadCreate) MarshalJSON ¶
func (c GuildPublicThreadCreate) MarshalJSON() ([]byte, error)
func (GuildPublicThreadCreate) Type ¶
func (GuildPublicThreadCreate) Type() ChannelType
type GuildScheduledEvent ¶
type GuildScheduledEvent struct {
ID snowflake.ID `json:"id"`
GuildID snowflake.ID `json:"guild_id"`
ChannelID *snowflake.ID `json:"channel_id"`
CreatorID snowflake.ID `json:"creator_id"`
Name string `json:"name"`
Description string `json:"description"`
ScheduledStartTime time.Time `json:"scheduled_start_time"`
ScheduledEndTime *time.Time `json:"scheduled_end_time"`
PrivacyLevel ScheduledEventPrivacyLevel `json:"privacy_level"`
Status ScheduledEventStatus `json:"status"`
EntityType ScheduledEventEntityType `json:"entity_type"`
EntityID *snowflake.ID `json:"entity_id"`
EntityMetaData *EntityMetaData `json:"entity_metadata"`
Creator User `json:"creator"`
UserCount int `json:"user_count"`
Image *string `json:"image"`
RecurrenceRule *ScheduledEventRecurrenceRule `json:"recurrence_rule"`
}
GuildScheduledEvent a representation of a scheduled event in a Guild (https://discord.com/developers/docs/resources/guild-scheduled-event#guild-scheduled-event-object)
func (GuildScheduledEvent) CoverURL ¶ added in v0.18.5
func (e GuildScheduledEvent) CoverURL(opts ...CDNOpt) *string
CoverURL returns the cover URL if set or nil
func (GuildScheduledEvent) CreatedAt ¶ added in v0.13.17
func (e GuildScheduledEvent) CreatedAt() time.Time
type GuildScheduledEventCreate ¶
type GuildScheduledEventCreate struct {
ChannelID snowflake.ID `json:"channel_id,omitempty"`
EntityMetaData *EntityMetaData `json:"entity_metadata,omitempty"`
Name string `json:"name"`
PrivacyLevel ScheduledEventPrivacyLevel `json:"privacy_level"`
ScheduledStartTime time.Time `json:"scheduled_start_time"`
ScheduledEndTime *time.Time `json:"scheduled_end_time,omitempty"`
Description string `json:"description,omitempty"`
EntityType ScheduledEventEntityType `json:"entity_type"`
Image *Icon `json:"image,omitempty"`
RecurrenceRule *ScheduledEventRecurrenceRule `json:"recurrence_rule,omitempty"`
}
type GuildScheduledEventUpdate ¶
type GuildScheduledEventUpdate struct {
ChannelID *snowflake.ID `json:"channel_id,omitempty"`
EntityMetaData *EntityMetaData `json:"entity_metadata,omitempty"`
Name string `json:"name,omitempty"`
PrivacyLevel *ScheduledEventPrivacyLevel `json:"privacy_level,omitempty"`
ScheduledStartTime *time.Time `json:"scheduled_start_time,omitempty"`
ScheduledEndTime *time.Time `json:"scheduled_end_time,omitempty"`
Description *string `json:"description,omitempty"`
EntityType *ScheduledEventEntityType `json:"entity_type,omitempty"`
Status *ScheduledEventStatus `json:"status,omitempty"`
Image omit.Omit[*Icon] `json:"image,omitzero"`
RecurrenceRule omit.Omit[*ScheduledEventRecurrenceRule] `json:"recurrence_rule,omitzero"`
}
type GuildScheduledEventUser ¶
type GuildStageVoiceChannel ¶
type GuildStageVoiceChannel struct {
VideoQualityMode VideoQualityMode
// contains filtered or unexported fields
}
func (GuildStageVoiceChannel) Bitrate ¶
func (c GuildStageVoiceChannel) Bitrate() int
func (GuildStageVoiceChannel) CreatedAt ¶ added in v0.13.17
func (c GuildStageVoiceChannel) CreatedAt() time.Time
func (GuildStageVoiceChannel) DefaultAutoArchiveDuration ¶ added in v0.16.10
func (c GuildStageVoiceChannel) DefaultAutoArchiveDuration() AutoArchiveDuration
DefaultAutoArchiveDuration is always 0 for GuildStageVoiceChannel(s) as they do not have their own AutoArchiveDuration.
func (GuildStageVoiceChannel) GuildID ¶
func (c GuildStageVoiceChannel) GuildID() snowflake.ID
func (GuildStageVoiceChannel) ID ¶
func (c GuildStageVoiceChannel) ID() snowflake.ID
func (GuildStageVoiceChannel) LastMessageID ¶ added in v0.16.10
func (c GuildStageVoiceChannel) LastMessageID() *snowflake.ID
func (GuildStageVoiceChannel) LastPinTimestamp ¶ added in v0.16.10
func (c GuildStageVoiceChannel) LastPinTimestamp() *time.Time
LastPinTimestamp always returns nil for GuildStageVoiceChannel(s) as they cannot have pinned messages.
func (GuildStageVoiceChannel) MarshalJSON ¶
func (c GuildStageVoiceChannel) MarshalJSON() ([]byte, error)
func (GuildStageVoiceChannel) Mention ¶
func (c GuildStageVoiceChannel) Mention() string
func (GuildStageVoiceChannel) NSFW ¶ added in v0.16.10
func (c GuildStageVoiceChannel) NSFW() bool
func (GuildStageVoiceChannel) Name ¶
func (c GuildStageVoiceChannel) Name() string
func (GuildStageVoiceChannel) ParentID ¶
func (c GuildStageVoiceChannel) ParentID() *snowflake.ID
func (GuildStageVoiceChannel) PermissionOverwrites ¶
func (c GuildStageVoiceChannel) PermissionOverwrites() PermissionOverwrites
func (GuildStageVoiceChannel) Position ¶
func (c GuildStageVoiceChannel) Position() int
func (GuildStageVoiceChannel) RTCRegion ¶
func (c GuildStageVoiceChannel) RTCRegion() string
func (GuildStageVoiceChannel) RateLimitPerUser ¶ added in v0.16.10
func (c GuildStageVoiceChannel) RateLimitPerUser() int
func (GuildStageVoiceChannel) String ¶
func (c GuildStageVoiceChannel) String() string
func (GuildStageVoiceChannel) Topic ¶ added in v0.16.10
func (c GuildStageVoiceChannel) Topic() *string
Topic always returns nil for GuildStageVoiceChannel(s) as they do not have their own topic.
func (GuildStageVoiceChannel) Type ¶
func (GuildStageVoiceChannel) Type() ChannelType
func (*GuildStageVoiceChannel) UnmarshalJSON ¶
func (c *GuildStageVoiceChannel) UnmarshalJSON(data []byte) error
type GuildStageVoiceChannelCreate ¶ added in v0.8.9
type GuildStageVoiceChannelCreate struct {
Name string `json:"name"`
Bitrate int `json:"bitrate,omitempty"`
UserLimit int `json:"user_limit,omitempty"`
RateLimitPerUser int `json:"rate_limit_per_user,omitempty"`
Position int `json:"position,omitempty"`
PermissionOverwrites []PermissionOverwrite `json:"permission_overwrites,omitempty"`
ParentID snowflake.ID `json:"parent_id,omitempty"`
NSFW bool `json:"nsfw,omitempty"`
RTCRegion string `json:"rtc_region,omitempty"`
VideoQualityMode VideoQualityMode `json:"video_quality_mode,omitempty"`
}
func (GuildStageVoiceChannelCreate) MarshalJSON ¶ added in v0.8.9
func (c GuildStageVoiceChannelCreate) MarshalJSON() ([]byte, error)
func (GuildStageVoiceChannelCreate) Type ¶ added in v0.8.9
func (c GuildStageVoiceChannelCreate) Type() ChannelType
type GuildStageVoiceChannelUpdate ¶
type GuildStageVoiceChannelUpdate struct {
Name *string `json:"name,omitempty"`
Position *int `json:"position,omitempty"`
RateLimitPerUser *int `json:"rate_limit_per_user,omitempty"`
Bitrate *int `json:"bitrate,omitempty"`
UserLimit *int `json:"user_limit,omitempty"`
PermissionOverwrites *[]PermissionOverwrite `json:"permission_overwrites,omitempty"`
ParentID *snowflake.ID `json:"parent_id,omitempty"`
RTCRegion *string `json:"rtc_region,omitempty"`
NSFW *bool `json:"nsfw,omitempty"`
VideoQualityMode *VideoQualityMode `json:"video_quality_mode,omitempty"`
}
type GuildSubscriptionIntegration ¶ added in v0.16.9
type GuildSubscriptionIntegration struct {
IntegrationID snowflake.ID `json:"id"`
Name string `json:"name"`
Enabled bool `json:"enabled"`
Account IntegrationAccount `json:"account"`
}
func (GuildSubscriptionIntegration) CreatedAt ¶ added in v0.16.9
func (i GuildSubscriptionIntegration) CreatedAt() time.Time
func (GuildSubscriptionIntegration) ID ¶ added in v0.16.9
func (i GuildSubscriptionIntegration) ID() snowflake.ID
func (GuildSubscriptionIntegration) MarshalJSON ¶ added in v0.16.9
func (i GuildSubscriptionIntegration) MarshalJSON() ([]byte, error)
func (GuildSubscriptionIntegration) Type ¶ added in v0.16.9
func (GuildSubscriptionIntegration) Type() IntegrationType
type GuildTemplate ¶
type GuildTemplate struct {
Code string `json:"code"`
Name string `json:"name"`
Description *string `json:"description,omitempty"`
UsageCount int `json:"usage_count"`
CreatorID snowflake.ID `json:"creator_id"`
Creator User `json:"creator"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
GuildID snowflake.ID `json:"source_guild_id"`
Guild TemplateGuild `json:"serialized_source_guild"`
IsDirty bool `json:"is_dirty,omitempty"`
}
GuildTemplate is a template used for copying guilds https://discord.com/developers/docs/resources/guild-template
type GuildTemplateCreate ¶
type GuildTemplateCreate struct {
Name string `json:"name"`
Description string `json:"description,omitempty"`
}
GuildTemplateCreate is the data used to create a GuildTemplate
type GuildTemplateUpdate ¶
type GuildTemplateUpdate struct {
Name *string `json:"name,omitempty"`
Description *string `json:"description,omitempty"`
}
GuildTemplateUpdate is the data used to update a GuildTemplate
type GuildTextChannel ¶
type GuildTextChannel struct {
// contains filtered or unexported fields
}
func (GuildTextChannel) CreatedAt ¶ added in v0.13.17
func (c GuildTextChannel) CreatedAt() time.Time
func (GuildTextChannel) DefaultAutoArchiveDuration ¶
func (c GuildTextChannel) DefaultAutoArchiveDuration() AutoArchiveDuration
func (GuildTextChannel) GuildID ¶
func (c GuildTextChannel) GuildID() snowflake.ID
func (GuildTextChannel) ID ¶
func (c GuildTextChannel) ID() snowflake.ID
func (GuildTextChannel) LastMessageID ¶
func (c GuildTextChannel) LastMessageID() *snowflake.ID
func (GuildTextChannel) LastPinTimestamp ¶
func (c GuildTextChannel) LastPinTimestamp() *time.Time
func (GuildTextChannel) MarshalJSON ¶
func (c GuildTextChannel) MarshalJSON() ([]byte, error)
func (GuildTextChannel) Mention ¶
func (c GuildTextChannel) Mention() string
func (GuildTextChannel) NSFW ¶
func (c GuildTextChannel) NSFW() bool
func (GuildTextChannel) Name ¶
func (c GuildTextChannel) Name() string
func (GuildTextChannel) ParentID ¶
func (c GuildTextChannel) ParentID() *snowflake.ID
func (GuildTextChannel) PermissionOverwrites ¶
func (c GuildTextChannel) PermissionOverwrites() PermissionOverwrites
func (GuildTextChannel) Position ¶
func (c GuildTextChannel) Position() int
func (GuildTextChannel) RateLimitPerUser ¶ added in v0.13.12
func (c GuildTextChannel) RateLimitPerUser() int
func (GuildTextChannel) String ¶
func (c GuildTextChannel) String() string
func (GuildTextChannel) Topic ¶
func (c GuildTextChannel) Topic() *string
func (GuildTextChannel) Type ¶
func (GuildTextChannel) Type() ChannelType
func (*GuildTextChannel) UnmarshalJSON ¶
func (c *GuildTextChannel) UnmarshalJSON(data []byte) error
type GuildTextChannelCreate ¶
type GuildTextChannelCreate struct {
Name string `json:"name"`
Topic string `json:"topic,omitempty"`
RateLimitPerUser int `json:"rate_limit_per_user,omitempty"`
Position int `json:"position,omitempty"`
PermissionOverwrites []PermissionOverwrite `json:"permission_overwrites,omitempty"`
ParentID snowflake.ID `json:"parent_id,omitempty"`
NSFW bool `json:"nsfw,omitempty"`
DefaultAutoArchiveDuration AutoArchiveDuration `json:"default_auto_archive_days,omitempty"`
DefaultThreadRateLimitPerUser int `json:"default_thread_rate_limit_per_user,omitempty"`
}
func (GuildTextChannelCreate) MarshalJSON ¶
func (c GuildTextChannelCreate) MarshalJSON() ([]byte, error)
func (GuildTextChannelCreate) Type ¶
func (c GuildTextChannelCreate) Type() ChannelType
type GuildTextChannelUpdate ¶
type GuildTextChannelUpdate struct {
Name *string `json:"name,omitempty"`
Type *ChannelType `json:"type,omitempty"`
Position *int `json:"position,omitempty"`
Topic *string `json:"topic,omitempty"`
NSFW *bool `json:"nsfw,omitempty"`
RateLimitPerUser *int `json:"rate_limit_per_user,omitempty"`
PermissionOverwrites *[]PermissionOverwrite `json:"permission_overwrites,omitempty"`
ParentID *snowflake.ID `json:"parent_id,omitempty"`
DefaultAutoArchiveDuration *AutoArchiveDuration `json:"default_auto_archive_duration,omitempty"`
DefaultThreadRateLimitPerUser *int `json:"default_thread_rate_limit_per_user,omitempty"`
}
type GuildThread ¶
type GuildThread struct {
OwnerID snowflake.ID
MessageCount int
TotalMessageSent int
AppliedTags []snowflake.ID
MemberCount int
ThreadMetadata ThreadMetadata
// contains filtered or unexported fields
}
func ApplyGuildIDToThread ¶ added in v0.8.5
func ApplyGuildIDToThread(guildThread GuildThread, guildID snowflake.ID) GuildThread
func (GuildThread) CreatedAt ¶ added in v0.13.17
func (c GuildThread) CreatedAt() time.Time
func (GuildThread) DefaultAutoArchiveDuration ¶ added in v0.8.5
func (c GuildThread) DefaultAutoArchiveDuration() AutoArchiveDuration
DefaultAutoArchiveDuration is always 0 for GuildThread(s) as they do not have their own AutoArchiveDuration.
func (GuildThread) GuildID ¶
func (c GuildThread) GuildID() snowflake.ID
func (GuildThread) ID ¶
func (c GuildThread) ID() snowflake.ID
func (GuildThread) LastMessageID ¶
func (c GuildThread) LastMessageID() *snowflake.ID
func (GuildThread) LastPinTimestamp ¶
func (c GuildThread) LastPinTimestamp() *time.Time
func (GuildThread) MarshalJSON ¶
func (c GuildThread) MarshalJSON() ([]byte, error)
func (GuildThread) Mention ¶
func (c GuildThread) Mention() string
func (GuildThread) NSFW ¶
func (c GuildThread) NSFW() bool
NSFW always returns false for GuildThread(s) as they do not have their own NSFW flag.
func (GuildThread) Name ¶
func (c GuildThread) Name() string
func (GuildThread) ParentID ¶
func (c GuildThread) ParentID() *snowflake.ID
ParentID is never nil for GuildThread(s).
func (GuildThread) PermissionOverwrites ¶
func (c GuildThread) PermissionOverwrites() PermissionOverwrites
PermissionOverwrites always returns nil for GuildThread(s) as they do not have their own PermissionOverwrites.
func (GuildThread) Position ¶
func (c GuildThread) Position() int
Position always returns 0 for GuildThread(s) as they do not have their own position.
func (GuildThread) RateLimitPerUser ¶
func (c GuildThread) RateLimitPerUser() int
func (GuildThread) String ¶
func (c GuildThread) String() string
func (GuildThread) Topic ¶ added in v0.8.5
func (c GuildThread) Topic() *string
Topic always returns nil for GuildThread(s) as they do not have their own topic.
func (GuildThread) Type ¶
func (c GuildThread) Type() ChannelType
func (*GuildThread) UnmarshalJSON ¶
func (c *GuildThread) UnmarshalJSON(data []byte) error
type GuildThreadUpdate ¶
type GuildThreadUpdate struct {
Name *string `json:"name,omitempty"`
Archived *bool `json:"archived,omitempty"`
AutoArchiveDuration *AutoArchiveDuration `json:"auto_archive_duration,omitempty"`
Locked *bool `json:"locked,omitempty"`
Invitable *bool `json:"invitable,omitempty"`
RateLimitPerUser *int `json:"rate_limit_per_user,omitempty"`
}
type GuildUpdate ¶
type GuildUpdate struct {
Name *string `json:"name,omitempty"`
VerificationLevel omit.Omit[*VerificationLevel] `json:"verification_level,omitzero"`
DefaultMessageNotifications omit.Omit[*MessageNotificationsLevel] `json:"default_message_notification,omitzero"`
ExplicitContentFilter omit.Omit[*ExplicitContentFilterLevel] `json:"explicit_content_filter,omitzero"`
AFKChannelID *snowflake.ID `json:"afk_channel_id,omitempty"`
AFKTimeout *int `json:"afk_timeout,omitempty"`
Icon omit.Omit[*Icon] `json:"icon,omitzero"`
Splash omit.Omit[*Icon] `json:"splash,omitzero"`
DiscoverySplash omit.Omit[*Icon] `json:"discovery_splash,omitzero"`
Banner omit.Omit[*Icon] `json:"banner,omitzero"`
SystemChannelID *snowflake.ID `json:"system_channel_id,omitempty"`
SystemChannelFlags *SystemChannelFlags `json:"system_channel_flags,omitempty"`
RulesChannelID *snowflake.ID `json:"rules_channel_id,omitempty"`
PublicUpdatesChannelID *snowflake.ID `json:"public_updates_channel_id,omitempty"`
SafetyAlertsChannelID *snowflake.ID `json:"safety_alerts_channel_id,omitempty"`
PreferredLocale *string `json:"preferred_locale,omitempty"`
Features *[]GuildFeature `json:"features,omitempty"`
Description *string `json:"description,omitempty"`
PremiumProgressBarEnabled *bool `json:"premium_progress_bar_enabled,omitempty"`
}
GuildUpdate is the payload used to update a Guild
type GuildVoiceChannel ¶
type GuildVoiceChannel struct {
UserLimit int
VideoQualityMode VideoQualityMode
// contains filtered or unexported fields
}
func (GuildVoiceChannel) Bitrate ¶
func (c GuildVoiceChannel) Bitrate() int
func (GuildVoiceChannel) CreatedAt ¶ added in v0.13.17
func (c GuildVoiceChannel) CreatedAt() time.Time
func (GuildVoiceChannel) DefaultAutoArchiveDuration ¶ added in v0.12.1
func (c GuildVoiceChannel) DefaultAutoArchiveDuration() AutoArchiveDuration
DefaultAutoArchiveDuration is always 0 for GuildVoiceChannel(s) as they do not have their own AutoArchiveDuration.
func (GuildVoiceChannel) GuildID ¶
func (c GuildVoiceChannel) GuildID() snowflake.ID
func (GuildVoiceChannel) ID ¶
func (c GuildVoiceChannel) ID() snowflake.ID
func (GuildVoiceChannel) LastMessageID ¶ added in v0.12.1
func (c GuildVoiceChannel) LastMessageID() *snowflake.ID
func (GuildVoiceChannel) LastPinTimestamp ¶ added in v0.12.1
func (c GuildVoiceChannel) LastPinTimestamp() *time.Time
LastPinTimestamp always returns nil for GuildVoiceChannel(s) as they cannot have pinned messages.
func (GuildVoiceChannel) MarshalJSON ¶
func (c GuildVoiceChannel) MarshalJSON() ([]byte, error)
func (GuildVoiceChannel) Mention ¶
func (c GuildVoiceChannel) Mention() string
func (GuildVoiceChannel) NSFW ¶ added in v0.12.1
func (c GuildVoiceChannel) NSFW() bool
func (GuildVoiceChannel) Name ¶
func (c GuildVoiceChannel) Name() string
func (GuildVoiceChannel) ParentID ¶
func (c GuildVoiceChannel) ParentID() *snowflake.ID
func (GuildVoiceChannel) PermissionOverwrites ¶
func (c GuildVoiceChannel) PermissionOverwrites() PermissionOverwrites
func (GuildVoiceChannel) Position ¶
func (c GuildVoiceChannel) Position() int
func (GuildVoiceChannel) RTCRegion ¶
func (c GuildVoiceChannel) RTCRegion() string
func (GuildVoiceChannel) RateLimitPerUser ¶ added in v0.13.12
func (c GuildVoiceChannel) RateLimitPerUser() int
func (GuildVoiceChannel) String ¶
func (c GuildVoiceChannel) String() string
func (GuildVoiceChannel) Topic ¶ added in v0.12.1
func (c GuildVoiceChannel) Topic() *string
Topic always returns nil for GuildVoiceChannel(s) as they do not have their own topic.
func (GuildVoiceChannel) Type ¶
func (GuildVoiceChannel) Type() ChannelType
func (*GuildVoiceChannel) UnmarshalJSON ¶
func (c *GuildVoiceChannel) UnmarshalJSON(data []byte) error
type GuildVoiceChannelCreate ¶
type GuildVoiceChannelCreate struct {
Name string `json:"name"`
Bitrate int `json:"bitrate,omitempty"`
UserLimit int `json:"user_limit,omitempty"`
RateLimitPerUser int `json:"rate_limit_per_user,omitempty"`
Position int `json:"position,omitempty"`
PermissionOverwrites []PermissionOverwrite `json:"permission_overwrites,omitempty"`
ParentID snowflake.ID `json:"parent_id,omitempty"`
NSFW bool `json:"nsfw,omitempty"`
RTCRegion string `json:"rtc_region,omitempty"`
VideoQualityMode VideoQualityMode `json:"video_quality_mode,omitempty"`
}
func (GuildVoiceChannelCreate) MarshalJSON ¶
func (c GuildVoiceChannelCreate) MarshalJSON() ([]byte, error)
func (GuildVoiceChannelCreate) Type ¶
func (c GuildVoiceChannelCreate) Type() ChannelType
type GuildVoiceChannelUpdate ¶
type GuildVoiceChannelUpdate struct {
Name *string `json:"name,omitempty"`
Position *int `json:"position,omitempty"`
RateLimitPerUser *int `json:"rate_limit_per_user,omitempty"`
Bitrate *int `json:"bitrate,omitempty"`
UserLimit *int `json:"user_limit,omitempty"`
PermissionOverwrites *[]PermissionOverwrite `json:"permission_overwrites,omitempty"`
ParentID *snowflake.ID `json:"parent_id,omitempty"`
RTCRegion *string `json:"rtc_region,omitempty"`
NSFW *bool `json:"nsfw,omitempty"`
VideoQualityMode *VideoQualityMode `json:"video_quality_mode,omitempty"`
}
type GuildWelcomeChannel ¶
type GuildWelcomeChannel struct {
ChannelID snowflake.ID `json:"channel_id"`
Description string `json:"description"`
EmojiID *snowflake.ID `json:"emoji_id,omitempty"`
EmojiName *string `json:"emoji_name,omitempty"`
}
GuildWelcomeChannel is one of the channels in a GuildWelcomeScreen
type GuildWelcomeScreen ¶ added in v0.14.1
type GuildWelcomeScreen struct {
Description *string `json:"description,omitempty"`
WelcomeChannels []GuildWelcomeChannel `json:"welcome_channels"`
}
GuildWelcomeScreen is the Welcome Screen of a Guild
type GuildWelcomeScreenUpdate ¶ added in v0.14.1
type GuildWelcomeScreenUpdate struct {
Enabled *bool `json:"enabled,omitempty"`
WelcomeChannels *[]GuildWelcomeChannel `json:"welcome_channels,omitempty"`
Description *string `json:"description,omitempty"`
}
GuildWelcomeScreenUpdate is used to update the GuildWelcomeScreen of a Guild
type IncomingWebhook ¶
type IncomingWebhook struct {
ChannelID snowflake.ID `json:"channel_id"`
GuildID snowflake.ID `json:"guild_id"`
Token string `json:"token"`
ApplicationID *snowflake.ID `json:"application_id"`
User User `json:"user"`
// contains filtered or unexported fields
}
func (IncomingWebhook) Avatar ¶
func (w IncomingWebhook) Avatar() *string
func (IncomingWebhook) AvatarURL ¶
func (w IncomingWebhook) AvatarURL(opts ...CDNOpt) *string
func (IncomingWebhook) CreatedAt ¶ added in v0.13.17
func (w IncomingWebhook) CreatedAt() time.Time
func (IncomingWebhook) DefaultAvatarURL ¶
func (w IncomingWebhook) DefaultAvatarURL(opts ...CDNOpt) string
func (IncomingWebhook) EffectiveAvatarURL ¶
func (w IncomingWebhook) EffectiveAvatarURL(opts ...CDNOpt) string
func (IncomingWebhook) ID ¶
func (w IncomingWebhook) ID() snowflake.ID
func (IncomingWebhook) MarshalJSON ¶
func (w IncomingWebhook) MarshalJSON() ([]byte, error)
func (IncomingWebhook) Name ¶
func (w IncomingWebhook) Name() string
func (IncomingWebhook) Type ¶
func (IncomingWebhook) Type() WebhookType
func (IncomingWebhook) URL ¶
func (w IncomingWebhook) URL() string
func (*IncomingWebhook) UnmarshalJSON ¶
func (w *IncomingWebhook) UnmarshalJSON(data []byte) error
type InstallParams ¶ added in v0.14.1
type InstallParams struct {
Scopes []OAuth2Scope `json:"scopes"`
Permissions Permissions `json:"permissions"`
}
type Integration ¶
type Integration interface {
json.Marshaler
Type() IntegrationType
ID() snowflake.ID
CreatedAt() time.Time
}
Integration (https://discord.com/developers/docs/resources/guild#integration-object)
type IntegrationAccount ¶
IntegrationAccount (https://discord.com/developers/docs/resources/guild#integration-account-object)
type IntegrationApplication ¶
type IntegrationApplication struct {
ID snowflake.ID `json:"id"`
Name string `json:"name"`
Icon string `json:"icon"`
Description string `json:"description"`
Summary string `json:"summary"`
Client User `json:"bot"`
}
IntegrationApplication (https://discord.com/developers/docs/resources/guild#integration-application-object)
type IntegrationExpireBehavior ¶ added in v0.15.0
type IntegrationExpireBehavior int
const ( IntegrationExpireBehaviorRemoveRole IntegrationExpireBehavior = iota IntegrationExpireBehaviorKick )
type IntegrationType ¶
type IntegrationType string
IntegrationType the type of Integration
const ( IntegrationTypeTwitch IntegrationType = "twitch" IntegrationTypeYouTube IntegrationType = "youtube" IntegrationTypeBot IntegrationType = "discord" IntegrationTypeGuildSubscription IntegrationType = "guild_subscription" )
All IntegrationType(s)
type Interaction ¶
type Interaction interface {
Type() InteractionType
ID() snowflake.ID
ApplicationID() snowflake.ID
Token() string
Version() int
PartialGuild() *InteractionGuild
GuildID() *snowflake.ID
Channel() InteractionChannel
Locale() Locale
GuildLocale() *Locale
Member() *ResolvedMember
User() User
AppPermissions() *Permissions
Entitlements() []Entitlement
AuthorizingIntegrationOwners() map[ApplicationIntegrationType]snowflake.ID
Context() InteractionContextType
AttachmentSizeLimit() int
CreatedAt() time.Time
// contains filtered or unexported methods
}
Interaction is used for easier unmarshalling of different Interaction(s)
func UnmarshalInteraction ¶
func UnmarshalInteraction(data []byte) (Interaction, error)
type InteractionCallback ¶ added in v0.18.11
type InteractionCallback struct {
ID snowflake.ID `json:"id"`
Type InteractionType `json:"type"`
ActivityInstanceID string `json:"activity_instance_id"`
ResponseMessageID snowflake.ID `json:"response_message_id"`
ResponseMessageLoading bool `json:"response_message_loading"`
ResponseMessageEphemeral bool `json:"response_message_ephemeral"`
}
type InteractionCallbackActivityInstance ¶ added in v0.18.11
type InteractionCallbackActivityInstance struct {
ID string `json:"id"`
}
type InteractionCallbackResource ¶ added in v0.18.11
type InteractionCallbackResource struct {
Type InteractionResponseType `json:"type"`
ActivityInstance *InteractionCallbackActivityInstance `json:"activity_instance"`
Message *Message `json:"message"`
}
type InteractionCallbackResponse ¶ added in v0.18.11
type InteractionCallbackResponse struct {
Interaction InteractionCallback `json:"interaction"`
Resource *InteractionCallbackResource `json:"resource"`
}
type InteractionChannel ¶ added in v0.16.5
type InteractionChannel struct {
MessageChannel
Permissions Permissions `json:"permissions"`
}
func (InteractionChannel) MarshalJSON ¶ added in v0.16.5
func (c InteractionChannel) MarshalJSON() ([]byte, error)
func (*InteractionChannel) UnmarshalJSON ¶ added in v0.16.5
func (c *InteractionChannel) UnmarshalJSON(data []byte) error
type InteractionContextType ¶ added in v0.18.0
type InteractionContextType int
const ( InteractionContextTypeGuild InteractionContextType = iota InteractionContextTypeBotDM InteractionContextTypePrivateChannel )
type InteractionGuild ¶ added in v0.18.6
type InteractionGuild struct {
ID snowflake.ID `json:"id"`
Locale Locale `json:"locale"`
Features []GuildFeature `json:"features"`
}
type InteractionMetadata ¶ added in v0.18.0
type InteractionMetadata struct {
ID snowflake.ID `json:"id"`
Type InteractionType `json:"type"`
User User `json:"user"`
AuthorizingIntegrationOwners map[ApplicationIntegrationType]snowflake.ID `json:"authorizing_integration_owners"`
OriginalResponseMessageID *snowflake.ID `json:"original_response_message_id"`
// This field will only be present for application command interactions of ApplicationCommandTypeUser.
// See https://discord.com/developers/docs/resources/message#message-interaction-metadata-object-application-command-interaction-metadata-structure
TargetUser *User `json:"target_user"`
// This field will only be present for application command interactions of ApplicationCommandTypeMessage.
// See https://discord.com/developers/docs/resources/message#message-interaction-metadata-object-application-command-interaction-metadata-structure
TargetMessageID *snowflake.ID `json:"target_message_id"`
// This field will only be present for InteractionTypeComponent interactions.
// See https://discord.com/developers/docs/resources/message#message-interaction-metadata-object-message-component-interaction-metadata-structure
InteractedMessageID *snowflake.ID `json:"interacted_message_id"`
// This field will only be present for InteractionTypeModalSubmit interactions.
// See https://discord.com/developers/docs/resources/message#message-interaction-metadata-object-modal-submit-interaction-metadata-structure
TriggeringInteractionMetadata *InteractionMetadata `json:"triggering_interaction_metadata"`
}
type InteractionResponse ¶
type InteractionResponse struct {
Type InteractionResponseType `json:"type"`
Data InteractionResponseData `json:"data,omitempty"`
}
InteractionResponse is how you answer interactions. If an answer is not sent within 3 seconds of receiving it, the interaction is failed, and you will be unable to respond to it.
func (InteractionResponse) ToBody ¶
func (r InteractionResponse) ToBody() (any, error)
ToBody returns the InteractionResponse ready for body
type InteractionResponseCreator ¶
type InteractionResponseCreator interface {
ToResponseBody(response InteractionResponse) (any, error)
}
type InteractionResponseData ¶ added in v0.12.6
type InteractionResponseData interface {
// contains filtered or unexported methods
}
type InteractionResponseType ¶ added in v0.12.6
type InteractionResponseType int
InteractionResponseType indicates the type of slash command response, whether it's responding immediately or deferring to edit your response later
const ( InteractionResponseTypePong InteractionResponseType = iota + 1 InteractionResponseTypeCreateMessage InteractionResponseTypeDeferredCreateMessage InteractionResponseTypeDeferredUpdateMessage InteractionResponseTypeUpdateMessage InteractionResponseTypeAutocompleteResult InteractionResponseTypeModal InteractionResponseTypeLaunchActivity )
Constants for the InteractionResponseType(s)
const InteractionResponseTypeAcknowledge InteractionResponseType = -1
InteractionResponseTypeAcknowledge is stricly internal and will never be sent to discord.
It is used to indicate that the HTTP response should be 202 Accepted
type InteractionType ¶
type InteractionType int
InteractionType is the type of Interaction
const ( InteractionTypePing InteractionType = iota + 1 InteractionTypeApplicationCommand InteractionTypeComponent InteractionTypeAutocomplete InteractionTypeModalSubmit )
Supported InteractionType(s)
type InteractiveComponent ¶
type InteractiveComponent interface {
Component
// GetCustomID returns the customID of the Component. This can be used to identify or transport data with the Component.
GetCustomID() string
// contains filtered or unexported methods
}
InteractiveComponent is an interface for all components that can be present in an ActionRowComponent. ButtonComponent StringSelectMenuComponent TextInputComponent (only supported in modals) UserSelectMenuComponent RoleSelectMenuComponent MentionableSelectMenuComponent ChannelSelectMenuComponent ButtonComponent SelectMenuComponent FileUploadComponent RadioGroupComponent (only supported in modals) CheckboxGroupComponent (only supported in modals) CheckboxComponent (only supported in modals) UnknownComponent
type Invite ¶
type Invite struct {
Type InviteType `json:"type"`
Code string `json:"code"`
Guild *InviteGuild `json:"guild"`
Channel *InviteChannel `json:"channel"`
Inviter *User `json:"inviter"`
TargetUser *User `json:"target_user"`
TargetType InviteTargetType `json:"target_user_type"`
ApproximatePresenceCount int `json:"approximate_presence_count"`
ApproximateMemberCount int `json:"approximate_member_count"`
ExpiresAt *time.Time `json:"expires_at"`
GuildScheduledEvent *GuildScheduledEvent `json:"guild_scheduled_event"`
Flags InviteFlags `json:"flags"`
Roles []Role `json:"roles"`
}
Invite is a partial invite struct
type InviteChannel ¶
type InviteChannel struct {
ID snowflake.ID `json:"id"`
Type ChannelType `json:"type"`
Name string `json:"name"`
Icon *string `json:"icon,omitempty"`
}
func (InviteChannel) IconURL ¶
func (c InviteChannel) IconURL(opts ...CDNOpt) *string
IconURL returns the Icon URL of this channel. This will be nil for every ChannelType except ChannelTypeGroupDM
type InviteCreate ¶
type InviteCreate struct {
MaxAge *int `json:"max_age,omitempty"`
MaxUses *int `json:"max_uses,omitempty"`
Temporary bool `json:"temporary,omitempty"`
Unique bool `json:"unique,omitempty"`
TargetType InviteTargetType `json:"target_type,omitempty"`
TargetUserID snowflake.ID `json:"target_user_id,omitempty"`
TargetApplicationID snowflake.ID `json:"target_application_id,omitempty"`
TargetUserIDs []snowflake.ID `json:"-"`
RoleIDs []snowflake.ID `json:"role_ids,omitempty"`
}
func (InviteCreate) ToBody ¶ added in v0.19.0
func (i InviteCreate) ToBody() (any, error)
ToBody returns the InviteCreate ready for body
type InviteFlags ¶ added in v0.19.0
type InviteFlags int
const ( InviteFlagIsGuestInvite InviteFlags = 1 << iota InviteFlagsNone InviteFlags = 0 )
type InviteGuild ¶
type InviteGuild struct {
ID snowflake.ID `json:"id"`
Name string `json:"name"`
Splash *string `json:"splash"`
Banner *string `json:"banner"`
Description *string `json:"description"`
Icon *string `json:"icon"`
Features []GuildFeature `json:"features"`
VerificationLevel VerificationLevel `json:"verification_level"`
VanityURLCode *string `json:"vanity_url_code"`
}
An InviteGuild is the Guild of an Invite
func (InviteGuild) IconURL ¶ added in v0.18.16
func (g InviteGuild) IconURL(opts ...CDNOpt) *string
func (InviteGuild) SplashURL ¶ added in v0.18.16
func (g InviteGuild) SplashURL(opts ...CDNOpt) *string
type InviteTargetType ¶
type InviteTargetType int
InviteTargetType is type of target an Invite uses
const ( InviteTargetTypeStream InviteTargetType = iota + 1 InviteTargetTypeEmbeddedApplication InviteTargetTypeRoleSubscriptionsPurchase )
Constants for TargetType
type InviteTargetUsersUpdate ¶ added in v0.19.0
func (InviteTargetUsersUpdate) ToBody ¶ added in v0.19.0
func (i InviteTargetUsersUpdate) ToBody() (any, error)
ToBody returns the InviteTargetUsersUpdate ready for body
type InviteType ¶ added in v0.18.6
type InviteType int
const ( InviteTypeGuild InviteType = iota InviteTypeGroupDM InviteTypeFriend )
type LabelComponent ¶ added in v0.19.0
type LabelComponent struct {
ID int `json:"id,omitempty"`
Label string `json:"label"`
Description string `json:"description,omitempty"`
Component LabelSubComponent `json:"component"`
}
LabelComponent is a component that displays a label with an optional description and subcomponent. Only supported in ModalCreate.
func NewLabel ¶ added in v0.19.0
func NewLabel(label string, component LabelSubComponent) LabelComponent
NewLabel creates a new LabelComponent with the provided label and subcomponent.
func (LabelComponent) GetID ¶ added in v0.19.0
func (c LabelComponent) GetID() int
func (LabelComponent) MarshalJSON ¶ added in v0.19.0
func (c LabelComponent) MarshalJSON() ([]byte, error)
func (LabelComponent) SubComponents ¶ added in v0.19.0
func (c LabelComponent) SubComponents() iter.Seq[Component]
SubComponents returns an [iter.Seq[Component]] over the sub Component of the LabelComponent.
func (LabelComponent) Type ¶ added in v0.19.0
func (LabelComponent) Type() ComponentType
func (*LabelComponent) UnmarshalJSON ¶ added in v0.19.0
func (c *LabelComponent) UnmarshalJSON(data []byte) error
func (LabelComponent) WithComponent ¶ added in v0.19.0
func (c LabelComponent) WithComponent(component LabelSubComponent) LabelComponent
WithComponent returns a new LabelComponent with the provided subcomponent
func (LabelComponent) WithDescription ¶ added in v0.19.0
func (c LabelComponent) WithDescription(description string) LabelComponent
WithDescription returns a new LabelComponent with the provided description
func (LabelComponent) WithID ¶ added in v0.19.0
func (c LabelComponent) WithID(id int) LabelComponent
func (LabelComponent) WithLabel ¶ added in v0.19.0
func (c LabelComponent) WithLabel(label string) LabelComponent
WithLabel returns a new LabelComponent with the provided label
type LabelSubComponent ¶ added in v0.19.0
type LabelSubComponent interface {
Component
// contains filtered or unexported methods
}
LabelSubComponent is an interface for all components that can be present in a LabelComponent. StringSelectMenuComponent TextInputComponent UserSelectMenuComponent RoleSelectMenuComponent MentionableSelectMenuComponent ChannelSelectMenuComponent FileUploadComponent RadioGroupComponent (only supported in modals) CheckboxGroupComponent (only supported in modals) CheckboxComponent (only supported in modals) UnknownComponent
type LayoutComponent ¶ added in v0.19.0
type LayoutComponent interface {
Component
// contains filtered or unexported methods
}
LayoutComponent is an interface for all components that can be present as a top level component in a Message. ActionRowComponent SectionComponent TextDisplayComponent MediaGalleryComponent FileComponent SeparatorComponent ContainerComponent LabelComponent (only supported in modals) UnknownComponent
type Locale ¶
type Locale string
const ( LocaleEnglishUS Locale = "en-US" LocaleEnglishGB Locale = "en-GB" LocaleBulgarian Locale = "bg" LocaleChineseCN Locale = "zh-CN" LocaleChineseTW Locale = "zh-TW" LocaleCroatian Locale = "hr" LocaleCzech Locale = "cs" LocaleDanish Locale = "da" LocaleDutch Locale = "nl" LocaleFinnish Locale = "fi" LocaleFrench Locale = "fr" LocaleGerman Locale = "de" LocaleGreek Locale = "el" LocaleHindi Locale = "hi" LocaleHungarian Locale = "hu" LocaleIndonesian Locale = "id" LocaleItalian Locale = "it" LocaleJapanese Locale = "ja" LocaleKorean Locale = "ko" LocaleLithuanian Locale = "lt" LocaleNorwegian Locale = "no" LocalePolish Locale = "pl" LocalePortugueseBR Locale = "pt-BR" LocaleRomanian Locale = "ro" LocaleRussian Locale = "ru" LocaleSpanishES Locale = "es-ES" LocaleSwedish Locale = "sv-SE" LocaleThai Locale = "th" LocaleTurkish Locale = "tr" LocaleUkrainian Locale = "uk" LocaleVietnamese Locale = "vi" LocaleUnknown Locale = "" )
type MediaGalleryComponent ¶ added in v0.19.0
type MediaGalleryComponent struct {
ID int `json:"id,omitempty"`
Items []MediaGalleryItem `json:"items"`
}
MediaGalleryComponent is a component that displays a gallery of media.
func NewMediaGallery ¶ added in v0.19.0
func NewMediaGallery(items ...MediaGalleryItem) MediaGalleryComponent
NewMediaGallery creates a new MediaGalleryComponent with the provided items.
func (MediaGalleryComponent) GetID ¶ added in v0.19.0
func (c MediaGalleryComponent) GetID() int
func (MediaGalleryComponent) MarshalJSON ¶ added in v0.19.0
func (c MediaGalleryComponent) MarshalJSON() ([]byte, error)
func (MediaGalleryComponent) Type ¶ added in v0.19.0
func (MediaGalleryComponent) Type() ComponentType
func (MediaGalleryComponent) WithID ¶ added in v0.19.0
func (c MediaGalleryComponent) WithID(id int) MediaGalleryComponent
WithID returns a new MediaGalleryComponent with the provided id
func (MediaGalleryComponent) WithItems ¶ added in v0.19.0
func (c MediaGalleryComponent) WithItems(items ...MediaGalleryItem) MediaGalleryComponent
WithItems returns a new MediaGalleryComponent with the provided items
type MediaGalleryItem ¶ added in v0.19.0
type MediaGalleryItem struct {
Media UnfurledMediaItem `json:"media"`
Description string `json:"description,omitempty"`
Spoiler bool `json:"spoiler,omitempty"`
}
type Member ¶
type Member struct {
User User `json:"user"`
Nick *string `json:"nick"`
Avatar *string `json:"avatar"`
Banner *string `json:"banner"`
RoleIDs []snowflake.ID `json:"roles,omitempty"`
JoinedAt *time.Time `json:"joined_at"`
PremiumSince *time.Time `json:"premium_since,omitempty"`
Deaf bool `json:"deaf,omitempty"`
Mute bool `json:"mute,omitempty"`
Flags MemberFlags `json:"flags"`
Pending bool `json:"pending"`
CommunicationDisabledUntil *time.Time `json:"communication_disabled_until"`
AvatarDecorationData *AvatarDecorationData `json:"avatar_decoration_data"`
// This field is not present everywhere in the API and often populated by disgo
GuildID snowflake.ID `json:"guild_id"`
}
Member is a discord GuildMember
func (Member) AvatarDecorationURL ¶ added in v0.18.0
AvatarDecorationURL returns the avatar decoration URL if set or nil
func (Member) BannerURL ¶ added in v0.18.9
BannerURL returns the guild-specific banner URL of the user if set or nil
func (Member) EffectiveAvatarURL ¶
EffectiveAvatarURL returns the guild-specific avatar URL of the user if set, falling back to the effective avatar URL of the user
func (Member) EffectiveBannerURL ¶ added in v0.18.9
EffectiveBannerURL returns the guild-specific banner URL of the user if set, falling back to the banner URL of the user
func (Member) EffectiveName ¶
EffectiveName returns the nickname of the member if set, falling back to User.EffectiveName()
type MemberAdd ¶
type MemberAdd struct {
AccessToken string `json:"access_token"`
Nick string `json:"nick,omitempty"`
Roles []snowflake.ID `json:"roles,omitempty"`
Mute bool `json:"mute,omitempty"`
Deaf bool `json:"deaf,omitempty"`
}
MemberAdd is used to add a member via the oauth2 access token to a guild
type MemberFlags ¶ added in v0.15.0
type MemberFlags int
const ( MemberFlagDidRejoin MemberFlags = 1 << iota MemberFlagCompletedOnboarding MemberFlagBypassesVerification MemberFlagStartedOnboarding MemberFlagIsGuest MemberFlagStartedHomeActions MemberFlagCompletedHomeActions MemberFlagAutomodQuarantinedUsername MemberFlagDMSettingsUpsellAcknowledged MemberFlagAutomodQuarantinedGuildTag MemberFlagsNone MemberFlags = 0 )
func (MemberFlags) Add ¶ added in v0.15.0
func (f MemberFlags) Add(bits ...MemberFlags) MemberFlags
Add allows you to add multiple bits together, producing a new bit
func (MemberFlags) Has ¶ added in v0.15.0
func (f MemberFlags) Has(bits ...MemberFlags) bool
Has will ensure that the bit includes all the bits entered
func (MemberFlags) Missing ¶ added in v0.15.0
func (f MemberFlags) Missing(bits ...MemberFlags) bool
Missing will check whether the bit is missing any one of the bits
func (MemberFlags) Remove ¶ added in v0.15.0
func (f MemberFlags) Remove(bits ...MemberFlags) MemberFlags
Remove allows you to subtract multiple bits from the first, producing a new bit
type MemberPermissionOverwrite ¶
type MemberPermissionOverwrite struct {
UserID snowflake.ID `json:"id"`
Allow Permissions `json:"allow"`
Deny Permissions `json:"deny"`
}
func (MemberPermissionOverwrite) ID ¶
func (o MemberPermissionOverwrite) ID() snowflake.ID
func (MemberPermissionOverwrite) MarshalJSON ¶
func (o MemberPermissionOverwrite) MarshalJSON() ([]byte, error)
func (MemberPermissionOverwrite) Type ¶
func (o MemberPermissionOverwrite) Type() PermissionOverwriteType
type MemberPermissionOverwriteUpdate ¶
type MemberPermissionOverwriteUpdate struct {
Allow *Permissions `json:"allow,omitempty"`
Deny *Permissions `json:"deny,omitempty"`
}
func (MemberPermissionOverwriteUpdate) MarshalJSON ¶
func (u MemberPermissionOverwriteUpdate) MarshalJSON() ([]byte, error)
func (MemberPermissionOverwriteUpdate) Type ¶
func (MemberPermissionOverwriteUpdate) Type() PermissionOverwriteType
type MemberUpdate ¶
type MemberUpdate struct {
ChannelID *snowflake.ID `json:"channel_id,omitempty"`
Nick *string `json:"nick,omitempty"`
Roles *[]snowflake.ID `json:"roles,omitempty"`
Mute *bool `json:"mute,omitempty"`
Deaf *bool `json:"deaf,omitempty"`
Flags *MemberFlags `json:"flags,omitempty"`
CommunicationDisabledUntil omit.Omit[*time.Time] `json:"communication_disabled_until,omitzero"`
}
MemberUpdate is used to modify a member
type MembershipState ¶
type MembershipState int
const ( MembershipStateInvited MembershipState = iota + 1 MembershipStateAccepted )
type MentionChannel ¶ added in v0.17.1
type MentionType ¶
type Mentionable ¶
type MentionableSelectMenuComponent ¶ added in v0.14.0
type MentionableSelectMenuComponent struct {
ID int `json:"id,omitempty"`
CustomID string `json:"custom_id"`
Placeholder string `json:"placeholder,omitempty"`
DefaultValues []SelectMenuDefaultValue `json:"default_values,omitempty"`
MinValues *int `json:"min_values,omitempty"`
MaxValues int `json:"max_values,omitempty"`
// Required Indicates if the select menu is required to submit the Modal.
Required bool `json:"required"`
// Disabled whether the select menu is disabled (only supported in messages)
Disabled bool `json:"disabled"`
// Values is only set when the MentionableSelectMenuComponent is received from an InteractionTypeModalSubmit
Values []snowflake.ID `json:"values,omitempty"`
}
func NewMentionableSelectMenu ¶ added in v0.14.0
func NewMentionableSelectMenu(customID string, placeholder string) MentionableSelectMenuComponent
NewMentionableSelectMenu builds a new SelectMenuComponent from the provided values
func (MentionableSelectMenuComponent) AddDefaultValue ¶ added in v0.16.10
func (c MentionableSelectMenuComponent) AddDefaultValue(value SelectMenuDefaultValue) MentionableSelectMenuComponent
AddDefaultValue returns a new MentionableSelectMenuComponent with the provided default value added. SelectMenuDefaultValue can easily be constructed using helpers like NewSelectMenuDefaultUser or NewSelectMenuDefaultRole
func (MentionableSelectMenuComponent) AsDisabled ¶ added in v0.14.0
func (c MentionableSelectMenuComponent) AsDisabled() MentionableSelectMenuComponent
AsDisabled returns a new MentionableSelectMenuComponent but disabled
func (MentionableSelectMenuComponent) AsEnabled ¶ added in v0.14.0
func (c MentionableSelectMenuComponent) AsEnabled() MentionableSelectMenuComponent
AsEnabled returns a new MentionableSelectMenuComponent but enabled
func (MentionableSelectMenuComponent) GetCustomID ¶ added in v0.19.0
func (c MentionableSelectMenuComponent) GetCustomID() string
func (MentionableSelectMenuComponent) GetID ¶ added in v0.19.0
func (c MentionableSelectMenuComponent) GetID() int
func (MentionableSelectMenuComponent) MarshalJSON ¶ added in v0.14.0
func (c MentionableSelectMenuComponent) MarshalJSON() ([]byte, error)
func (MentionableSelectMenuComponent) RemoveDefaultValue ¶ added in v0.16.10
func (c MentionableSelectMenuComponent) RemoveDefaultValue(index int) MentionableSelectMenuComponent
RemoveDefaultValue returns a new MentionableSelectMenuComponent with the provided default value at the index removed
func (MentionableSelectMenuComponent) SetDefaultValues ¶ added in v0.16.10
func (c MentionableSelectMenuComponent) SetDefaultValues(defaultValues ...SelectMenuDefaultValue) MentionableSelectMenuComponent
SetDefaultValues returns a new MentionableSelectMenuComponent with the provided default values
func (MentionableSelectMenuComponent) Type ¶ added in v0.14.0
func (MentionableSelectMenuComponent) Type() ComponentType
func (MentionableSelectMenuComponent) WithCustomID ¶ added in v0.14.0
func (c MentionableSelectMenuComponent) WithCustomID(customID string) MentionableSelectMenuComponent
WithCustomID returns a new MentionableSelectMenuComponent with the provided customID
func (MentionableSelectMenuComponent) WithDisabled ¶ added in v0.14.0
func (c MentionableSelectMenuComponent) WithDisabled(disabled bool) MentionableSelectMenuComponent
WithDisabled returns a new MentionableSelectMenuComponent with the provided disabled
func (MentionableSelectMenuComponent) WithID ¶ added in v0.19.0
func (c MentionableSelectMenuComponent) WithID(id int) MentionableSelectMenuComponent
WithID returns a new MentionableSelectMenuComponent with the provided ID
func (MentionableSelectMenuComponent) WithMaxValues ¶ added in v0.14.0
func (c MentionableSelectMenuComponent) WithMaxValues(maxValue int) MentionableSelectMenuComponent
WithMaxValues returns a new MentionableSelectMenuComponent with the provided maxValue
func (MentionableSelectMenuComponent) WithMinValues ¶ added in v0.14.0
func (c MentionableSelectMenuComponent) WithMinValues(minValue int) MentionableSelectMenuComponent
WithMinValues returns a new MentionableSelectMenuComponent with the provided minValue
func (MentionableSelectMenuComponent) WithPlaceholder ¶ added in v0.14.0
func (c MentionableSelectMenuComponent) WithPlaceholder(placeholder string) MentionableSelectMenuComponent
WithPlaceholder returns a new MentionableSelectMenuComponent with the provided placeholder
func (MentionableSelectMenuComponent) WithRequired ¶ added in v0.19.0
func (c MentionableSelectMenuComponent) WithRequired(required bool) MentionableSelectMenuComponent
WithRequired returns a new MentionableSelectMenuComponent with the provided required value
type MentionableSelectMenuInteractionData ¶ added in v0.14.0
type MentionableSelectMenuInteractionData struct {
Resolved MentionableSelectMenuResolved `json:"resolved"`
Values []snowflake.ID `json:"values"`
// contains filtered or unexported fields
}
func (MentionableSelectMenuInteractionData) CustomID ¶ added in v0.14.0
func (d MentionableSelectMenuInteractionData) CustomID() string
func (MentionableSelectMenuInteractionData) MarshalJSON ¶ added in v0.14.0
func (d MentionableSelectMenuInteractionData) MarshalJSON() ([]byte, error)
func (MentionableSelectMenuInteractionData) Members ¶ added in v0.14.0
func (d MentionableSelectMenuInteractionData) Members() []ResolvedMember
func (MentionableSelectMenuInteractionData) Roles ¶ added in v0.14.0
func (d MentionableSelectMenuInteractionData) Roles() []Role
func (MentionableSelectMenuInteractionData) Type ¶ added in v0.14.0
func (MentionableSelectMenuInteractionData) Type() ComponentType
func (*MentionableSelectMenuInteractionData) UnmarshalJSON ¶ added in v0.14.0
func (d *MentionableSelectMenuInteractionData) UnmarshalJSON(data []byte) error
func (MentionableSelectMenuInteractionData) Users ¶ added in v0.14.0
func (d MentionableSelectMenuInteractionData) Users() []User
type MentionableSelectMenuResolved ¶ added in v0.14.0
type MentionableValue ¶ added in v0.19.0
type MentionableValue interface {
// contains filtered or unexported methods
}
MentionableValue is an interface for all values a MentionableSelectMenuComponent can return. User ResolvedMember Role ResolvedChannel
type Message ¶
type Message struct {
ID snowflake.ID `json:"id"`
GuildID *snowflake.ID `json:"guild_id"`
Reactions []MessageReaction `json:"reactions"`
Attachments []Attachment `json:"attachments"`
TTS bool `json:"tts"`
Embeds []Embed `json:"embeds,omitempty"`
Components []LayoutComponent `json:"components,omitempty"`
CreatedAt time.Time `json:"timestamp"`
Mentions []User `json:"mentions"`
MentionEveryone bool `json:"mention_everyone"`
MentionRoles []snowflake.ID `json:"mention_roles"`
MentionChannels []MentionChannel `json:"mention_channels"`
Pinned bool `json:"pinned"`
EditedTimestamp *time.Time `json:"edited_timestamp"`
Author User `json:"author"`
Member *Member `json:"member"`
Content string `json:"content,omitempty"`
ChannelID snowflake.ID `json:"channel_id"`
Type MessageType `json:"type"`
Flags MessageFlags `json:"flags"`
MessageReference *MessageReference `json:"message_reference,omitempty"`
MessageSnapshots []MessageSnapshot `json:"message_snapshots,omitempty"`
Interaction *MessageInteraction `json:"interaction,omitempty"`
WebhookID *snowflake.ID `json:"webhook_id,omitempty"`
Activity *MessageActivity `json:"activity,omitempty"`
Application *MessageApplication `json:"application,omitempty"`
ApplicationID *snowflake.ID `json:"application_id,omitempty"`
StickerItems []MessageSticker `json:"sticker_items,omitempty"`
ReferencedMessage *Message `json:"referenced_message,omitempty"`
LastUpdated *time.Time `json:"last_updated,omitempty"`
Thread *MessageThread `json:"thread,omitempty"`
Position *int `json:"position,omitempty"`
RoleSubscriptionData *RoleSubscriptionData `json:"role_subscription_data,omitempty"`
InteractionMetadata *InteractionMetadata `json:"interaction_metadata,omitempty"`
Resolved *ResolvedData `json:"resolved,omitempty"`
Poll *Poll `json:"poll,omitempty"`
Call *MessageCall `json:"call,omitempty"`
Nonce Nonce `json:"nonce,omitempty"`
}
Message is a struct for messages sent in discord text-based channels
func (Message) AllComponents ¶ added in v0.19.0
AllComponents returns an iter.Seq of all components in the message.
func (Message) JumpURL ¶ added in v0.13.19
JumpURL returns the URL which can be used to jump to the message in the discord client.
func (*Message) UnmarshalJSON ¶
type MessageActivity ¶
type MessageActivity struct {
Type MessageActivityType `json:"type"`
PartyID *string `json:"party_id,omitempty"`
}
MessageActivity is used for rich presence-related chat embeds in a Message
type MessageActivityType ¶
type MessageActivityType int
MessageActivityType is the type of MessageActivity https://discord.com/developers/docs/resources/message#message-object-message-activity-types
const ( MessageActivityTypeJoin MessageActivityType = iota + 1 MessageActivityTypeSpectate MessageActivityTypeListen MessageActivityTypeJoinRequest )
Constants for MessageActivityType
type MessageApplication ¶
type MessageApplication struct {
ID snowflake.ID `json:"id"`
CoverImage *string `json:"cover_image,omitempty"`
Description string `json:"description"`
Icon *string `json:"icon,omitempty"`
Name string `json:"name"`
}
MessageApplication is used for rich presence-related chat embeds in a Message
type MessageBulkDelete ¶
type MessageCall ¶ added in v0.18.6
type MessageChannel ¶
type MessageChannel interface {
Channel
// LastMessageID returns the ID of the last Message sent in this MessageChannel.
// This is nil if no Message has been sent yet.
LastMessageID() *snowflake.ID
// LastPinTimestamp returns when the last Message in this MessageChannel was pinned.
// This is nil if no Message has been pinned yet.
LastPinTimestamp() *time.Time
// contains filtered or unexported methods
}
type MessageCommand ¶
type MessageCommand struct {
// contains filtered or unexported fields
}
func (MessageCommand) ApplicationID ¶
func (c MessageCommand) ApplicationID() snowflake.ID
func (MessageCommand) Contexts ¶ added in v0.18.0
func (c MessageCommand) Contexts() []InteractionContextType
func (MessageCommand) CreatedAt ¶ added in v0.13.17
func (c MessageCommand) CreatedAt() time.Time
func (MessageCommand) DMPermission ¶ added in v0.10.2
func (c MessageCommand) DMPermission() bool
func (MessageCommand) DefaultMemberPermissions ¶ added in v0.10.2
func (c MessageCommand) DefaultMemberPermissions() Permissions
func (MessageCommand) GuildID ¶
func (c MessageCommand) GuildID() *snowflake.ID
func (MessageCommand) ID ¶
func (c MessageCommand) ID() snowflake.ID
func (MessageCommand) IntegrationTypes ¶ added in v0.18.0
func (c MessageCommand) IntegrationTypes() []ApplicationIntegrationType
func (MessageCommand) MarshalJSON ¶
func (c MessageCommand) MarshalJSON() ([]byte, error)
func (MessageCommand) NSFW ¶ added in v0.14.0
func (c MessageCommand) NSFW() bool
func (MessageCommand) Name ¶
func (c MessageCommand) Name() string
func (MessageCommand) NameLocalizations ¶
func (c MessageCommand) NameLocalizations() map[Locale]string
func (MessageCommand) NameLocalized ¶
func (c MessageCommand) NameLocalized() string
func (MessageCommand) Type ¶
func (MessageCommand) Type() ApplicationCommandType
func (*MessageCommand) UnmarshalJSON ¶
func (c *MessageCommand) UnmarshalJSON(data []byte) error
func (MessageCommand) Version ¶
func (c MessageCommand) Version() snowflake.ID
type MessageCommandCreate ¶
type MessageCommandCreate struct {
Name string `json:"name"`
NameLocalizations map[Locale]string `json:"name_localizations,omitempty"`
DefaultMemberPermissions omit.Omit[*Permissions] `json:"default_member_permissions,omitzero"`
IntegrationTypes []ApplicationIntegrationType `json:"integration_types,omitempty"`
Contexts []InteractionContextType `json:"contexts,omitempty"`
NSFW *bool `json:"nsfw,omitempty"`
}
func (MessageCommandCreate) CommandName ¶
func (c MessageCommandCreate) CommandName() string
func (MessageCommandCreate) MarshalJSON ¶
func (c MessageCommandCreate) MarshalJSON() ([]byte, error)
func (MessageCommandCreate) Type ¶
func (MessageCommandCreate) Type() ApplicationCommandType
type MessageCommandInteractionData ¶
type MessageCommandInteractionData struct {
Resolved MessageCommandResolved `json:"resolved"`
// contains filtered or unexported fields
}
func (MessageCommandInteractionData) CommandID ¶
func (d MessageCommandInteractionData) CommandID() snowflake.ID
func (MessageCommandInteractionData) CommandName ¶
func (d MessageCommandInteractionData) CommandName() string
func (MessageCommandInteractionData) GuildID ¶ added in v0.8.9
func (d MessageCommandInteractionData) GuildID() *snowflake.ID
func (*MessageCommandInteractionData) MarshalJSON ¶
func (d *MessageCommandInteractionData) MarshalJSON() ([]byte, error)
func (MessageCommandInteractionData) TargetID ¶
func (d MessageCommandInteractionData) TargetID() snowflake.ID
func (MessageCommandInteractionData) TargetMessage ¶
func (d MessageCommandInteractionData) TargetMessage() Message
func (MessageCommandInteractionData) Type ¶
func (MessageCommandInteractionData) Type() ApplicationCommandType
func (*MessageCommandInteractionData) UnmarshalJSON ¶
func (d *MessageCommandInteractionData) UnmarshalJSON(data []byte) error
type MessageCommandResolved ¶
type MessageCommandUpdate ¶
type MessageCommandUpdate struct {
Name *string `json:"name,omitempty"`
NameLocalizations *map[Locale]string `json:"name_localizations,omitempty"`
DefaultMemberPermissions omit.Omit[*Permissions] `json:"default_member_permissions,omitzero"`
IntegrationTypes *[]ApplicationIntegrationType `json:"integration_types,omitempty"`
Contexts *[]InteractionContextType `json:"contexts,omitempty"`
NSFW *bool `json:"nsfw,omitempty"`
}
func (MessageCommandUpdate) CommandName ¶
func (c MessageCommandUpdate) CommandName() *string
func (MessageCommandUpdate) MarshalJSON ¶
func (c MessageCommandUpdate) MarshalJSON() ([]byte, error)
func (MessageCommandUpdate) Type ¶
func (MessageCommandUpdate) Type() ApplicationCommandType
type MessageCreate ¶
type MessageCreate struct {
Nonce string `json:"nonce,omitempty"`
Content string `json:"content,omitempty"`
TTS bool `json:"tts,omitempty"`
Embeds []Embed `json:"embeds,omitempty"`
Components []LayoutComponent `json:"components,omitempty"`
StickerIDs []snowflake.ID `json:"sticker_ids,omitempty"`
Files []*File `json:"-"`
Attachments []AttachmentCreate `json:"attachments,omitempty"`
AllowedMentions *AllowedMentions `json:"allowed_mentions,omitempty"`
MessageReference *MessageReference `json:"message_reference,omitempty"`
Flags MessageFlags `json:"flags,omitempty"`
EnforceNonce bool `json:"enforce_nonce,omitempty"`
Poll *PollCreate `json:"poll,omitempty"`
}
MessageCreate is the struct to create a new Message with.
func NewMessageCreate ¶ added in v0.19.0
func NewMessageCreate() MessageCreate
NewMessageCreate returns a new MessageCreate to create a message without any fields set.
func NewMessageCreateV2 ¶ added in v0.19.0
func NewMessageCreateV2(components ...LayoutComponent) MessageCreate
NewMessageCreateV2 returns a new MessageCreate with MessageFlagIsComponentsV2 flag set & allows to directly pass components.
func (MessageCreate) AddActionRow ¶ added in v0.19.0
func (m MessageCreate) AddActionRow(components ...InteractiveComponent) MessageCreate
AddActionRow returns a new MessageCreate with a new ActionRowComponent containing the provided InteractiveComponent(s) added.
func (MessageCreate) AddComponents ¶ added in v0.19.0
func (m MessageCreate) AddComponents(containers ...LayoutComponent) MessageCreate
AddComponents returns a new MessageCreate with the provided LayoutComponent(s) added.
func (MessageCreate) AddEmbeds ¶ added in v0.19.0
func (m MessageCreate) AddEmbeds(embeds ...Embed) MessageCreate
AddEmbeds returns a new MessageCreate with the provided embeds added.
func (MessageCreate) AddFile ¶ added in v0.19.0
func (m MessageCreate) AddFile(name string, description string, reader io.Reader, flags ...FileFlags) MessageCreate
AddFile returns a new MessageCreate with a File added.
func (MessageCreate) AddFiles ¶ added in v0.19.0
func (m MessageCreate) AddFiles(files ...*File) MessageCreate
AddFiles returns a new MessageCreate with the File(s) added.
func (MessageCreate) AddFlags ¶ added in v0.19.0
func (m MessageCreate) AddFlags(flags ...MessageFlags) MessageCreate
AddFlags returns a new MessageCreate with the provided MessageFlags added.
func (MessageCreate) AddStickers ¶ added in v0.19.0
func (m MessageCreate) AddStickers(stickerIds ...snowflake.ID) MessageCreate
AddStickers returns a new MessageCreate with the provided stickers added.
func (MessageCreate) ClearAllowedMentions ¶ added in v0.19.0
func (m MessageCreate) ClearAllowedMentions() MessageCreate
ClearAllowedMentions returns a new MessageCreate with no AllowedMentions.
func (MessageCreate) ClearComponents ¶ added in v0.19.0
func (m MessageCreate) ClearComponents() MessageCreate
ClearComponents returns a new MessageCreate with no LayoutComponent(s).
func (MessageCreate) ClearEmbeds ¶ added in v0.19.0
func (m MessageCreate) ClearEmbeds() MessageCreate
ClearEmbeds returns a new MessageCreate with no embeds.
func (MessageCreate) ClearFiles ¶ added in v0.19.0
func (m MessageCreate) ClearFiles() MessageCreate
ClearFiles returns a new MessageCreate with no File(s).
func (MessageCreate) ClearFlags ¶ added in v0.19.0
func (m MessageCreate) ClearFlags() MessageCreate
ClearFlags returns a new MessageCreate with no MessageFlags.
func (MessageCreate) ClearPoll ¶ added in v0.19.0
func (m MessageCreate) ClearPoll() MessageCreate
ClearPoll returns a new MessageCreate with no Poll.
func (MessageCreate) ClearStickers ¶ added in v0.19.0
func (m MessageCreate) ClearStickers() MessageCreate
ClearStickers returns a new MessageCreate with no Sticker(s).
func (MessageCreate) RemoveComponent ¶ added in v0.19.0
func (m MessageCreate) RemoveComponent(id int) MessageCreate
RemoveComponent returns a new MessageCreate with the LayoutComponent at the index removed.
func (MessageCreate) RemoveEmbed ¶ added in v0.19.0
func (m MessageCreate) RemoveEmbed(i int) MessageCreate
RemoveEmbed returns a new MessageCreate with the embed at the index removed.
func (MessageCreate) RemoveFile ¶ added in v0.19.0
func (m MessageCreate) RemoveFile(i int) MessageCreate
RemoveFile returns a new MessageCreate with the File at the index removed.
func (MessageCreate) RemoveFlags ¶ added in v0.19.0
func (m MessageCreate) RemoveFlags(flags ...MessageFlags) MessageCreate
RemoveFlags returns a new MessageCreate with the provided MessageFlags removed.
func (MessageCreate) RemoveSticker ¶ added in v0.19.0
func (m MessageCreate) RemoveSticker(stickerId snowflake.ID) MessageCreate
RemoveSticker returns a new MessageCreate with the provided sticker removed.
func (MessageCreate) ToBody ¶
func (m MessageCreate) ToBody() (any, error)
ToBody returns the MessageCreate ready for body.
func (MessageCreate) ToResponseBody ¶
func (m MessageCreate) ToResponseBody(response InteractionResponse) (any, error)
func (MessageCreate) UpdateComponent ¶ added in v0.19.0
func (m MessageCreate) UpdateComponent(id int, component LayoutComponent) MessageCreate
UpdateComponent returns a new MessageCreate with the provided LayoutComponent at the index.
func (MessageCreate) UpdateFile ¶ added in v0.19.0
func (m MessageCreate) UpdateFile(i int, file *File) MessageCreate
UpdateFile returns a new MessageCreate with the provided File at the index.
func (MessageCreate) WithAllowedMentions ¶ added in v0.19.0
func (m MessageCreate) WithAllowedMentions(allowedMentions *AllowedMentions) MessageCreate
WithAllowedMentions returns a new MessageCreate with the provided AllowedMentions.
func (MessageCreate) WithComponents ¶ added in v0.19.0
func (m MessageCreate) WithComponents(components ...LayoutComponent) MessageCreate
WithComponents returns a new MessageCreate with the provided LayoutComponent(s).
func (MessageCreate) WithContent ¶ added in v0.19.0
func (m MessageCreate) WithContent(content string) MessageCreate
WithContent returns a new MessageCreate with the provided content.
func (MessageCreate) WithContentf ¶ added in v0.19.0
func (m MessageCreate) WithContentf(content string, a ...any) MessageCreate
WithContentf returns a new MessageCreate with the formatted content.
func (MessageCreate) WithEmbed ¶ added in v0.19.0
func (m MessageCreate) WithEmbed(i int, embed Embed) MessageCreate
WithEmbed returns a new MessageCreate with the provided Embed at the index.
func (MessageCreate) WithEmbeds ¶ added in v0.19.0
func (m MessageCreate) WithEmbeds(embeds ...Embed) MessageCreate
WithEmbeds returns a new MessageCreate with the provided Embed(s).
func (MessageCreate) WithEnforceNonce ¶ added in v0.19.0
func (m MessageCreate) WithEnforceNonce(enforce bool) MessageCreate
WithEnforceNonce returns a new MessageCreate with the provided enforce nonce setting (use with WithNonce).
func (MessageCreate) WithEphemeral ¶ added in v0.19.0
func (m MessageCreate) WithEphemeral(ephemeral bool) MessageCreate
WithEphemeral returns a new MessageCreate with MessageFlagEphemeral added/removed.
func (MessageCreate) WithFiles ¶ added in v0.19.0
func (m MessageCreate) WithFiles(files ...*File) MessageCreate
WithFiles returns a new MessageCreate with the provided File(s).
func (MessageCreate) WithFlags ¶ added in v0.19.0
func (m MessageCreate) WithFlags(flags ...MessageFlags) MessageCreate
WithFlags returns a new MessageCreate with the provided message flags.
func (MessageCreate) WithIsComponentsV2 ¶ added in v0.19.0
func (m MessageCreate) WithIsComponentsV2(isComponentV2 bool) MessageCreate
WithIsComponentsV2 returns a new MessageCreate with MessageFlagIsComponentsV2 added/removed. Once a message with the flag has been sent, it cannot be removed by editing the message.
func (MessageCreate) WithMessageReference ¶ added in v0.19.0
func (m MessageCreate) WithMessageReference(messageReference *MessageReference) MessageCreate
WithMessageReference returns a new MessageCreate with the provided MessageReference to reply to.
func (MessageCreate) WithMessageReferenceByID ¶ added in v0.19.0
func (m MessageCreate) WithMessageReferenceByID(messageID snowflake.ID) MessageCreate
WithMessageReferenceByID returns a new MessageCreate with a MessageReference to the provided Message ID to reply to.
func (MessageCreate) WithNonce ¶ added in v0.19.0
func (m MessageCreate) WithNonce(nonce string) MessageCreate
WithNonce returns a new MessageCreate with the provided nonce.
func (MessageCreate) WithPoll ¶ added in v0.19.0
func (m MessageCreate) WithPoll(poll PollCreate) MessageCreate
WithPoll returns a new MessageCreate with the provided Poll.
func (MessageCreate) WithStickers ¶ added in v0.19.0
func (m MessageCreate) WithStickers(stickerIds ...snowflake.ID) MessageCreate
WithStickers returns a new MessageCreate with the provided stickers.
func (MessageCreate) WithSuppressEmbeds ¶ added in v0.19.0
func (m MessageCreate) WithSuppressEmbeds(suppressEmbeds bool) MessageCreate
WithSuppressEmbeds returns a new MessageCreate with MessageFlagSuppressEmbeds added/removed.
func (MessageCreate) WithSuppressNotifications ¶ added in v0.19.0
func (m MessageCreate) WithSuppressNotifications(suppressNotifications bool) MessageCreate
WithSuppressNotifications returns a new MessageCreate with MessageFlagSuppressNotifications added/removed.
func (MessageCreate) WithTTS ¶ added in v0.19.0
func (m MessageCreate) WithTTS(tts bool) MessageCreate
WithTTS returns a new MessageCreate with the provided TTS setting.
type MessageFlags ¶
type MessageFlags int
The MessageFlags of a Message
const ( MessageFlagCrossposted MessageFlags = 1 << iota MessageFlagIsCrosspost MessageFlagSuppressEmbeds MessageFlagSourceMessageDeleted MessageFlagUrgent MessageFlagHasThread MessageFlagEphemeral MessageFlagLoading // Message is an interaction of type 5, awaiting further response MessageFlagFailedToMentionSomeRolesInThread MessageFlagSuppressNotifications MessageFlagIsVoiceMessage MessageFlagHasSnapshot // MessageFlagIsComponentsV2 should be set when you want to send v2 components. // After setting this, you will not be allowed to send message content and embeds anymore. // Once a message with the flag has been sent, it cannot be removed by editing the message. MessageFlagIsComponentsV2 MessageFlagsNone MessageFlags = 0 )
Constants for MessageFlags
func (MessageFlags) Add ¶
func (f MessageFlags) Add(bits ...MessageFlags) MessageFlags
Add allows you to add multiple bits together, producing a new bit
func (MessageFlags) Has ¶
func (f MessageFlags) Has(bits ...MessageFlags) bool
Has will ensure that the bit includes all the bits entered
func (MessageFlags) Missing ¶
func (f MessageFlags) Missing(bits ...MessageFlags) bool
Missing will check whether the bit is missing any one of the bits
func (MessageFlags) Remove ¶
func (f MessageFlags) Remove(bits ...MessageFlags) MessageFlags
Remove allows you to subtract multiple bits from the first, producing a new bit
type MessageInteraction ¶
type MessageInteraction struct {
ID snowflake.ID `json:"id"`
Type InteractionType `json:"type"`
Name string `json:"name"`
User User `json:"user"`
}
MessageInteraction is sent on the Message object when the message is a response to an interaction
type MessageNotificationsLevel ¶
type MessageNotificationsLevel int
MessageNotificationsLevel indicates whether users receive @ mentions on a new message
const ( MessageNotificationsLevelAllMessages MessageNotificationsLevel = iota MessageNotificationsLevelOnlyMentions )
Constants for MessageNotificationsLevel
type MessagePin ¶ added in v0.19.0
type MessageReaction ¶
type MessageReaction struct {
Count int `json:"count"`
CountDetails ReactionCountDetails `json:"count_details"`
Me bool `json:"me"`
MeBurst bool `json:"me_burst"`
Emoji Emoji `json:"emoji"`
BurstColors []string `json:"burst_colors"`
}
MessageReaction contains information about the reactions of a message
type MessageReactionType ¶ added in v0.18.6
type MessageReactionType int
const ( MessageReactionTypeNormal MessageReactionType = iota MessageReactionTypeBurst )
type MessageReference ¶
type MessageReference struct {
Type MessageReferenceType `json:"type,omitempty"`
MessageID *snowflake.ID `json:"message_id"`
ChannelID *snowflake.ID `json:"channel_id,omitempty"`
GuildID *snowflake.ID `json:"guild_id,omitempty"`
FailIfNotExists bool `json:"fail_if_not_exists,omitempty"`
}
MessageReference is a reference to another message
type MessageReferenceType ¶ added in v0.18.9
type MessageReferenceType int
const ( MessageReferenceTypeDefault MessageReferenceType = iota MessageReferenceTypeForward )
type MessageSnapshot ¶ added in v0.18.9
type MessageSnapshot struct {
Message PartialMessage `json:"message"`
}
type MessageSticker ¶
type MessageSticker struct {
ID snowflake.ID `json:"id"`
Name string `json:"name"`
FormatType StickerFormatType `json:"format_type"`
}
type MessageThread ¶ added in v0.11.0
type MessageThread struct {
GuildThread
Member ThreadMember `json:"member"`
}
type MessageType ¶
type MessageType int
The MessageType indicates the Message type
const ( MessageTypeDefault MessageType = iota MessageTypeRecipientAdd MessageTypeRecipientRemove MessageTypeCall MessageTypeChannelNameChange MessageTypeChannelIconChange MessageTypeChannelPinnedMessage MessageTypeUserJoin MessageTypeGuildBoost MessageTypeGuildBoostTier1 MessageTypeGuildBoostTier2 MessageTypeGuildBoostTier3 MessageTypeChannelFollowAdd MessageTypeGuildDiscoveryDisqualified MessageTypeGuildDiscoveryRequalified MessageTypeGuildDiscoveryGracePeriodInitialWarning MessageTypeGuildDiscoveryGracePeriodFinalWarning MessageTypeThreadCreated MessageTypeReply MessageTypeSlashCommand MessageTypeThreadStarterMessage MessageTypeGuildInviteReminder MessageTypeContextMenuCommand MessageTypeAutoModerationAction MessageTypeRoleSubscriptionPurchase MessageTypeInteractionPremiumUpsell MessageTypeStageStart MessageTypeStageEnd MessageTypeStageSpeaker MessageTypeStageTopic MessageTypeGuildApplicationPremiumSubscription MessageTypeGuildIncidentAlertModeEnabled MessageTypeGuildIncidentAlertModeDisabled MessageTypeGuildIncidentReportRaid MessageTypeGuildIncidentReportFalseAlarm MessageTypePurchaseNotification MessageTypePollResult )
Constants for the MessageType
func (MessageType) Deleteable ¶ added in v0.12.7
func (t MessageType) Deleteable() bool
func (MessageType) System ¶ added in v0.12.7
func (t MessageType) System() bool
type MessageUpdate ¶
type MessageUpdate struct {
Content *string `json:"content,omitempty"`
Embeds *[]Embed `json:"embeds,omitempty"`
Components *[]LayoutComponent `json:"components,omitempty"`
Attachments *[]AttachmentUpdate `json:"attachments,omitempty"`
Files []*File `json:"-"`
AllowedMentions *AllowedMentions `json:"allowed_mentions,omitempty"`
// Flags are the MessageFlags of the message.
// Be careful not to override the current flags when editing messages from other users - this will result in a permission error.
// Use MessageFlags.Add for flags like discord.MessageFlagSuppressEmbeds.
Flags *MessageFlags `json:"flags,omitempty"`
}
MessageUpdate is used to edit a Message.
func NewMessageUpdate ¶ added in v0.19.0
func NewMessageUpdate() MessageUpdate
NewMessageUpdate returns a new MessageUpdate with no fields set.
func NewMessageUpdateV2 ¶ added in v0.19.0
func NewMessageUpdateV2(components []LayoutComponent) MessageUpdate
NewMessageUpdateV2 returns a new MessageUpdate with MessageFlagIsComponentsV2 set and no other fields set.
func (MessageUpdate) AddActionRow ¶ added in v0.19.0
func (m MessageUpdate) AddActionRow(components ...InteractiveComponent) MessageUpdate
AddActionRow returns a new MessageUpdate with a new ActionRowComponent containing the provided InteractiveComponent(s) added.
func (MessageUpdate) AddComponents ¶ added in v0.19.0
func (m MessageUpdate) AddComponents(containers ...LayoutComponent) MessageUpdate
AddComponents returns a new MessageUpdate with the provided LayoutComponent(s) added.
func (MessageUpdate) AddEmbeds ¶ added in v0.19.0
func (m MessageUpdate) AddEmbeds(embeds ...Embed) MessageUpdate
AddEmbeds returns a new MessageUpdate with the provided embeds added.
func (MessageUpdate) AddFile ¶ added in v0.19.0
func (m MessageUpdate) AddFile(name string, description string, reader io.Reader, flags ...FileFlags) MessageUpdate
AddFile returns a new MessageUpdate with a File added.
func (MessageUpdate) AddFiles ¶ added in v0.19.0
func (m MessageUpdate) AddFiles(files ...*File) MessageUpdate
AddFiles returns a new MessageUpdate with the File(s) added.
func (MessageUpdate) AddFlags ¶ added in v0.19.0
func (m MessageUpdate) AddFlags(flags ...MessageFlags) MessageUpdate
AddFlags returns a new MessageUpdate with the provided MessageFlags added.
func (MessageUpdate) ClearAllowedMentions ¶ added in v0.19.0
func (m MessageUpdate) ClearAllowedMentions() MessageUpdate
ClearAllowedMentions returns a new MessageUpdate with no AllowedMentions.
func (MessageUpdate) ClearComponents ¶ added in v0.19.0
func (m MessageUpdate) ClearComponents() MessageUpdate
ClearComponents returns a new MessageUpdate with no LayoutComponent(s).
func (MessageUpdate) ClearContent ¶ added in v0.19.0
func (m MessageUpdate) ClearContent() MessageUpdate
ClearContent returns a new MessageUpdate with no content.
func (MessageUpdate) ClearEmbeds ¶ added in v0.19.0
func (m MessageUpdate) ClearEmbeds() MessageUpdate
ClearEmbeds returns a new MessageUpdate with no embeds.
func (MessageUpdate) ClearFiles ¶ added in v0.19.0
func (m MessageUpdate) ClearFiles() MessageUpdate
ClearFiles returns a new MessageUpdate with no File(s).
func (MessageUpdate) ClearFlags ¶ added in v0.19.0
func (m MessageUpdate) ClearFlags() MessageUpdate
ClearFlags returns a new MessageUpdate with no MessageFlags.
func (MessageUpdate) RemoveComponent ¶ added in v0.19.0
func (m MessageUpdate) RemoveComponent(id int) MessageUpdate
RemoveComponent returns a new MessageUpdate with the LayoutComponent with the provided ID removed.
func (MessageUpdate) RemoveEmbed ¶ added in v0.19.0
func (m MessageUpdate) RemoveEmbed(i int) MessageUpdate
RemoveEmbed returns a new MessageUpdate with the embed at the index removed.
func (MessageUpdate) RemoveFile ¶ added in v0.19.0
func (m MessageUpdate) RemoveFile(i int) MessageUpdate
RemoveFile returns a new MessageUpdate with the File at the index removed.
func (MessageUpdate) RemoveFlags ¶ added in v0.19.0
func (m MessageUpdate) RemoveFlags(flags ...MessageFlags) MessageUpdate
RemoveFlags returns a new MessageUpdate with the provided MessageFlags removed.
func (MessageUpdate) RetainAttachments ¶ added in v0.19.0
func (m MessageUpdate) RetainAttachments(attachments ...Attachment) MessageUpdate
RetainAttachments returns a new MessageUpdate that retains the provided Attachment(s).
func (MessageUpdate) RetainAttachmentsByID ¶ added in v0.19.0
func (m MessageUpdate) RetainAttachmentsByID(attachmentIDs ...snowflake.ID) MessageUpdate
RetainAttachmentsByID returns a new MessageUpdate that retains the Attachment(s) with the provided IDs.
func (MessageUpdate) ToBody ¶
func (m MessageUpdate) ToBody() (any, error)
ToBody returns the MessageUpdate ready for body.
func (MessageUpdate) ToResponseBody ¶
func (m MessageUpdate) ToResponseBody(response InteractionResponse) (any, error)
func (MessageUpdate) UpdateComponent ¶ added in v0.19.0
func (m MessageUpdate) UpdateComponent(id int, component LayoutComponent) MessageUpdate
UpdateComponent returns a new MessageUpdate with the provided LayoutComponent at the index.
func (MessageUpdate) UpdateFile ¶ added in v0.19.0
func (m MessageUpdate) UpdateFile(i int, file *File) MessageUpdate
UpdateFile returns a new MessageUpdate with the File at the index.
func (MessageUpdate) WithAllowedMentions ¶ added in v0.19.0
func (m MessageUpdate) WithAllowedMentions(allowedMentions *AllowedMentions) MessageUpdate
WithAllowedMentions returns a new MessageUpdate with the provided AllowedMentions.
func (MessageUpdate) WithComponents ¶ added in v0.19.0
func (m MessageUpdate) WithComponents(components ...LayoutComponent) MessageUpdate
WithComponents returns a new MessageUpdate with the provided LayoutComponent(s).
func (MessageUpdate) WithContent ¶ added in v0.19.0
func (m MessageUpdate) WithContent(content string) MessageUpdate
WithContent returns a new MessageUpdate with the provided content.
func (MessageUpdate) WithContentf ¶ added in v0.19.0
func (m MessageUpdate) WithContentf(content string, a ...any) MessageUpdate
WithContentf returns a new MessageUpdate with the formatted content.
func (MessageUpdate) WithEmbed ¶ added in v0.19.0
func (m MessageUpdate) WithEmbed(i int, embed Embed) MessageUpdate
WithEmbed returns a new MessageUpdate with the provided Embed at the index.
func (MessageUpdate) WithEmbeds ¶ added in v0.19.0
func (m MessageUpdate) WithEmbeds(embeds ...Embed) MessageUpdate
WithEmbeds returns a new MessageUpdate with the provided Embed(s).
func (MessageUpdate) WithFiles ¶ added in v0.19.0
func (m MessageUpdate) WithFiles(files ...*File) MessageUpdate
WithFiles returns a new MessageUpdate with the provided File(s).
func (MessageUpdate) WithFlags ¶ added in v0.19.0
func (m MessageUpdate) WithFlags(flags MessageFlags) MessageUpdate
WithFlags returns a new MessageUpdate with the provided MessageFlags. Be careful not to override the current flags when editing messages from other users - this will result in a permission error. Use WithSuppressEmbeds or AddFlags for flags like MessageFlagSuppressEmbeds.
func (MessageUpdate) WithIsComponentsV2 ¶ added in v0.19.0
func (m MessageUpdate) WithIsComponentsV2(isComponentV2 bool) MessageUpdate
WithIsComponentsV2 returns a new MessageUpdate with MessageFlagIsComponentsV2 added/removed. Once a message with the flag has been sent, it cannot be removed by editing the message.
func (MessageUpdate) WithSuppressEmbeds ¶ added in v0.19.0
func (m MessageUpdate) WithSuppressEmbeds(suppressEmbeds bool) MessageUpdate
WithSuppressEmbeds returns a new MessageUpdate with MessageFlagSuppressEmbeds added/removed.
type ModalCreate ¶
type ModalCreate struct {
CustomID string `json:"custom_id"`
Title string `json:"title"`
Components []LayoutComponent `json:"components"`
}
func NewModalCreate ¶ added in v0.19.0
func NewModalCreate(customID string, title string, components []LayoutComponent) ModalCreate
func (ModalCreate) AddComponents ¶ added in v0.19.0
func (m ModalCreate) AddComponents(containers ...LayoutComponent) ModalCreate
AddComponents returns a new ModalCreate with the provided LayoutComponent(s) added.
func (ModalCreate) AddLabel ¶ added in v0.19.0
func (m ModalCreate) AddLabel(label string, component LabelSubComponent) ModalCreate
AddLabel returns a new ModalCreate with a new LabelComponent containing the provided label and component added.
func (ModalCreate) ClearComponents ¶ added in v0.19.0
func (m ModalCreate) ClearComponents() ModalCreate
ClearComponents returns a new ModalCreate with no LayoutComponent(s).
func (ModalCreate) RemoveComponent ¶ added in v0.19.0
func (m ModalCreate) RemoveComponent(i int) ModalCreate
RemoveComponent returns a new ModalCreate with the LayoutComponent at the index removed.
func (ModalCreate) UpdateComponent ¶ added in v0.19.0
func (m ModalCreate) UpdateComponent(i int, container LayoutComponent) ModalCreate
UpdateComponent returns a new ModalCreate with the provided LayoutComponent at the index.
func (ModalCreate) WithComponents ¶ added in v0.19.0
func (m ModalCreate) WithComponents(components ...LayoutComponent) ModalCreate
WithComponents returns a new ModalCreate with the provided LayoutComponent(s).
func (ModalCreate) WithCustomID ¶ added in v0.19.0
func (m ModalCreate) WithCustomID(customID string) ModalCreate
WithCustomID returns a new ModalCreate with the provided custom ID.
func (ModalCreate) WithTitle ¶ added in v0.19.0
func (m ModalCreate) WithTitle(title string) ModalCreate
WithTitle returns a new ModalCreate with the provided title.
type ModalSubmitInteraction ¶
type ModalSubmitInteraction struct {
Data ModalSubmitInteractionData `json:"data"`
// Message is only present if the modal was triggered from a button
Message *Message `json:"message,omitempty"`
// contains filtered or unexported fields
}
func (ModalSubmitInteraction) AppPermissions ¶ added in v0.15.1
func (i ModalSubmitInteraction) AppPermissions() *Permissions
func (ModalSubmitInteraction) ApplicationID ¶ added in v0.15.1
func (ModalSubmitInteraction) AttachmentSizeLimit ¶ added in v0.18.16
func (i ModalSubmitInteraction) AttachmentSizeLimit() int
func (ModalSubmitInteraction) AuthorizingIntegrationOwners ¶ added in v0.18.0
func (i ModalSubmitInteraction) AuthorizingIntegrationOwners() map[ApplicationIntegrationType]snowflake.ID
func (ModalSubmitInteraction) Channel ¶ added in v0.16.1
func (i ModalSubmitInteraction) Channel() InteractionChannel
func (ModalSubmitInteraction) Context ¶ added in v0.18.0
func (i ModalSubmitInteraction) Context() InteractionContextType
func (ModalSubmitInteraction) Entitlements ¶ added in v0.16.11
func (i ModalSubmitInteraction) Entitlements() []Entitlement
func (ModalSubmitInteraction) GuildLocale ¶ added in v0.15.1
func (i ModalSubmitInteraction) GuildLocale() *Locale
func (ModalSubmitInteraction) Locale ¶ added in v0.15.1
func (i ModalSubmitInteraction) Locale() Locale
func (ModalSubmitInteraction) MarshalJSON ¶ added in v0.15.1
func (i ModalSubmitInteraction) MarshalJSON() ([]byte, error)
func (ModalSubmitInteraction) Member ¶ added in v0.15.1
func (i ModalSubmitInteraction) Member() *ResolvedMember
func (ModalSubmitInteraction) PartialGuild ¶ added in v0.18.6
func (i ModalSubmitInteraction) PartialGuild() *InteractionGuild
func (ModalSubmitInteraction) Token ¶ added in v0.15.1
func (i ModalSubmitInteraction) Token() string
func (ModalSubmitInteraction) Type ¶
func (ModalSubmitInteraction) Type() InteractionType
func (*ModalSubmitInteraction) UnmarshalJSON ¶
func (i *ModalSubmitInteraction) UnmarshalJSON(data []byte) error
type ModalSubmitInteractionData ¶
type ModalSubmitInteractionData struct {
CustomID string `json:"custom_id"`
Components []LayoutComponent `json:"components"`
Resolved ResolvedData `json:"resolved"`
}
func (ModalSubmitInteractionData) AllComponents ¶ added in v0.19.0
func (d ModalSubmitInteractionData) AllComponents() iter.Seq[Component]
func (ModalSubmitInteractionData) Attachments ¶ added in v0.19.0
func (d ModalSubmitInteractionData) Attachments(customID string) []Attachment
func (ModalSubmitInteractionData) ChannelSelectMenu ¶ added in v0.19.0
func (d ModalSubmitInteractionData) ChannelSelectMenu(customID string) (ChannelSelectMenuComponent, bool)
func (ModalSubmitInteractionData) Channels ¶ added in v0.19.0
func (d ModalSubmitInteractionData) Channels(customID string) []ResolvedChannel
func (ModalSubmitInteractionData) Component ¶
func (d ModalSubmitInteractionData) Component(customID string) (InteractiveComponent, bool)
func (ModalSubmitInteractionData) FileUpload ¶ added in v0.19.0
func (d ModalSubmitInteractionData) FileUpload(customID string) (FileUploadComponent, bool)
func (ModalSubmitInteractionData) MentionableSelectMenu ¶ added in v0.19.0
func (d ModalSubmitInteractionData) MentionableSelectMenu(customID string) (MentionableSelectMenuComponent, bool)
func (ModalSubmitInteractionData) Mentionables ¶ added in v0.19.0
func (d ModalSubmitInteractionData) Mentionables(customID string) []Mentionable
func (ModalSubmitInteractionData) OptAttachments ¶ added in v0.19.0
func (d ModalSubmitInteractionData) OptAttachments(customID string) ([]Attachment, bool)
func (ModalSubmitInteractionData) OptChannels ¶ added in v0.19.0
func (d ModalSubmitInteractionData) OptChannels(customID string) ([]ResolvedChannel, bool)
func (ModalSubmitInteractionData) OptMentionables ¶ added in v0.19.0
func (d ModalSubmitInteractionData) OptMentionables(customID string) ([]Mentionable, bool)
func (ModalSubmitInteractionData) OptRoles ¶ added in v0.19.0
func (d ModalSubmitInteractionData) OptRoles(customID string) ([]Role, bool)
func (ModalSubmitInteractionData) OptStringValues ¶ added in v0.19.0
func (d ModalSubmitInteractionData) OptStringValues(customID string) ([]string, bool)
func (ModalSubmitInteractionData) OptText ¶
func (d ModalSubmitInteractionData) OptText(customID string) (string, bool)
func (ModalSubmitInteractionData) OptUsers ¶ added in v0.19.0
func (d ModalSubmitInteractionData) OptUsers(customID string) ([]User, bool)
func (ModalSubmitInteractionData) RoleSelectMenu ¶ added in v0.19.0
func (d ModalSubmitInteractionData) RoleSelectMenu(customID string) (RoleSelectMenuComponent, bool)
func (ModalSubmitInteractionData) Roles ¶ added in v0.19.0
func (d ModalSubmitInteractionData) Roles(customID string) []Role
func (ModalSubmitInteractionData) StringSelectMenu ¶ added in v0.19.0
func (d ModalSubmitInteractionData) StringSelectMenu(customID string) (StringSelectMenuComponent, bool)
func (ModalSubmitInteractionData) StringValues ¶ added in v0.19.0
func (d ModalSubmitInteractionData) StringValues(customID string) []string
func (ModalSubmitInteractionData) Text ¶
func (d ModalSubmitInteractionData) Text(customID string) string
func (ModalSubmitInteractionData) TextInput ¶ added in v0.19.0
func (d ModalSubmitInteractionData) TextInput(customID string) (TextInputComponent, bool)
func (*ModalSubmitInteractionData) UnmarshalJSON ¶
func (d *ModalSubmitInteractionData) UnmarshalJSON(data []byte) error
func (ModalSubmitInteractionData) UserSelectMenu ¶ added in v0.19.0
func (d ModalSubmitInteractionData) UserSelectMenu(customID string) (UserSelectMenuComponent, bool)
func (ModalSubmitInteractionData) Users ¶ added in v0.19.0
func (d ModalSubmitInteractionData) Users(customID string) []User
type MultipartBuffer ¶
MultipartBuffer holds the Body & ContentType of the multipart body
func PayloadWithFiles ¶
func PayloadWithFiles(v any, files ...*File) (*MultipartBuffer, error)
PayloadWithFiles returns the given payload as multipart body with all files in it
type Nameplate ¶ added in v0.19.0
type Nameplate struct {
SkuID snowflake.ID `json:"sku_id"`
Asset string `json:"asset"`
Label string `json:"label"`
Palette NameplatePalette `json:"palette"`
}
type NameplatePalette ¶ added in v0.19.0
type NameplatePalette string
const ( NameplatePaletteBerry NameplatePalette = "berry" NameplatePaletteBubbleGum NameplatePalette = "bubble_gum" NameplatePaletteClover NameplatePalette = "clover" NameplatePaletteCobalt NameplatePalette = "cobalt" NameplatePaletteCrimson NameplatePalette = "crimson" NameplatePaletteForest NameplatePalette = "forest" NameplatePaletteLemon NameplatePalette = "lemon" NameplatePaletteSky NameplatePalette = "sky" NameplatePaletteTeal NameplatePalette = "teal" NameplatePaletteViolet NameplatePalette = "violet" NameplatePaletteWhite NameplatePalette = "white" )
type Nonce ¶ added in v0.18.15
type Nonce string
Nonce is a string or int used when sending a message to discord.
func (*Nonce) UnmarshalJSON ¶ added in v0.18.15
UnmarshalJSON unmarshals the Nonce from a string or int.
type OAuth2Guild ¶
type OAuth2Guild struct {
ID snowflake.ID `json:"id"`
Name string `json:"name"`
Icon *string `json:"icon"`
Banner *string `json:"banner"`
Owner bool `json:"owner"`
Permissions Permissions `json:"permissions"`
Features []GuildFeature `json:"features"`
ApproximateMemberCount int `json:"approximate_member_count"`
ApproximatePresenceCount int `json:"approximate_presence_count"`
}
OAuth2Guild is returned on the GetGuilds route
func (OAuth2Guild) BannerURL ¶ added in v0.18.9
func (g OAuth2Guild) BannerURL(opts ...CDNOpt) *string
func (OAuth2Guild) IconURL ¶ added in v0.18.9
func (g OAuth2Guild) IconURL(opts ...CDNOpt) *string
type OAuth2Scope ¶ added in v0.12.0
type OAuth2Scope string
OAuth2Scope are the scopes you can request in the OAuth2 flow.
const ( // OAuth2ScopeActivitiesRead allows your app to fetch data from a user's "Now Playing/Recently Played" list - requires Discord approval OAuth2ScopeActivitiesRead OAuth2Scope = "activities.read" // OAuth2ScopeActivitiesWrite allows your app to update a user's activity - requires Discord approval (NOT REQUIRED FOR GAMESDK ACTIVITY MANAGER) OAuth2ScopeActivitiesWrite OAuth2Scope = "activities.write" // OAuth2ScopeApplicationsBuildsRead allows your app to read build data for a user's applications OAuth2ScopeApplicationsBuildsRead OAuth2Scope = "applications.builds.read" // OAuth2ScopeApplicationsBuildsUpload allows your app to upload/update builds for a user's applications - requires Discord approval OAuth2ScopeApplicationsBuildsUpload OAuth2Scope = "applications.builds.upload" OAuth2ScopeApplicationsCommands OAuth2Scope = "applications.commands" OAuth2ScopeApplicationsCommandsUpdate OAuth2Scope = "applications.commands.update" OAuth2ScopeApplicationsCommandsPermissionsUpdate OAuth2Scope = "applications.commands.permissions.update" OAuth2ScopeApplicationsEntitlements OAuth2Scope = "applications.entitlements" OAuth2ScopeApplicationsStoreUpdate OAuth2Scope = "applications.store.update" OAuth2ScopeRPC OAuth2Scope = "rpc" OAuth2ScopeRPCNotificationsRead OAuth2Scope = "rpc.notifications.read" OAuth2ScopeRPCVoiceWrite OAuth2Scope = "rpc.voice.write" OAuth2ScopeRPCVoiceRead OAuth2Scope = "rpc.voice.read" OAuth2ScopeRPCActivitiesWrite OAuth2Scope = "rpc.activities.write" OAuth2ScopeGuilds OAuth2Scope = "guilds" OAuth2ScopeGuildsJoin OAuth2Scope = "guilds.join" OAuth2ScopeGuildsMembersRead OAuth2Scope = "guilds.members.read" OAuth2ScopeGDMJoin OAuth2Scope = "gdm.join" OAuth2ScopeRelationshipsRead OAuth2Scope = "relationships.read" OAuth2ScopeRoleConnectionsWrite OAuth2Scope = "role_connections.write" OAuth2ScopeIdentify OAuth2Scope = "identify" OAuth2ScopeEmail OAuth2Scope = "email" OAuth2ScopeConnections OAuth2Scope = "connections" OAuth2ScopeBot OAuth2Scope = "bot" OAuth2ScopeMessagesRead OAuth2Scope = "messages.read" OAuth2ScopeWebhookIncoming OAuth2Scope = "webhook.incoming" )
func SplitScopes ¶
func SplitScopes(joinedScopes string) []OAuth2Scope
func (OAuth2Scope) String ¶ added in v0.12.0
func (s OAuth2Scope) String() string
type OAuth2User ¶
type OAuth2User struct {
User
// Requires OAuth2ScopeIdentify
MfaEnabled bool `json:"mfa_enabled"`
Locale string `json:"locale"`
Flags UserFlags `json:"flags"`
PremiumType PremiumType `json:"premium_type"`
// Requires OAuth2ScopeEmail
Verified bool `json:"verified"`
Email string `json:"email"`
}
OAuth2User represents a full User returned by the oauth2 endpoints
type OnlineStatus ¶
type OnlineStatus string
OnlineStatus (https://discord.com/developers/docs/topics/gateway#update-presence-status-types)
const ( OnlineStatusOnline OnlineStatus = "online" OnlineStatusDND OnlineStatus = "dnd" OnlineStatusIdle OnlineStatus = "idle" OnlineStatusInvisible OnlineStatus = "invisible" OnlineStatusOffline OnlineStatus = "offline" )
type OptionalAuditLogEntryInfo ¶
type OptionalAuditLogEntryInfo struct {
DeleteMemberDays *string `json:"delete_member_days"`
MembersRemoved *string `json:"members_removed"`
ChannelID *snowflake.ID `json:"channel_id"`
MessageID *snowflake.ID `json:"message_id"`
Count *string `json:"count"`
ID *string `json:"id"`
Type *string `json:"type"`
RoleName *string `json:"role_name"`
ApplicationID *snowflake.ID `json:"application_id"`
AutoModerationRuleName *string `json:"auto_moderation_rule_name"`
AutoModerationRuleTriggerType *AutoModerationTriggerType `json:"auto_moderation_rule_trigger_type,string"`
IntegrationType *IntegrationType `json:"integration_type"`
}
OptionalAuditLogEntryInfo (https://discord.com/developers/docs/resources/audit-log#audit-log-entry-object-optional-audit-entry-info)
type PartialApplication ¶
type PartialApplication struct {
ID snowflake.ID `json:"id"`
Flags ApplicationFlags `json:"flags"`
}
type PartialChannel ¶ added in v0.16.1
type PartialChannel struct {
ID snowflake.ID `json:"id"`
Type ChannelType `json:"type"`
}
type PartialEmoji ¶ added in v0.16.0
type PartialEmoji struct {
ID *snowflake.ID `json:"id,omitempty"`
Name *string `json:"name,omitempty"`
Animated bool `json:"animated,omitempty"`
}
func (PartialEmoji) Reaction ¶ added in v0.16.3
func (e PartialEmoji) Reaction() string
Reaction returns a string used for manipulating with reactions. May be empty if the Name is nil
type PartialInvite ¶ added in v0.14.1
type PartialMessage ¶ added in v0.18.9
type PartialMessage struct {
Type MessageType `json:"type"`
Content string `json:"content,omitempty"`
Embeds []Embed `json:"embeds,omitempty"`
Attachments []Attachment `json:"attachments"`
CreatedAt time.Time `json:"timestamp"`
EditedTimestamp *time.Time `json:"edited_timestamp"`
Flags MessageFlags `json:"flags"`
Mentions []User `json:"mentions"`
MentionRoles []snowflake.ID `json:"mention_roles"`
Stickers []Sticker `json:"stickers"`
StickerItems []MessageSticker `json:"sticker_items,omitempty"`
Components []LayoutComponent `json:"components,omitempty"`
}
func (PartialMessage) AllComponents ¶ added in v0.19.0
func (m PartialMessage) AllComponents() iter.Seq[Component]
func (*PartialMessage) UnmarshalJSON ¶ added in v0.18.12
func (m *PartialMessage) UnmarshalJSON(data []byte) error
type PartialRole ¶
PartialRole holds basic info about a Role
type PermissionOverwrite ¶
type PermissionOverwrite interface {
Type() PermissionOverwriteType
ID() snowflake.ID
}
PermissionOverwrite is used to determine who can perform particular actions in a GetGuildChannel
type PermissionOverwriteType ¶
type PermissionOverwriteType int
PermissionOverwriteType is the type of PermissionOverwrite
const ( PermissionOverwriteTypeRole PermissionOverwriteType = iota PermissionOverwriteTypeMember )
Constants for PermissionOverwriteType
type PermissionOverwriteUpdate ¶
type PermissionOverwriteUpdate interface {
Type() PermissionOverwriteType
}
type PermissionOverwrites ¶ added in v0.9.0
type PermissionOverwrites []PermissionOverwrite
func (PermissionOverwrites) Get ¶ added in v0.9.0
func (p PermissionOverwrites) Get(overwriteType PermissionOverwriteType, id snowflake.ID) (PermissionOverwrite, bool)
func (PermissionOverwrites) Member ¶ added in v0.9.0
func (p PermissionOverwrites) Member(id snowflake.ID) (MemberPermissionOverwrite, bool)
func (PermissionOverwrites) Role ¶ added in v0.9.0
func (p PermissionOverwrites) Role(id snowflake.ID) (RolePermissionOverwrite, bool)
type Permissions ¶
type Permissions int64
Permissions extends the Bit structure, and is used within roles and channels (https://discord.com/developers/docs/topics/permissions#permissions)
const ( PermissionCreateInstantInvite Permissions = 1 << iota PermissionKickMembers PermissionBanMembers PermissionAdministrator PermissionManageChannels PermissionManageGuild PermissionAddReactions PermissionViewAuditLog PermissionPrioritySpeaker PermissionStream PermissionViewChannel PermissionSendMessages PermissionSendTTSMessages PermissionManageMessages PermissionEmbedLinks PermissionAttachFiles PermissionReadMessageHistory PermissionMentionEveryone PermissionUseExternalEmojis PermissionViewGuildInsights PermissionConnect PermissionSpeak PermissionMuteMembers PermissionDeafenMembers PermissionMoveMembers PermissionUseVAD PermissionChangeNickname PermissionManageNicknames PermissionManageRoles PermissionManageWebhooks PermissionManageGuildExpressions PermissionUseApplicationCommands PermissionRequestToSpeak PermissionManageEvents PermissionManageThreads PermissionCreatePublicThreads PermissionCreatePrivateThreads PermissionUseExternalStickers PermissionSendMessagesInThreads PermissionUseEmbeddedActivities PermissionModerateMembers PermissionViewCreatorMonetizationAnalytics PermissionUseSoundboard PermissionCreateGuildExpressions PermissionCreateEvents PermissionUseExternalSounds PermissionSendVoiceMessages PermissionSendPolls PermissionUseExternalApps PermissionPinMessages PermissionBypassSlowmode PermissionsAllText = PermissionViewChannel | PermissionSendMessages | PermissionSendTTSMessages | PermissionManageMessages | PermissionEmbedLinks | PermissionAttachFiles | PermissionReadMessageHistory | PermissionMentionEveryone | PermissionSendVoiceMessages | PermissionSendPolls | PermissionUseExternalApps | PermissionPinMessages | PermissionBypassSlowmode PermissionsAllThread = PermissionManageThreads | PermissionCreatePublicThreads | PermissionCreatePrivateThreads | PermissionSendMessagesInThreads PermissionsAllVoice = PermissionViewChannel | PermissionConnect | PermissionSpeak | PermissionStream | PermissionMuteMembers | PermissionDeafenMembers | PermissionMoveMembers | PermissionUseVAD | PermissionPrioritySpeaker | PermissionUseSoundboard | PermissionUseExternalSounds | PermissionRequestToSpeak | PermissionUseEmbeddedActivities | PermissionCreateGuildExpressions | PermissionCreateEvents | PermissionManageEvents PermissionsAllChannel = PermissionsAllText | PermissionsAllThread | PermissionsAllVoice | PermissionCreateInstantInvite | PermissionManageChannels | PermissionAddReactions | PermissionUseExternalEmojis | PermissionUseApplicationCommands | PermissionUseExternalStickers PermissionsAll = PermissionsAllChannel | PermissionKickMembers | PermissionBanMembers | PermissionManageGuild | PermissionAdministrator | PermissionManageWebhooks | PermissionManageGuildExpressions | PermissionViewCreatorMonetizationAnalytics | PermissionViewGuildInsights | PermissionViewAuditLog | PermissionManageRoles | PermissionChangeNickname | PermissionManageNicknames | PermissionModerateMembers PermissionsNone Permissions = 0 )
func (Permissions) Add ¶
func (p Permissions) Add(bits ...Permissions) Permissions
Add allows you to add multiple bits together, producing a new bit
func (Permissions) Has ¶
func (p Permissions) Has(bits ...Permissions) bool
Has will ensure that the bit includes all the bits entered
func (Permissions) MarshalJSON ¶
func (p Permissions) MarshalJSON() ([]byte, error)
MarshalJSON marshals permissions into a string
func (Permissions) Missing ¶
func (p Permissions) Missing(bits ...Permissions) bool
Missing will check whether the bit is missing any one of the bits
func (Permissions) Remove ¶
func (p Permissions) Remove(bits ...Permissions) Permissions
Remove allows you to subtract multiple bits from the first, producing a new bit
func (Permissions) String ¶ added in v0.14.0
func (p Permissions) String() string
func (*Permissions) UnmarshalJSON ¶
func (p *Permissions) UnmarshalJSON(data []byte) error
UnmarshalJSON unmarshalls permissions into an int64
type PingInteraction ¶
type PingInteraction struct {
// contains filtered or unexported fields
}
func (PingInteraction) AppPermissions ¶ added in v0.12.7
func (PingInteraction) AppPermissions() *Permissions
func (PingInteraction) ApplicationID ¶
func (i PingInteraction) ApplicationID() snowflake.ID
func (PingInteraction) AttachmentSizeLimit ¶ added in v0.18.16
func (PingInteraction) AttachmentSizeLimit() int
func (PingInteraction) AuthorizingIntegrationOwners ¶ added in v0.18.0
func (PingInteraction) AuthorizingIntegrationOwners() map[ApplicationIntegrationType]snowflake.ID
func (PingInteraction) Channel ¶ added in v0.16.1
func (PingInteraction) Channel() InteractionChannel
func (PingInteraction) ChannelID ¶
func (PingInteraction) ChannelID() snowflake.ID
func (PingInteraction) Context ¶ added in v0.18.0
func (PingInteraction) Context() InteractionContextType
func (PingInteraction) CreatedAt ¶ added in v0.13.17
func (i PingInteraction) CreatedAt() time.Time
func (PingInteraction) Entitlements ¶ added in v0.16.11
func (PingInteraction) Entitlements() []Entitlement
func (PingInteraction) GuildID ¶
func (PingInteraction) GuildID() *snowflake.ID
func (PingInteraction) GuildLocale ¶
func (PingInteraction) GuildLocale() *Locale
func (PingInteraction) ID ¶
func (i PingInteraction) ID() snowflake.ID
func (PingInteraction) Locale ¶
func (PingInteraction) Locale() Locale
func (PingInteraction) MarshalJSON ¶
func (i PingInteraction) MarshalJSON() ([]byte, error)
func (PingInteraction) Member ¶
func (PingInteraction) Member() *ResolvedMember
func (PingInteraction) PartialGuild ¶ added in v0.18.6
func (PingInteraction) PartialGuild() *InteractionGuild
func (PingInteraction) Token ¶
func (i PingInteraction) Token() string
func (PingInteraction) Type ¶
func (PingInteraction) Type() InteractionType
func (*PingInteraction) UnmarshalJSON ¶
func (i *PingInteraction) UnmarshalJSON(data []byte) error
func (PingInteraction) User ¶
func (PingInteraction) User() User
func (PingInteraction) Version ¶
func (i PingInteraction) Version() int
type Poll ¶ added in v0.18.3
type Poll struct {
Question PollMedia `json:"question"`
Answers []PollAnswer `json:"answers"`
Expiry *time.Time `json:"expiry"`
AllowMultiselect bool `json:"allow_multiselect"`
LayoutType PollLayoutType `json:"layout_type"`
Results *PollResults `json:"results"`
}
type PollAnswer ¶ added in v0.18.3
type PollAnswerCount ¶ added in v0.18.3
type PollCreate ¶ added in v0.18.3
type PollCreate struct {
Question PollMedia `json:"question"`
Answers []PollMedia `json:"-"`
Duration int `json:"duration"`
AllowMultiselect bool `json:"allow_multiselect"`
LayoutType PollLayoutType `json:"layout_type,omitempty"`
}
func (PollCreate) MarshalJSON ¶ added in v0.18.3
func (p PollCreate) MarshalJSON() ([]byte, error)
type PollCreateBuilder ¶ added in v0.18.3
type PollCreateBuilder struct {
PollCreate
}
PollCreateBuilder helps create PollCreate structs easier
func (*PollCreateBuilder) AddAnswer ¶ added in v0.18.4
func (b *PollCreateBuilder) AddAnswer(text string, emoji *PartialEmoji) *PollCreateBuilder
AddAnswer adds an answer to the Poll
func (*PollCreateBuilder) Build ¶ added in v0.18.3
func (b *PollCreateBuilder) Build() PollCreate
Build builds the PollCreateBuilder to a PollCreate struct
func (*PollCreateBuilder) ClearAnswers ¶ added in v0.18.3
func (b *PollCreateBuilder) ClearAnswers() *PollCreateBuilder
ClearAnswers removes all answers of the Poll
func (*PollCreateBuilder) RemoveAnswer ¶ added in v0.18.3
func (b *PollCreateBuilder) RemoveAnswer(i int) *PollCreateBuilder
RemoveAnswer removes an answer from the Poll
func (*PollCreateBuilder) SetAllowMultiselect ¶ added in v0.18.3
func (b *PollCreateBuilder) SetAllowMultiselect(multiselect bool) *PollCreateBuilder
SetAllowMultiselect sets whether users will be able to vote for more than one answer of the Poll
func (*PollCreateBuilder) SetAnswers ¶ added in v0.18.4
func (b *PollCreateBuilder) SetAnswers(answers ...PollMedia) *PollCreateBuilder
SetAnswers sets the answers of the Poll
func (*PollCreateBuilder) SetDuration ¶ added in v0.18.3
func (b *PollCreateBuilder) SetDuration(duration int) *PollCreateBuilder
SetDuration sets the duration of the Poll (in hours)
func (*PollCreateBuilder) SetLayoutType ¶ added in v0.18.3
func (b *PollCreateBuilder) SetLayoutType(layout PollLayoutType) *PollCreateBuilder
SetLayoutType sets the layout of the Poll
func (*PollCreateBuilder) SetQuestion ¶ added in v0.18.3
func (b *PollCreateBuilder) SetQuestion(text string) *PollCreateBuilder
SetQuestion sets the question of the Poll
type PollLayoutType ¶ added in v0.18.3
type PollLayoutType int
const (
PollLayoutTypeDefault PollLayoutType = iota + 1
)
type PollMedia ¶ added in v0.18.3
type PollMedia struct {
Text *string `json:"text"`
Emoji *PartialEmoji `json:"emoji,omitempty"`
}
type PollResults ¶ added in v0.18.3
type PollResults struct {
IsFinalized bool `json:"is_finalized"`
AnswerCounts []PollAnswerCount `json:"answer_counts"`
}
type PremiumTier ¶
type PremiumTier int
PremiumTier tells you the boost level of a Guild
const ( PremiumTierNone PremiumTier = iota PremiumTier1 PremiumTier2 PremiumTier3 )
Constants for PremiumTier
type PremiumType ¶
type PremiumType int
PremiumType defines the different discord nitro tiers a user can have (https://discord.com/developers/docs/resources/user#user-object-premium-types)
const ( PremiumTypeNone PremiumType = iota PremiumTypeNitroClassic PremiumTypeNitro PremiumTypeNitroBasic )
All PremiumType(s)
type Presence ¶
type Presence struct {
PresenceUser PresenceUser `json:"user"`
GuildID snowflake.ID `json:"guild_id"`
Status OnlineStatus `json:"status"`
Activities []Activity `json:"activities"`
ClientStatus ClientStatus `json:"client_status"`
}
Presence (https://discord.com/developers/docs/topics/gateway#presence-update)
type PresenceUser ¶
type PrimaryGuild ¶ added in v0.19.0
type QueryValues ¶ added in v0.13.11
QueryValues holds key value pairs of query values
func (QueryValues) Encode ¶ added in v0.13.11
func (q QueryValues) Encode() string
Encode encodes the QueryValues into a string to append to the url
type RadioGroupComponent ¶ added in v0.19.1
type RadioGroupComponent struct {
// ID is the identifier for the checkbox component.
ID int `json:"id,omitempty"`
// CustomID is the custom identifier for the checkbox component.
CustomID string `json:"custom_id"`
// Required specifies whether the checkbox is required. (default: false)
Required bool `json:"required"`
// Options is the options available in the radio group. (min: 2, max: 10)
Options []RadioGroupOption `json:"options"`
// Value is only set when the [RadioGroupComponent] is received from an [InteractionTypeModalSubmit].
// Nil if no option was selected, otherwise the value of the selected option.
Value *string `json:"value,omitempty"`
}
RadioGroupComponent is a component that allows users to select a single option from a list.
func (RadioGroupComponent) GetCustomID ¶ added in v0.19.1
func (c RadioGroupComponent) GetCustomID() string
func (RadioGroupComponent) GetID ¶ added in v0.19.1
func (c RadioGroupComponent) GetID() int
func (RadioGroupComponent) MarshalJSON ¶ added in v0.19.1
func (c RadioGroupComponent) MarshalJSON() ([]byte, error)
func (RadioGroupComponent) Type ¶ added in v0.19.1
func (RadioGroupComponent) Type() ComponentType
func (RadioGroupComponent) WithCustomID ¶ added in v0.19.1
func (c RadioGroupComponent) WithCustomID(customID string) RadioGroupComponent
WithCustomID returns a new RadioGroupComponent with the provided customID
func (RadioGroupComponent) WithID ¶ added in v0.19.1
func (c RadioGroupComponent) WithID(id int) RadioGroupComponent
WithID returns a new RadioGroupComponent with the provided id
func (RadioGroupComponent) WithOptions ¶ added in v0.19.1
func (c RadioGroupComponent) WithOptions(options ...RadioGroupOption) RadioGroupComponent
WithOptions returns a new RadioGroupComponent with the provided options
func (RadioGroupComponent) WithRequired ¶ added in v0.19.1
func (c RadioGroupComponent) WithRequired(required bool) RadioGroupComponent
WithRequired returns a new RadioGroupComponent with the provided required
type RadioGroupOption ¶ added in v0.19.1
type RadioGroupOption struct {
// Value is the value of the option.
Value string `json:"value"`
// Label is the label of the option.
Label string `json:"label"`
// Description is the description of the option.
Description string `json:"description,omitempty"`
// Default indicates whether the option is selected by default.
Default bool `json:"default"`
}
RadioGroupOption is an option in a RadioGroupComponent.
func NewRadioGroupOption ¶ added in v0.19.1
func NewRadioGroupOption(value string, label string) RadioGroupOption
NewRadioGroupOption creates a new RadioGroupOption with the provided value and label.
func (RadioGroupOption) WithDefault ¶ added in v0.19.1
func (o RadioGroupOption) WithDefault(def bool) RadioGroupOption
func (RadioGroupOption) WithDescription ¶ added in v0.19.1
func (o RadioGroupOption) WithDescription(description string) RadioGroupOption
func (RadioGroupOption) WithLabel ¶ added in v0.19.1
func (o RadioGroupOption) WithLabel(label string) RadioGroupOption
func (RadioGroupOption) WithValue ¶ added in v0.19.1
func (o RadioGroupOption) WithValue(value string) RadioGroupOption
type ReactionCountDetails ¶ added in v0.16.9
type ResolvedChannel ¶
type ResolvedChannel struct {
ID snowflake.ID `json:"id"`
Name string `json:"name"`
Type ChannelType `json:"type"`
Permissions Permissions `json:"permissions"`
ThreadMetadata ThreadMetadata `json:"thread_metadata"`
ParentID snowflake.ID `json:"parent_id"`
}
type ResolvedData ¶ added in v0.16.10
type ResolvedData struct {
Users map[snowflake.ID]User `json:"users,omitempty"`
Members map[snowflake.ID]ResolvedMember `json:"members,omitempty"`
Roles map[snowflake.ID]Role `json:"roles,omitempty"`
Channels map[snowflake.ID]ResolvedChannel `json:"channels,omitempty"`
Attachments map[snowflake.ID]Attachment `json:"attachments,omitempty"`
}
func (*ResolvedData) UnmarshalJSON ¶ added in v0.16.10
func (r *ResolvedData) UnmarshalJSON(data []byte) error
type ResolvedMember ¶
type ResolvedMember struct {
Member
Permissions Permissions `json:"permissions,omitempty"`
}
type Role ¶
type Role struct {
ID snowflake.ID `json:"id"`
GuildID snowflake.ID `json:"guild_id,omitempty"` // not present in the API but we need it
Name string `json:"name"`
Description *string `json:"description,omitempty"`
Color int `json:"color"`
RoleColors RoleColors `json:"colors"`
Hoist bool `json:"hoist"`
Position int `json:"position"`
Permissions Permissions `json:"permissions"`
Managed bool `json:"managed"`
Icon *string `json:"icon"`
Emoji *string `json:"unicode_emoji"`
Mentionable bool `json:"mentionable"`
Tags *RoleTag `json:"tags,omitempty"`
Flags RoleFlags `json:"flags"`
}
Role is a Guild Role object
type RoleColors ¶ added in v0.19.0
type RoleCreate ¶
type RoleCreate struct {
Name string `json:"name,omitempty"`
Permissions *Permissions `json:"permissions,omitempty"`
Color int `json:"color,omitempty"`
Colors RoleColors `json:"colors,omitempty"`
Hoist bool `json:"hoist,omitempty"`
Icon *Icon `json:"icon,omitempty"`
Emoji string `json:"unicode_emoji,omitempty"`
Mentionable bool `json:"mentionable,omitempty"`
}
RoleCreate is the payload to create a Role
type RolePermissionOverwrite ¶
type RolePermissionOverwrite struct {
RoleID snowflake.ID `json:"id"`
Allow Permissions `json:"allow"`
Deny Permissions `json:"deny"`
}
func (RolePermissionOverwrite) ID ¶
func (o RolePermissionOverwrite) ID() snowflake.ID
func (RolePermissionOverwrite) MarshalJSON ¶
func (o RolePermissionOverwrite) MarshalJSON() ([]byte, error)
func (RolePermissionOverwrite) Type ¶
func (o RolePermissionOverwrite) Type() PermissionOverwriteType
type RolePermissionOverwriteUpdate ¶
type RolePermissionOverwriteUpdate struct {
Allow *Permissions `json:"allow,omitempty"`
Deny *Permissions `json:"deny,omitempty"`
}
func (RolePermissionOverwriteUpdate) MarshalJSON ¶
func (u RolePermissionOverwriteUpdate) MarshalJSON() ([]byte, error)
func (RolePermissionOverwriteUpdate) Type ¶
func (RolePermissionOverwriteUpdate) Type() PermissionOverwriteType
type RolePositionUpdate ¶
type RolePositionUpdate struct {
ID snowflake.ID `json:"id"`
Position *int `json:"position,omitempty"`
}
RolePositionUpdate is the payload to update a Role(s) position
type RoleSelectMenuComponent ¶ added in v0.14.0
type RoleSelectMenuComponent struct {
ID int `json:"id,omitempty"`
CustomID string `json:"custom_id"`
Placeholder string `json:"placeholder,omitempty"`
DefaultValues []SelectMenuDefaultValue `json:"default_values,omitempty"`
MinValues *int `json:"min_values,omitempty"`
MaxValues int `json:"max_values,omitempty"`
// Required Indicates if the select menu is required to submit the Modal.
Required bool `json:"required"`
// Disabled whether the select menu is disabled (only supported in messages)
Disabled bool `json:"disabled"`
// Values is only set when the RoleSelectMenuComponent is received from an InteractionTypeModalSubmit
Values []snowflake.ID `json:"values,omitempty"`
}
func NewRoleSelectMenu ¶ added in v0.14.0
func NewRoleSelectMenu(customID string, placeholder string) RoleSelectMenuComponent
NewRoleSelectMenu builds a new SelectMenuComponent from the provided values
func (RoleSelectMenuComponent) AddDefaultValue ¶ added in v0.16.10
func (c RoleSelectMenuComponent) AddDefaultValue(defaultValue snowflake.ID) RoleSelectMenuComponent
AddDefaultValue returns a new RoleSelectMenuComponent with the provided default value added
func (RoleSelectMenuComponent) AsDisabled ¶ added in v0.14.0
func (c RoleSelectMenuComponent) AsDisabled() RoleSelectMenuComponent
AsDisabled returns a new RoleSelectMenuComponent but disabled
func (RoleSelectMenuComponent) AsEnabled ¶ added in v0.14.0
func (c RoleSelectMenuComponent) AsEnabled() RoleSelectMenuComponent
AsEnabled returns a new RoleSelectMenuComponent but enabled
func (RoleSelectMenuComponent) GetCustomID ¶ added in v0.19.0
func (c RoleSelectMenuComponent) GetCustomID() string
func (RoleSelectMenuComponent) GetID ¶ added in v0.19.0
func (c RoleSelectMenuComponent) GetID() int
func (RoleSelectMenuComponent) MarshalJSON ¶ added in v0.14.0
func (c RoleSelectMenuComponent) MarshalJSON() ([]byte, error)
func (RoleSelectMenuComponent) RemoveDefaultValue ¶ added in v0.16.10
func (c RoleSelectMenuComponent) RemoveDefaultValue(index int) RoleSelectMenuComponent
RemoveDefaultValue returns a new RoleSelectMenuComponent with the provided default value at the index removed
func (RoleSelectMenuComponent) SetDefaultValues ¶ added in v0.16.10
func (c RoleSelectMenuComponent) SetDefaultValues(defaultValues ...snowflake.ID) RoleSelectMenuComponent
SetDefaultValues returns a new RoleSelectMenuComponent with the provided default values
func (RoleSelectMenuComponent) Type ¶ added in v0.14.0
func (RoleSelectMenuComponent) Type() ComponentType
func (RoleSelectMenuComponent) WithCustomID ¶ added in v0.14.0
func (c RoleSelectMenuComponent) WithCustomID(customID string) RoleSelectMenuComponent
WithCustomID returns a new RoleSelectMenuComponent with the provided customID
func (RoleSelectMenuComponent) WithDisabled ¶ added in v0.14.0
func (c RoleSelectMenuComponent) WithDisabled(disabled bool) RoleSelectMenuComponent
WithDisabled returns a new RoleSelectMenuComponent with the provided disabled
func (RoleSelectMenuComponent) WithID ¶ added in v0.19.0
func (c RoleSelectMenuComponent) WithID(id int) RoleSelectMenuComponent
WithID returns a new RoleSelectMenuComponent with the provided ID
func (RoleSelectMenuComponent) WithMaxValues ¶ added in v0.14.0
func (c RoleSelectMenuComponent) WithMaxValues(maxValue int) RoleSelectMenuComponent
WithMaxValues returns a new RoleSelectMenuComponent with the provided maxValue
func (RoleSelectMenuComponent) WithMinValues ¶ added in v0.14.0
func (c RoleSelectMenuComponent) WithMinValues(minValue int) RoleSelectMenuComponent
WithMinValues returns a new RoleSelectMenuComponent with the provided minValue
func (RoleSelectMenuComponent) WithPlaceholder ¶ added in v0.14.0
func (c RoleSelectMenuComponent) WithPlaceholder(placeholder string) RoleSelectMenuComponent
WithPlaceholder returns a new RoleSelectMenuComponent with the provided placeholder
func (RoleSelectMenuComponent) WithRequired ¶ added in v0.19.0
func (c RoleSelectMenuComponent) WithRequired(required bool) RoleSelectMenuComponent
WithRequired returns a new RoleSelectMenuComponent with the provided required value
type RoleSelectMenuInteractionData ¶ added in v0.14.0
type RoleSelectMenuInteractionData struct {
Resolved RoleSelectMenuResolved `json:"resolved"`
Values []snowflake.ID `json:"values"`
// contains filtered or unexported fields
}
func (RoleSelectMenuInteractionData) CustomID ¶ added in v0.14.0
func (d RoleSelectMenuInteractionData) CustomID() string
func (RoleSelectMenuInteractionData) MarshalJSON ¶ added in v0.14.0
func (d RoleSelectMenuInteractionData) MarshalJSON() ([]byte, error)
func (RoleSelectMenuInteractionData) Roles ¶ added in v0.14.0
func (d RoleSelectMenuInteractionData) Roles() []Role
func (RoleSelectMenuInteractionData) Type ¶ added in v0.14.0
func (RoleSelectMenuInteractionData) Type() ComponentType
func (*RoleSelectMenuInteractionData) UnmarshalJSON ¶ added in v0.14.0
func (d *RoleSelectMenuInteractionData) UnmarshalJSON(data []byte) error
type RoleSelectMenuResolved ¶ added in v0.14.0
type RoleSubscriptionData ¶ added in v0.16.9
type RoleTag ¶
type RoleTag struct {
BotID *snowflake.ID `json:"bot_id,omitempty"`
IntegrationID *snowflake.ID `json:"integration_id,omitempty"`
PremiumSubscriber bool `json:"premium_subscriber"`
SubscriptionListingID *snowflake.ID `json:"subscription_listing_id,omitempty"`
AvailableForPurchase bool `json:"available_for_purchase"`
GuildConnections bool `json:"guild_connections"`
}
RoleTag are tags a Role has
type RoleUpdate ¶
type RoleUpdate struct {
Name *string `json:"name,omitempty"`
Permissions *Permissions `json:"permissions,omitempty"`
Color *int `json:"color,omitempty"`
Colors omit.Omit[*RoleColors] `json:"colors,omitzero"`
Hoist *bool `json:"hoist,omitempty"`
Icon omit.Omit[*Icon] `json:"icon,omitzero"`
Emoji *string `json:"unicode_emoji,omitempty"`
Mentionable *bool `json:"mentionable,omitempty"`
}
RoleUpdate is the payload to update a Role
type SKU ¶ added in v0.16.11
type SKU struct {
ID snowflake.ID `json:"id"`
Type SKUType `json:"type"`
ApplicationID snowflake.ID `json:"application_id"`
Name string `json:"name"`
Slug string `json:"slug"`
DependentSkuID *snowflake.ID `json:"dependent_sku_id"`
AccessType int `json:"access_type"`
Features []string `json:"features"`
ReleaseDate *time.Time `json:"release_date"`
Premium bool `json:"premium"`
Flags SKUFlags `json:"flags"`
ShowAgeGate bool `json:"show_age_gate"`
}
type ScheduledEventEntityType ¶
type ScheduledEventEntityType int
ScheduledEventEntityType the type of the scheduled event (https://discord.com/developers/docs/resources/guild-scheduled-event#guild-scheduled-event-object-guild-scheduled-event-entity-types)
const ( ScheduledEventEntityTypeStageInstance ScheduledEventEntityType = iota + 1 ScheduledEventEntityTypeVoice ScheduledEventEntityTypeExternal )
type ScheduledEventPrivacyLevel ¶
type ScheduledEventPrivacyLevel int
ScheduledEventPrivacyLevel the privacy level of the ScheduledEventPrivacyLevel (https://discord.com/developers/docs/resources/guild-scheduled-event#guild-scheduled-event-object-guild-scheduled-event-privacy-level)
const (
ScheduledEventPrivacyLevelGuildOnly ScheduledEventPrivacyLevel
)
type ScheduledEventRecurrenceRule ¶ added in v0.18.10
type ScheduledEventRecurrenceRule struct {
Start time.Time `json:"start"`
End *time.Time `json:"end"`
Frequency ScheduledEventRecurrenceRuleFrequency `json:"frequency"`
Interval int `json:"interval"`
ByWeekday []ScheduledEventRecurrenceRuleWeekday `json:"by_weekday"`
ByNWeekday []ScheduledEventRecurrenceRuleNWeekday `json:"by_n_weekday"`
ByMonth []ScheduledEventRecurrenceRuleMonth `json:"by_month"`
ByMonthDay []int `json:"by_month_day"`
ByYearDay []int `json:"by_year_day"`
Count *int `json:"count"`
}
type ScheduledEventRecurrenceRuleFrequency ¶ added in v0.18.10
type ScheduledEventRecurrenceRuleFrequency int
const ( ScheduledEventRecurrenceRuleFrequencyYearly ScheduledEventRecurrenceRuleFrequency = iota ScheduledEventRecurrenceRuleFrequencyMonthly ScheduledEventRecurrenceRuleFrequencyWeekly ScheduledEventRecurrenceRuleFrequencyDaily )
type ScheduledEventRecurrenceRuleMonth ¶ added in v0.18.10
type ScheduledEventRecurrenceRuleMonth int
const ( ScheduledEventRecurrenceRuleMonthJanuary ScheduledEventRecurrenceRuleMonth = iota + 1 ScheduledEventRecurrenceRuleMonthFebruary ScheduledEventRecurrenceRuleMonthMarch ScheduledEventRecurrenceRuleMonthApril ScheduledEventRecurrenceRuleMonthMay ScheduledEventRecurrenceRuleMonthJune ScheduledEventRecurrenceRuleMonthJuly ScheduledEventRecurrenceRuleMonthAugust ScheduledEventRecurrenceRuleMonthSeptember ScheduledEventRecurrenceRuleMonthOctober ScheduledEventRecurrenceRuleMonthNovember ScheduledEventRecurrenceRuleMonthDecember )
type ScheduledEventRecurrenceRuleNWeekday ¶ added in v0.18.10
type ScheduledEventRecurrenceRuleNWeekday struct {
N int `json:"n"`
Day ScheduledEventRecurrenceRuleWeekday `json:"day"`
}
type ScheduledEventRecurrenceRuleWeekday ¶ added in v0.18.10
type ScheduledEventRecurrenceRuleWeekday int
const ( ScheduledEventRecurrenceRuleWeekdayMonday ScheduledEventRecurrenceRuleWeekday = iota ScheduledEventRecurrenceRuleWeekdayTuesday ScheduledEventRecurrenceRuleWeekdayWednesday ScheduledEventRecurrenceRuleWeekdayThursday ScheduledEventRecurrenceRuleWeekdayFriday ScheduledEventRecurrenceRuleWeekdaySaturday ScheduledEventRecurrenceRuleWeekdaySunday )
type ScheduledEventStatus ¶
type ScheduledEventStatus int
ScheduledEventStatus the status of the scheduled event (https://discord.com/developers/docs/resources/guild-scheduled-event#guild-scheduled-event-object-guild-scheduled-event-status)
const ( ScheduledEventStatusScheduled ScheduledEventStatus = iota + 1 ScheduledEventStatusActive ScheduledEventStatusCompleted ScheduledEventStatusCancelled )
type SectionAccessoryComponent ¶ added in v0.19.0
type SectionAccessoryComponent interface {
Component
// contains filtered or unexported methods
}
SectionAccessoryComponent is an interface for all components that can be present as an accessory in [SectionComponent.Accessory]. ButtonComponent ThumbnailComponent UnknownComponent
type SectionComponent ¶ added in v0.19.0
type SectionComponent struct {
ID int `json:"id,omitempty"`
Components []SectionSubComponent `json:"components"`
Accessory SectionAccessoryComponent `json:"accessory"`
}
SectionComponent is a component that can contain up to 3 TextDisplayComponent(s) and an optional SectionAccessoryComponent.
func NewSection ¶ added in v0.19.0
func NewSection(components ...SectionSubComponent) SectionComponent
NewSection creates a new SectionComponent with the provided components.
func (SectionComponent) AddComponents ¶ added in v0.19.0
func (c SectionComponent) AddComponents(components ...SectionSubComponent) SectionComponent
AddComponents returns a new SectionComponent with the provided Component(s) added
func (SectionComponent) GetID ¶ added in v0.19.0
func (c SectionComponent) GetID() int
func (SectionComponent) MarshalJSON ¶ added in v0.19.0
func (c SectionComponent) MarshalJSON() ([]byte, error)
func (SectionComponent) RemoveComponent ¶ added in v0.19.0
func (c SectionComponent) RemoveComponent(id int) SectionComponent
RemoveComponent returns a new SectionComponent with the provided Component which has the provided id removed.
func (SectionComponent) SubComponents ¶ added in v0.19.0
func (c SectionComponent) SubComponents() iter.Seq[Component]
SubComponents returns an [iter.Seq[Component]] over the sub Component(s) and Accessory of the SectionComponent.
func (SectionComponent) Type ¶ added in v0.19.0
func (SectionComponent) Type() ComponentType
func (*SectionComponent) UnmarshalJSON ¶ added in v0.19.0
func (c *SectionComponent) UnmarshalJSON(data []byte) error
func (SectionComponent) UpdateComponent ¶ added in v0.19.0
func (c SectionComponent) UpdateComponent(id int, component SectionSubComponent) SectionComponent
UpdateComponent returns a new SectionComponent with the Component which has the id replaced with the provided Component.
func (SectionComponent) WithAccessory ¶ added in v0.19.0
func (c SectionComponent) WithAccessory(accessory SectionAccessoryComponent) SectionComponent
WithAccessory returns a new SectionComponent with the provided accessory
func (SectionComponent) WithComponents ¶ added in v0.19.0
func (c SectionComponent) WithComponents(components ...SectionSubComponent) SectionComponent
WithComponents returns a new SectionComponent with the provided components
func (SectionComponent) WithID ¶ added in v0.19.0
func (c SectionComponent) WithID(id int) SectionComponent
WithID returns a new SectionComponent with the provided id
type SectionSubComponent ¶ added in v0.19.0
type SectionSubComponent interface {
Component
// contains filtered or unexported methods
}
SectionSubComponent is an interface for all components that can be present in a SectionComponent. TextDisplayComponent UnknownComponent
type SelectMenuComponent ¶
type SelectMenuComponent interface {
InteractiveComponent
// contains filtered or unexported methods
}
SelectMenuComponent is an interface for all components that are select menus. StringSelectMenuComponent UserSelectMenuComponent RoleSelectMenuComponent MentionableSelectMenuComponent ChannelSelectMenuComponent UnknownComponent
type SelectMenuDefaultValue ¶ added in v0.16.10
type SelectMenuDefaultValue struct {
Type SelectMenuDefaultValueType `json:"type"`
ID snowflake.ID `json:"id"`
}
func NewSelectMenuDefaultChannel ¶ added in v0.16.10
func NewSelectMenuDefaultChannel(id snowflake.ID) SelectMenuDefaultValue
NewSelectMenuDefaultChannel returns a new SelectMenuDefaultValue of type SelectMenuDefaultValueTypeChannel
func NewSelectMenuDefaultRole ¶ added in v0.16.10
func NewSelectMenuDefaultRole(id snowflake.ID) SelectMenuDefaultValue
NewSelectMenuDefaultRole returns a new SelectMenuDefaultValue of type SelectMenuDefaultValueTypeRole
func NewSelectMenuDefaultUser ¶ added in v0.16.10
func NewSelectMenuDefaultUser(id snowflake.ID) SelectMenuDefaultValue
NewSelectMenuDefaultUser returns a new SelectMenuDefaultValue of type SelectMenuDefaultValueTypeUser
type SelectMenuDefaultValueType ¶ added in v0.16.10
type SelectMenuDefaultValueType string
const ( SelectMenuDefaultValueTypeUser SelectMenuDefaultValueType = "user" SelectMenuDefaultValueTypeRole SelectMenuDefaultValueType = "role" SelectMenuDefaultValueTypeChannel SelectMenuDefaultValueType = "channel" )
type SelectMenuInteractionData ¶
type SelectMenuInteractionData interface {
ComponentInteractionData
// contains filtered or unexported methods
}
type SendSoundboardSound ¶ added in v0.18.13
type SeparatorComponent ¶ added in v0.19.0
type SeparatorComponent struct {
ID int `json:"id,omitempty"`
// Divider determines if the separator should have a divider line. (default: true)
Divider *bool `json:"divider,omitempty"`
Spacing SeparatorSpacingSize `json:"spacing,omitempty"`
}
SeparatorComponent is a component that adds a visual divider between components.
func NewLargeSeparator ¶ added in v0.19.0
func NewLargeSeparator() SeparatorComponent
NewLargeSeparator creates a new SeparatorComponent with the large spacing.
func NewSeparator ¶ added in v0.19.0
func NewSeparator(spacing SeparatorSpacingSize) SeparatorComponent
NewSeparator creates a new SeparatorComponent with the provided spacing.
func NewSmallSeparator ¶ added in v0.19.0
func NewSmallSeparator() SeparatorComponent
NewSmallSeparator creates a new SeparatorComponent with the small spacing.
func (SeparatorComponent) GetID ¶ added in v0.19.0
func (c SeparatorComponent) GetID() int
func (SeparatorComponent) MarshalJSON ¶ added in v0.19.0
func (c SeparatorComponent) MarshalJSON() ([]byte, error)
func (SeparatorComponent) Type ¶ added in v0.19.0
func (SeparatorComponent) Type() ComponentType
func (SeparatorComponent) WithDivider ¶ added in v0.19.0
func (c SeparatorComponent) WithDivider(divider bool) SeparatorComponent
func (SeparatorComponent) WithID ¶ added in v0.19.0
func (c SeparatorComponent) WithID(i int) LayoutComponent
func (SeparatorComponent) WithSpacing ¶ added in v0.19.0
func (c SeparatorComponent) WithSpacing(spacing SeparatorSpacingSize) SeparatorComponent
type SeparatorSpacingSize ¶ added in v0.19.0
type SeparatorSpacingSize int
const ( SeparatorSpacingSizeSmall SeparatorSpacingSize = iota + 1 SeparatorSpacingSizeLarge )
type SessionStartLimit ¶
type SlashCommand ¶
type SlashCommand struct {
Description string
DescriptionLocalizations map[Locale]string
DescriptionLocalized string
Options []ApplicationCommandOption
// contains filtered or unexported fields
}
func (SlashCommand) ApplicationID ¶
func (c SlashCommand) ApplicationID() snowflake.ID
func (SlashCommand) Contexts ¶ added in v0.18.0
func (c SlashCommand) Contexts() []InteractionContextType
func (SlashCommand) CreatedAt ¶ added in v0.13.17
func (c SlashCommand) CreatedAt() time.Time
func (SlashCommand) DMPermission ¶ added in v0.10.2
func (c SlashCommand) DMPermission() bool
func (SlashCommand) DefaultMemberPermissions ¶ added in v0.10.2
func (c SlashCommand) DefaultMemberPermissions() Permissions
func (SlashCommand) GuildID ¶
func (c SlashCommand) GuildID() *snowflake.ID
func (SlashCommand) ID ¶
func (c SlashCommand) ID() snowflake.ID
func (SlashCommand) IntegrationTypes ¶ added in v0.18.0
func (c SlashCommand) IntegrationTypes() []ApplicationIntegrationType
func (SlashCommand) MarshalJSON ¶
func (c SlashCommand) MarshalJSON() ([]byte, error)
func (SlashCommand) Mention ¶ added in v0.13.17
func (c SlashCommand) Mention() string
func (SlashCommand) NSFW ¶ added in v0.14.0
func (c SlashCommand) NSFW() bool
func (SlashCommand) Name ¶
func (c SlashCommand) Name() string
func (SlashCommand) NameLocalizations ¶
func (c SlashCommand) NameLocalizations() map[Locale]string
func (SlashCommand) NameLocalized ¶
func (c SlashCommand) NameLocalized() string
func (SlashCommand) Type ¶
func (SlashCommand) Type() ApplicationCommandType
func (*SlashCommand) UnmarshalJSON ¶
func (c *SlashCommand) UnmarshalJSON(data []byte) error
func (SlashCommand) Version ¶
func (c SlashCommand) Version() snowflake.ID
type SlashCommandCreate ¶
type SlashCommandCreate struct {
Name string `json:"name"`
NameLocalizations map[Locale]string `json:"name_localizations,omitempty"`
Description string `json:"description"`
DescriptionLocalizations map[Locale]string `json:"description_localizations,omitempty"`
Options []ApplicationCommandOption `json:"options,omitempty"`
DefaultMemberPermissions omit.Omit[*Permissions] `json:"default_member_permissions,omitzero"` // different behavior for 0 and null, optional
IntegrationTypes []ApplicationIntegrationType `json:"integration_types,omitempty"`
Contexts []InteractionContextType `json:"contexts,omitempty"`
NSFW *bool `json:"nsfw,omitempty"`
}
func (SlashCommandCreate) CommandName ¶
func (c SlashCommandCreate) CommandName() string
func (SlashCommandCreate) MarshalJSON ¶
func (c SlashCommandCreate) MarshalJSON() ([]byte, error)
func (SlashCommandCreate) Type ¶
func (SlashCommandCreate) Type() ApplicationCommandType
type SlashCommandInteractionData ¶
type SlashCommandInteractionData struct {
SubCommandName *string
SubCommandGroupName *string
Resolved ResolvedData
Options map[string]SlashCommandOption
// contains filtered or unexported fields
}
func (SlashCommandInteractionData) All ¶
func (d SlashCommandInteractionData) All() []SlashCommandOption
func (SlashCommandInteractionData) Attachment ¶ added in v0.12.0
func (d SlashCommandInteractionData) Attachment(name string) Attachment
func (SlashCommandInteractionData) Bool ¶
func (d SlashCommandInteractionData) Bool(name string) bool
func (SlashCommandInteractionData) Channel ¶
func (d SlashCommandInteractionData) Channel(name string) ResolvedChannel
func (SlashCommandInteractionData) CommandID ¶
func (d SlashCommandInteractionData) CommandID() snowflake.ID
func (SlashCommandInteractionData) CommandName ¶
func (d SlashCommandInteractionData) CommandName() string
func (SlashCommandInteractionData) CommandPath ¶ added in v0.15.0
func (d SlashCommandInteractionData) CommandPath() string
func (SlashCommandInteractionData) Find ¶
func (d SlashCommandInteractionData) Find(optionFindFunc func(option SlashCommandOption) bool) (SlashCommandOption, bool)
func (SlashCommandInteractionData) FindAll ¶
func (d SlashCommandInteractionData) FindAll(optionFindFunc func(option SlashCommandOption) bool) []SlashCommandOption
func (SlashCommandInteractionData) Float ¶
func (d SlashCommandInteractionData) Float(name string) float64
func (SlashCommandInteractionData) GetByType ¶
func (d SlashCommandInteractionData) GetByType(optionType ApplicationCommandOptionType) []SlashCommandOption
func (SlashCommandInteractionData) GuildID ¶ added in v0.8.9
func (d SlashCommandInteractionData) GuildID() *snowflake.ID
func (SlashCommandInteractionData) Int ¶
func (d SlashCommandInteractionData) Int(name string) int
func (SlashCommandInteractionData) MarshalJSON ¶
func (d SlashCommandInteractionData) MarshalJSON() ([]byte, error)
func (SlashCommandInteractionData) Member ¶
func (d SlashCommandInteractionData) Member(name string) ResolvedMember
func (SlashCommandInteractionData) Mentionable ¶ added in v0.19.0
func (d SlashCommandInteractionData) Mentionable(name string) MentionableValue
Mentionable tries to resolve the mentionable option by checking members, users, roles, and channels in that order. It either returns: ResolvedMember, User, ResolvedMember or ResolvedChannel
func (SlashCommandInteractionData) OptAttachment ¶ added in v0.12.0
func (d SlashCommandInteractionData) OptAttachment(name string) (Attachment, bool)
func (SlashCommandInteractionData) OptBool ¶
func (d SlashCommandInteractionData) OptBool(name string) (bool, bool)
func (SlashCommandInteractionData) OptChannel ¶
func (d SlashCommandInteractionData) OptChannel(name string) (ResolvedChannel, bool)
func (SlashCommandInteractionData) OptFloat ¶
func (d SlashCommandInteractionData) OptFloat(name string) (float64, bool)
func (SlashCommandInteractionData) OptInt ¶
func (d SlashCommandInteractionData) OptInt(name string) (int, bool)
func (SlashCommandInteractionData) OptMember ¶
func (d SlashCommandInteractionData) OptMember(name string) (ResolvedMember, bool)
func (SlashCommandInteractionData) OptMentionable ¶ added in v0.19.0
func (d SlashCommandInteractionData) OptMentionable(name string) (MentionableValue, bool)
OptMentionable tries to resolve the mentionable option by checking members, users, roles, and channels in that order. It either returns: ResolvedMember, User, ResolvedMember or ResolvedChannel
func (SlashCommandInteractionData) OptRole ¶
func (d SlashCommandInteractionData) OptRole(name string) (Role, bool)
func (SlashCommandInteractionData) OptSnowflake ¶
func (d SlashCommandInteractionData) OptSnowflake(name string) (snowflake.ID, bool)
func (SlashCommandInteractionData) OptString ¶
func (d SlashCommandInteractionData) OptString(name string) (string, bool)
func (SlashCommandInteractionData) OptUser ¶
func (d SlashCommandInteractionData) OptUser(name string) (User, bool)
func (SlashCommandInteractionData) Option ¶
func (d SlashCommandInteractionData) Option(name string) (SlashCommandOption, bool)
func (SlashCommandInteractionData) Role ¶
func (d SlashCommandInteractionData) Role(name string) Role
func (SlashCommandInteractionData) Snowflake ¶
func (d SlashCommandInteractionData) Snowflake(name string) snowflake.ID
func (SlashCommandInteractionData) String ¶
func (d SlashCommandInteractionData) String(name string) string
func (SlashCommandInteractionData) Type ¶
func (SlashCommandInteractionData) Type() ApplicationCommandType
func (*SlashCommandInteractionData) UnmarshalJSON ¶
func (d *SlashCommandInteractionData) UnmarshalJSON(data []byte) error
func (SlashCommandInteractionData) User ¶
func (d SlashCommandInteractionData) User(name string) User
type SlashCommandOption ¶
type SlashCommandOption struct {
Name string `json:"name"`
Type ApplicationCommandOptionType `json:"type"`
Value json.RawMessage `json:"value"`
}
func (SlashCommandOption) Bool ¶ added in v0.19.0
func (o SlashCommandOption) Bool() bool
Bool returns the bool value of the option. If the type is not ApplicationCommandOptionTypeBool, it panics.
func (SlashCommandOption) Float ¶ added in v0.19.0
func (o SlashCommandOption) Float() float64
Float returns the float value of the option. If the type is not ApplicationCommandOptionTypeFloat, it panics.
func (SlashCommandOption) Int ¶ added in v0.19.0
func (o SlashCommandOption) Int() int
Int returns the int value of the option. If the type is not ApplicationCommandOptionTypeInt, it panics.
func (SlashCommandOption) Snowflake ¶ added in v0.19.0
func (o SlashCommandOption) Snowflake() snowflake.ID
Snowflake returns the snowflake value of the option. If the type is not ApplicationCommandOptionTypeUser, ApplicationCommandOptionTypeChannel, ApplicationCommandOptionTypeRole or ApplicationCommandOptionTypeMentionable, it panics.
func (SlashCommandOption) String ¶ added in v0.19.0
func (o SlashCommandOption) String() string
String returns the string value of the option. If the type is not ApplicationCommandOptionTypeString, it panics.
type SlashCommandOptionSubCommand ¶
type SlashCommandOptionSubCommand struct {
Name string `json:"name"`
Type ApplicationCommandOptionType `json:"type"`
Options []SlashCommandOption `json:"options,omitempty"`
}
type SlashCommandOptionSubCommandGroup ¶
type SlashCommandOptionSubCommandGroup struct {
Name string `json:"name"`
Type ApplicationCommandOptionType `json:"type"`
Options []SlashCommandOptionSubCommand `json:"options,omitempty"`
}
type SlashCommandUpdate ¶
type SlashCommandUpdate struct {
Name *string `json:"name,omitempty"`
NameLocalizations *map[Locale]string `json:"name_localizations,omitempty"`
Description *string `json:"description,omitempty"`
DescriptionLocalizations *map[Locale]string `json:"description_localizations,omitempty"`
Options *[]ApplicationCommandOption `json:"options,omitempty"`
DefaultMemberPermissions omit.Omit[*Permissions] `json:"default_member_permissions,omitzero"`
IntegrationTypes *[]ApplicationIntegrationType `json:"integration_types,omitempty"`
Contexts *[]InteractionContextType `json:"contexts,omitempty"`
NSFW *bool `json:"nsfw,omitempty"`
}
func (SlashCommandUpdate) CommandName ¶
func (c SlashCommandUpdate) CommandName() *string
func (SlashCommandUpdate) MarshalJSON ¶
func (c SlashCommandUpdate) MarshalJSON() ([]byte, error)
func (SlashCommandUpdate) Type ¶
func (SlashCommandUpdate) Type() ApplicationCommandType
type Sound ¶ added in v0.18.13
func NewSoundRaw ¶ added in v0.18.13
func (Sound) MarshalJSON ¶ added in v0.18.13
type SoundType ¶ added in v0.18.13
type SoundType string
const ( SoundTypeMP3 SoundType = "audio/mpeg" SoundTypeOGG SoundType = "audio/ogg" SoundTypeWAV SoundType = "audio/wav" SoundTypeUnknown = SoundTypeMP3 )
type SoundboardSound ¶ added in v0.18.13
type SoundboardSound struct {
Name string `json:"name"`
SoundID snowflake.ID `json:"sound_id"`
Volume float64 `json:"volume"`
EmojiID *snowflake.ID `json:"emoji_id"`
EmojiName *string `json:"emoji_name"`
GuildID *snowflake.ID `json:"guild_id,omitempty"`
Available *bool `json:"available,omitempty"`
User *User `json:"user,omitempty"`
}
func (SoundboardSound) URL ¶ added in v0.18.13
func (s SoundboardSound) URL(opts ...CDNOpt) string
type SoundboardSoundCreate ¶ added in v0.18.13
type SoundboardSoundUpdate ¶ added in v0.18.13
type StageInstance ¶
type StageInstance struct {
ID snowflake.ID `json:"id"`
GuildID snowflake.ID `json:"guild_id"`
ChannelID snowflake.ID `json:"channel_id"`
Topic string `json:"topic"`
PrivacyLevel StagePrivacyLevel `json:"privacy_level"`
DiscoverableDisabled bool `json:"discoverable_disabled"`
}
func (StageInstance) CreatedAt ¶ added in v0.13.17
func (e StageInstance) CreatedAt() time.Time
type StageInstanceCreate ¶
type StageInstanceCreate struct {
ChannelID snowflake.ID `json:"channel_id"`
Topic string `json:"topic,omitempty"`
PrivacyLevel StagePrivacyLevel `json:"privacy_level,omitempty"`
SendStartNotification bool `json:"send_start_notification,omitempty"`
GuildScheduledEventID snowflake.ID `json:"guild_scheduled_event_id,omitempty"`
}
type StageInstanceUpdate ¶
type StageInstanceUpdate struct {
Topic *string `json:"topic,omitempty"`
PrivacyLevel *StagePrivacyLevel `json:"privacy_level,omitempty"`
}
type StagePrivacyLevel ¶
type StagePrivacyLevel int
const ( StagePrivacyLevelPublic StagePrivacyLevel = iota + 1 StagePrivacyLevelGuildOnly )
type Sticker ¶
type Sticker struct {
ID snowflake.ID `json:"id"`
PackID *snowflake.ID `json:"pack_id"`
Name string `json:"name"`
Description string `json:"description"`
Tags string `json:"tags"`
Type StickerType `json:"type"`
FormatType StickerFormatType `json:"format_type"`
Available *bool `json:"available"`
GuildID *snowflake.ID `json:"guild_id,omitempty"`
User *User `json:"user,omitempty"`
SortValue *int `json:"sort_value"`
}
Sticker is a sticker sent with a Message
type StickerCreate ¶
type StickerCreate struct {
Name string `json:"name"`
Description string `json:"description,omitempty"`
Tags string `json:"tags"`
File *File `json:"-"`
}
func (StickerCreate) ToBody ¶
func (c StickerCreate) ToBody() (any, error)
ToBody returns the MessageCreate ready for body
type StickerFormatType ¶
type StickerFormatType int
StickerFormatType is the Format type of Sticker
const ( StickerFormatTypePNG StickerFormatType = iota + 1 StickerFormatTypeAPNG StickerFormatTypeLottie StickerFormatTypeGIF )
Constants for StickerFormatType
type StickerPack ¶
type StickerPack struct {
ID snowflake.ID `json:"id"`
Stickers []Sticker `json:"stickers"`
Name string `json:"name"`
SkuID snowflake.ID `json:"sku_id"`
CoverStickerID snowflake.ID `json:"cover_sticker_id"`
Description string `json:"description"`
BannerAssetID *snowflake.ID `json:"banner_asset_id"`
}
func (StickerPack) BannerURL ¶
func (p StickerPack) BannerURL(opts ...CDNOpt) *string
type StickerPacks ¶
type StickerPacks struct {
StickerPacks []StickerPack `json:"sticker_packs"`
}
type StickerType ¶
type StickerType int
const ( StickerTypeStandard StickerType = iota + 1 StickerTypeGuild )
type StickerUpdate ¶
type StringSelectMenuComponent ¶ added in v0.14.0
type StringSelectMenuComponent struct {
ID int `json:"id,omitempty"`
CustomID string `json:"custom_id"`
Placeholder string `json:"placeholder,omitempty"`
// MinValues is the minimum number of options that can be selected.
// Defaults to 1. Minimum is 0. Maximum is 25.
MinValues *int `json:"min_values,omitempty"`
// MaxValues is the maximum number of options that can be selected.
// Defaults to 1. Maximum is 25.
MaxValues int `json:"max_values,omitempty"`
Options []StringSelectMenuOption `json:"options,omitempty"`
// Required Indicates if the select menu is required to submit the Modal.
Required bool `json:"required"`
// Disabled whether the select menu is disabled (only supported in messages)
Disabled bool `json:"disabled"`
// Values is only set when the StringSelectMenuComponent is received from an InteractionTypeModalSubmit
Values []string `json:"values,omitempty"`
}
StringSelectMenuComponent represents a select menu component that allows users to select 0 to 25 options from a list of StringSelectMenuOption.
func NewStringSelectMenu ¶ added in v0.14.0
func NewStringSelectMenu(customID string, placeholder string, options ...StringSelectMenuOption) StringSelectMenuComponent
NewStringSelectMenu builds a new SelectMenuComponent from the provided values
func (StringSelectMenuComponent) AddOptions ¶ added in v0.14.0
func (c StringSelectMenuComponent) AddOptions(options ...StringSelectMenuOption) StringSelectMenuComponent
AddOptions returns a new StringSelectMenuComponent with the provided StringSelectMenuOption(s) added
func (StringSelectMenuComponent) AsDisabled ¶ added in v0.14.0
func (c StringSelectMenuComponent) AsDisabled() StringSelectMenuComponent
AsDisabled returns a new StringSelectMenuComponent but disabled
func (StringSelectMenuComponent) AsEnabled ¶ added in v0.14.0
func (c StringSelectMenuComponent) AsEnabled() StringSelectMenuComponent
AsEnabled returns a new StringSelectMenuComponent but enabled
func (StringSelectMenuComponent) GetCustomID ¶ added in v0.19.0
func (c StringSelectMenuComponent) GetCustomID() string
func (StringSelectMenuComponent) GetID ¶ added in v0.19.0
func (c StringSelectMenuComponent) GetID() int
func (StringSelectMenuComponent) MarshalJSON ¶ added in v0.14.0
func (c StringSelectMenuComponent) MarshalJSON() ([]byte, error)
func (StringSelectMenuComponent) RemoveOption ¶ added in v0.14.0
func (c StringSelectMenuComponent) RemoveOption(index int) StringSelectMenuComponent
RemoveOption returns a new StringSelectMenuComponent with the provided StringSelectMenuOption at the index removed
func (StringSelectMenuComponent) SetOption ¶ added in v0.14.0
func (c StringSelectMenuComponent) SetOption(value string, option StringSelectMenuOption) StringSelectMenuComponent
SetOption returns a new StringSelectMenuComponent with the StringSelectMenuOption which has the value replaced
func (StringSelectMenuComponent) SetOptions ¶ added in v0.14.0
func (c StringSelectMenuComponent) SetOptions(options ...StringSelectMenuOption) StringSelectMenuComponent
SetOptions returns a new StringSelectMenuComponent with the provided StringSelectMenuOption(s)
func (StringSelectMenuComponent) Type ¶ added in v0.14.0
func (StringSelectMenuComponent) Type() ComponentType
func (StringSelectMenuComponent) WithCustomID ¶ added in v0.14.0
func (c StringSelectMenuComponent) WithCustomID(customID string) StringSelectMenuComponent
WithCustomID returns a new StringSelectMenuComponent with the provided customID
func (StringSelectMenuComponent) WithDisabled ¶ added in v0.14.0
func (c StringSelectMenuComponent) WithDisabled(disabled bool) StringSelectMenuComponent
WithDisabled returns a new StringSelectMenuComponent with the provided disabled
func (StringSelectMenuComponent) WithID ¶ added in v0.19.0
func (c StringSelectMenuComponent) WithID(id int) StringSelectMenuComponent
WithID returns a new StringSelectMenuComponent with the provided ID
func (StringSelectMenuComponent) WithMaxValues ¶ added in v0.14.0
func (c StringSelectMenuComponent) WithMaxValues(maxValue int) StringSelectMenuComponent
WithMaxValues returns a new StringSelectMenuComponent with the provided maxValue
func (StringSelectMenuComponent) WithMinValues ¶ added in v0.14.0
func (c StringSelectMenuComponent) WithMinValues(minValue int) StringSelectMenuComponent
WithMinValues returns a new StringSelectMenuComponent with the provided minValue
func (StringSelectMenuComponent) WithPlaceholder ¶ added in v0.14.0
func (c StringSelectMenuComponent) WithPlaceholder(placeholder string) StringSelectMenuComponent
WithPlaceholder returns a new StringSelectMenuComponent with the provided placeholder
func (StringSelectMenuComponent) WithRequired ¶ added in v0.19.0
func (c StringSelectMenuComponent) WithRequired(required bool) StringSelectMenuComponent
WithRequired returns a new StringSelectMenuComponent with the provided required value
type StringSelectMenuInteractionData ¶ added in v0.14.0
type StringSelectMenuInteractionData struct {
Values []string
// contains filtered or unexported fields
}
func (StringSelectMenuInteractionData) CustomID ¶ added in v0.14.0
func (d StringSelectMenuInteractionData) CustomID() string
func (StringSelectMenuInteractionData) MarshalJSON ¶ added in v0.14.0
func (d StringSelectMenuInteractionData) MarshalJSON() ([]byte, error)
func (StringSelectMenuInteractionData) Type ¶ added in v0.14.0
func (StringSelectMenuInteractionData) Type() ComponentType
func (*StringSelectMenuInteractionData) UnmarshalJSON ¶ added in v0.14.0
func (d *StringSelectMenuInteractionData) UnmarshalJSON(data []byte) error
type StringSelectMenuOption ¶ added in v0.14.0
type StringSelectMenuOption struct {
ID int `json:"id,omitempty"`
Label string `json:"label"`
Value string `json:"value"`
Description string `json:"description,omitempty"`
Emoji *ComponentEmoji `json:"emoji,omitempty"`
Default bool `json:"default,omitempty"`
}
StringSelectMenuOption represents an option in a StringSelectMenuComponent
func NewStringSelectMenuOption ¶ added in v0.14.0
func NewStringSelectMenuOption(label string, value string) StringSelectMenuOption
NewStringSelectMenuOption builds a new StringSelectMenuOption
func (StringSelectMenuOption) WithDefault ¶ added in v0.14.0
func (o StringSelectMenuOption) WithDefault(defaultOption bool) StringSelectMenuOption
WithDefault returns a new StringSelectMenuOption as default/non-default
func (StringSelectMenuOption) WithDescription ¶ added in v0.14.0
func (o StringSelectMenuOption) WithDescription(description string) StringSelectMenuOption
WithDescription returns a new StringSelectMenuOption with the provided description
func (StringSelectMenuOption) WithEmoji ¶ added in v0.14.0
func (o StringSelectMenuOption) WithEmoji(emoji ComponentEmoji) StringSelectMenuOption
WithEmoji returns a new StringSelectMenuOption with the provided Emoji
func (StringSelectMenuOption) WithLabel ¶ added in v0.14.0
func (o StringSelectMenuOption) WithLabel(label string) StringSelectMenuOption
WithLabel returns a new StringSelectMenuOption with the provided label
func (StringSelectMenuOption) WithValue ¶ added in v0.14.0
func (o StringSelectMenuOption) WithValue(value string) StringSelectMenuOption
WithValue returns a new StringSelectMenuOption with the provided value
type Subscription ¶ added in v0.18.11
type Subscription struct {
ID snowflake.ID `json:"id"`
UserID snowflake.ID `json:"user_id"`
SkuIDs []snowflake.ID `json:"sku_ids"`
EntitlementIDs []snowflake.ID `json:"entitlement_ids"`
RenewalSkuIDs []snowflake.ID `json:"renewal_sku_ids"`
CurrentPeriodStart time.Time `json:"current_period_start"`
CurrentPeriodEnd time.Time `json:"current_period_end"`
Status SubscriptionStatus `json:"status"`
CanceledAt *time.Time `json:"canceled_at"`
Country *string `json:"country"`
}
type SubscriptionStatus ¶ added in v0.18.11
type SubscriptionStatus int
const ( SubscriptionStatusActive SubscriptionStatus = iota SubscriptionStatusEnding SubscriptionStatusInactive )
type SystemChannelFlags ¶
type SystemChannelFlags int
SystemChannelFlags contains the settings for the Guild(s) system channel
const ( SystemChannelFlagSuppressJoinNotifications SystemChannelFlags = 1 << iota SystemChannelFlagSuppressPremiumSubscriptions SystemChannelFlagSuppressGuildReminderNotifications SystemChannelFlagSuppressJoinNotificationReplies SystemChannelFlagSuppressRoleSubscriptionPurchaseNotifications SystemChannelFlagSuppressRoleSubscriptionPurchaseNotificationReplies )
Constants for SystemChannelFlags
func (SystemChannelFlags) Add ¶ added in v0.13.21
func (f SystemChannelFlags) Add(bits ...SystemChannelFlags) SystemChannelFlags
Add allows you to add multiple bits together, producing a new bit
func (SystemChannelFlags) Has ¶ added in v0.13.21
func (f SystemChannelFlags) Has(bits ...SystemChannelFlags) bool
Has will ensure that the bit includes all the bits entered
func (SystemChannelFlags) Missing ¶ added in v0.13.21
func (f SystemChannelFlags) Missing(bits ...SystemChannelFlags) bool
Missing will check whether the bit is missing any one of the bits
func (SystemChannelFlags) Remove ¶ added in v0.13.21
func (f SystemChannelFlags) Remove(bits ...SystemChannelFlags) SystemChannelFlags
Remove allows you to subtract multiple bits from the first, producing a new bit
type TargetUsersJobStatus ¶ added in v0.19.0
type TargetUsersJobStatusCode ¶ added in v0.19.0
type TargetUsersJobStatusCode int
TargetUsersJobStatusCode indicates the status of creating or updating target users of invite
const ( TargetUsersJobStatusCodeUnspecified TargetUsersJobStatusCode = iota TargetUsersJobStatusCodeProcessing TargetUsersJobStatusCodeCompleted TargetUsersJobStatusCodeFailed )
all TargetUsersJobStatusCode
type Team ¶
type TeamMember ¶
type TeamMember struct {
MembershipState MembershipState `json:"membership_state"`
TeamID snowflake.ID `json:"team_id"`
User User `json:"user"`
Role TeamRole `json:"role"`
}
type TemplateGuild ¶
type TemplateGuild struct {
Name string `json:"name"`
Description *string `json:"description"`
Icon *string `json:"icon_hash"`
VerificationLevel VerificationLevel `json:"verification_level"`
DefaultMessageNotifications MessageNotificationsLevel `json:"default_message_notifications"`
ExplicitContentFilter ExplicitContentFilterLevel `json:"explicit_content_filter"`
SystemChannelID *snowflake.ID `json:"system_channel_id"`
SystemChannelFlags SystemChannelFlags `json:"system_channel_flags"`
PreferredLocale string `json:"preferred_locale"`
AfkChannelID *snowflake.ID `json:"afk_channel_id"`
AfkTimeout int `json:"afk_timeout"`
Roles []GuildCreateRole `json:"roles"`
Channels []GuildCreateChannel `json:"channels"`
}
type TestEntitlementCreate ¶ added in v0.16.11
type TestEntitlementCreate struct {
SkuID snowflake.ID `json:"sku_id"`
OwnerID snowflake.ID `json:"owner_id"`
OwnerType EntitlementOwnerType `json:"owner_type"`
}
type TextDisplayComponent ¶ added in v0.19.0
TextDisplayComponent is a component that displays text.
func NewTextDisplay ¶ added in v0.19.0
func NewTextDisplay(content string) TextDisplayComponent
NewTextDisplay creates a new TextDisplayComponent with the provided content.
func NewTextDisplayf ¶ added in v0.19.0
func NewTextDisplayf(content string, a ...any) TextDisplayComponent
NewTextDisplayf creates a new TextDisplayComponent with the provided content and format.
func (TextDisplayComponent) GetID ¶ added in v0.19.0
func (c TextDisplayComponent) GetID() int
func (TextDisplayComponent) MarshalJSON ¶ added in v0.19.0
func (c TextDisplayComponent) MarshalJSON() ([]byte, error)
func (TextDisplayComponent) Type ¶ added in v0.19.0
func (TextDisplayComponent) Type() ComponentType
func (TextDisplayComponent) WithContent ¶ added in v0.19.0
func (c TextDisplayComponent) WithContent(content string) TextDisplayComponent
func (TextDisplayComponent) WithID ¶ added in v0.19.0
func (c TextDisplayComponent) WithID(i int) SectionSubComponent
type TextInputComponent ¶
type TextInputComponent struct {
ID int `json:"id,omitempty"`
CustomID string `json:"custom_id"`
Style TextInputStyle `json:"style"`
MinLength *int `json:"min_length,omitempty"`
MaxLength int `json:"max_length,omitempty"`
Required bool `json:"required"`
Placeholder string `json:"placeholder,omitempty"`
Value string `json:"value,omitempty"`
}
TextInputComponent is a component that allows users to input text. Discord Docs
func NewParagraphTextInput ¶
func NewParagraphTextInput(customID string) TextInputComponent
NewParagraphTextInput creates a new TextInputComponent with TextInputStyleParagraph & the provided parameters
func NewShortTextInput ¶
func NewShortTextInput(customID string) TextInputComponent
NewShortTextInput creates a new TextInputComponent with TextInputStyleShort & the provided parameters
func NewTextInput ¶
func NewTextInput(customID string, style TextInputStyle) TextInputComponent
NewTextInput creates a new TextInputComponent with the provided parameters.
func (TextInputComponent) GetCustomID ¶ added in v0.19.0
func (c TextInputComponent) GetCustomID() string
func (TextInputComponent) GetID ¶ added in v0.19.0
func (c TextInputComponent) GetID() int
func (TextInputComponent) MarshalJSON ¶
func (c TextInputComponent) MarshalJSON() ([]byte, error)
func (TextInputComponent) Type ¶
func (TextInputComponent) Type() ComponentType
func (TextInputComponent) WithCustomID ¶
func (c TextInputComponent) WithCustomID(customID string) TextInputComponent
WithCustomID returns a new SelectMenuComponent with the provided customID
func (TextInputComponent) WithID ¶ added in v0.19.0
func (c TextInputComponent) WithID(id int) TextInputComponent
WithID returns a new TextInputComponent with the provided id
func (TextInputComponent) WithMaxLength ¶
func (c TextInputComponent) WithMaxLength(maxLength int) TextInputComponent
WithMaxLength returns a new TextInputComponent with the provided maxLength
func (TextInputComponent) WithMinLength ¶
func (c TextInputComponent) WithMinLength(minLength int) TextInputComponent
WithMinLength returns a new TextInputComponent with the provided minLength
func (TextInputComponent) WithPlaceholder ¶
func (c TextInputComponent) WithPlaceholder(placeholder string) TextInputComponent
WithPlaceholder returns a new TextInputComponent with the provided placeholder
func (TextInputComponent) WithRequired ¶
func (c TextInputComponent) WithRequired(required bool) TextInputComponent
WithRequired returns a new TextInputComponent with the provided required
func (TextInputComponent) WithStyle ¶
func (c TextInputComponent) WithStyle(style TextInputStyle) TextInputComponent
WithStyle returns a new SelectMenuComponent with the provided TextInputStyle
func (TextInputComponent) WithValue ¶
func (c TextInputComponent) WithValue(value string) TextInputComponent
WithValue returns a new TextInputComponent with the provided value
type TextInputStyle ¶
type TextInputStyle int
const ( TextInputStyleShort TextInputStyle = iota + 1 TextInputStyleParagraph )
type ThreadChannelPost ¶ added in v0.16.8
type ThreadChannelPost struct {
GuildThread
Message Message `json:"message"`
}
func (ThreadChannelPost) MarshalJSON ¶ added in v0.19.0
func (c ThreadChannelPost) MarshalJSON() ([]byte, error)
func (*ThreadChannelPost) UnmarshalJSON ¶ added in v0.19.0
func (c *ThreadChannelPost) UnmarshalJSON(data []byte) error
type ThreadChannelPostCreate ¶ added in v0.16.8
type ThreadChannelPostCreate struct {
Name string `json:"name"`
AutoArchiveDuration AutoArchiveDuration `json:"auto_archive_duration,omitempty"`
RateLimitPerUser int `json:"rate_limit_per_user,omitempty"`
Message MessageCreate `json:"message"`
AppliedTags []snowflake.ID `json:"applied_tags,omitempty"`
}
func (ThreadChannelPostCreate) ToBody ¶ added in v0.16.8
func (c ThreadChannelPostCreate) ToBody() (any, error)
type ThreadCreate ¶
type ThreadCreate interface {
json.Marshaler
Type() ChannelType
}
type ThreadCreateFromMessage ¶ added in v0.13.12
type ThreadCreateFromMessage struct {
Name string `json:"name"`
AutoArchiveDuration AutoArchiveDuration `json:"auto_archive_duration,omitempty"`
RateLimitPerUser int `json:"rate_limit_per_user,omitempty"`
}
type ThreadMember ¶
type ThreadMemberFlags ¶
type ThreadMemberFlags int
type ThreadMetadata ¶
type ThreadMetadata struct {
Archived bool `json:"archived"`
AutoArchiveDuration AutoArchiveDuration `json:"auto_archive_duration"`
ArchiveTimestamp time.Time `json:"archive_timestamp"`
Locked bool `json:"locked"`
Invitable bool `json:"invitable"`
CreateTimestamp time.Time `json:"create_timestamp"`
}
type ThumbnailComponent ¶ added in v0.19.0
type ThumbnailComponent struct {
ID int `json:"id,omitempty"`
Media UnfurledMediaItem `json:"media"`
Description string `json:"description,omitempty"`
Spoiler bool `json:"spoiler,omitempty"`
}
func NewThumbnail ¶ added in v0.19.0
func NewThumbnail(url string) ThumbnailComponent
func (ThumbnailComponent) GetID ¶ added in v0.19.0
func (c ThumbnailComponent) GetID() int
func (ThumbnailComponent) MarshalJSON ¶ added in v0.19.0
func (c ThumbnailComponent) MarshalJSON() ([]byte, error)
func (ThumbnailComponent) Type ¶ added in v0.19.0
func (ThumbnailComponent) Type() ComponentType
func (ThumbnailComponent) WithDescription ¶ added in v0.19.0
func (c ThumbnailComponent) WithDescription(description string) ThumbnailComponent
func (ThumbnailComponent) WithID ¶ added in v0.19.0
func (c ThumbnailComponent) WithID(id int) ThumbnailComponent
func (ThumbnailComponent) WithMediaURL ¶ added in v0.19.0
func (c ThumbnailComponent) WithMediaURL(url string) ThumbnailComponent
func (ThumbnailComponent) WithSpoiler ¶ added in v0.19.0
func (c ThumbnailComponent) WithSpoiler(spoiler bool) ThumbnailComponent
type Timestamp ¶
type Timestamp struct {
time.Time
TimestampStyle TimestampStyle
}
Timestamp represents a timestamp markdown object https://discord.com/developers/docs/reference#message-formatting
func NewTimestamp ¶
func NewTimestamp(style TimestampStyle, time time.Time) Timestamp
NewTimestamp returns a new Timestamp with the given TimestampStyle & time.Time
func ParseTimestamp ¶
ParseTimestamp parses the first Timestamp found in the provided string
func ParseTimestamps ¶
ParseTimestamps parses all Timestamp(s) found in the provided string
func (Timestamp) FormatWith ¶
func (t Timestamp) FormatWith(style TimestampStyle) string
FormatWith returns the Timestamp as markdown with the given TimestampStyle
type TimestampStyle ¶
type TimestampStyle string
TimestampStyle is used to determine how to display the Timestamp for the User in the client
const ( // TimestampStyleNone formats as default TimestampStyleNone TimestampStyle = "" // TimestampStyleShortTime formats time as 16:20 TimestampStyleShortTime TimestampStyle = "t" // TimestampStyleLongTime formats time as 16:20:30 TimestampStyleLongTime TimestampStyle = "T" // TimestampStyleShortDate formats time as 20/04/2021 TimestampStyleShortDate TimestampStyle = "d" // TimestampStyleLongDate formats time as 20 April 2021 TimestampStyleLongDate TimestampStyle = "D" // TimestampStyleShortDateTime formats time as 20 April 2021 16:20 TimestampStyleShortDateTime TimestampStyle = "f" // TimestampStyleLongDateTime formats time as Tuesday, 20 April 2021 16:20 TimestampStyleLongDateTime TimestampStyle = "F" // TimestampStyleShortDateShortTime formats time as 20/04/2021, 16:20 TimestampStyleShortDateShortTime TimestampStyle = "s" // TimestampStyleShortDateMediumTime formats time as 20/04/2021, 16:20:30 TimestampStyleShortDateMediumTime TimestampStyle = "S" // TimestampStyleRelative formats time as 2 months ago TimestampStyleRelative TimestampStyle = "R" )
func (TimestampStyle) Format ¶
func (f TimestampStyle) Format(seconds int64) string
Format returns the seconds formatted as markdown string
func (TimestampStyle) FormatTime ¶
func (f TimestampStyle) FormatTime(time time.Time) string
FormatTime returns the time.Time formatted as markdown string
type TwitchIntegration ¶
type TwitchIntegration struct {
IntegrationID snowflake.ID `json:"id"`
Name string `json:"name"`
Enabled bool `json:"enabled"`
Syncing bool `json:"syncing"`
RoleID snowflake.ID `json:"role_id"`
EnableEmoticons bool `json:"enable_emoticons"`
ExpireBehavior IntegrationExpireBehavior `json:"expire_behavior"`
ExpireGracePeriod int `json:"expire_grace_period"`
User User `json:"user"`
Account IntegrationAccount `json:"account"`
SyncedAt string `json:"synced_at"`
SubscriberCount int `json:"subscriber_account"`
Revoked bool `json:"revoked"`
}
func (TwitchIntegration) CreatedAt ¶ added in v0.13.17
func (i TwitchIntegration) CreatedAt() time.Time
func (TwitchIntegration) ID ¶
func (i TwitchIntegration) ID() snowflake.ID
func (TwitchIntegration) MarshalJSON ¶
func (i TwitchIntegration) MarshalJSON() ([]byte, error)
func (TwitchIntegration) Type ¶
func (TwitchIntegration) Type() IntegrationType
type UnavailableGuild ¶
type UnavailableGuild struct {
}
type UnfurledMediaItem ¶ added in v0.19.0
type UnfurledMediaItem struct {
// URL supports arbitrary urls and attachment://<filename> references
URL string `json:"url"`
// ProxyURL is a proxied version of the URL. This can't be set by bots.
ProxyURL string `json:"proxy_url,omitempty"`
// Height is the height of the media item in pixels. This can't be set by bots.
Height int `json:"height,omitempty"`
// Width is the width of the media item in pixels. This can't be set by bots.
Width int `json:"width,omitempty"`
// ContentType is the content type of the media item. This can't be set by bots.
ContentType string `json:"content_type,omitempty"`
// AttachmentID is the id of the uploaded attachment. This can't be set by bots.
AttachmentID snowflake.ID `json:"attachment_id,omitempty"`
// LoadingState is the loading state of the media item. This can't be set by bots.
LoadingState UnfurledMediaItemLoadingState `json:"loading_state,omitempty"`
}
UnfurledMediaItem is a media item that can be displayed in a ThumbnailComponent or FileComponent.
type UnfurledMediaItemLoadingState ¶ added in v0.19.0
type UnfurledMediaItemLoadingState int
const ( UnfurledMediaItemLoadingStateUnknown UnfurledMediaItemLoadingState = iota UnfurledMediaItemLoadingStateLoading UnfurledMediaItemLoadingStateLoadedSuccess UnfurledMediaItemLoadingStateLoadedNotFound )
type UnknownComponent ¶ added in v0.19.0
type UnknownComponent struct {
ComponentType ComponentType
ID int
Data json.RawMessage
}
UnknownComponent is a component that is not recognized by the library.
func NewUnknownComponent ¶ added in v0.19.0
func NewUnknownComponent(componentType ComponentType, data json.RawMessage) UnknownComponent
NewUnknownComponent creates a new UnknownComponent with the provided type and data. This is useful for handling unknown components, but should be avoided if possible.
func (UnknownComponent) GetCustomID ¶ added in v0.19.0
func (c UnknownComponent) GetCustomID() string
func (UnknownComponent) GetID ¶ added in v0.19.0
func (c UnknownComponent) GetID() int
func (UnknownComponent) MarshalJSON ¶ added in v0.19.0
func (c UnknownComponent) MarshalJSON() ([]byte, error)
func (UnknownComponent) Type ¶ added in v0.19.0
func (c UnknownComponent) Type() ComponentType
func (*UnknownComponent) UnmarshalJSON ¶ added in v0.19.0
func (c *UnknownComponent) UnmarshalJSON(data []byte) error
type UnmarshalApplicationCommand ¶
type UnmarshalApplicationCommand struct {
ApplicationCommand
}
func (*UnmarshalApplicationCommand) UnmarshalJSON ¶
func (u *UnmarshalApplicationCommand) UnmarshalJSON(data []byte) error
type UnmarshalApplicationCommandOption ¶
type UnmarshalApplicationCommandOption struct {
ApplicationCommandOption
}
func (*UnmarshalApplicationCommandOption) UnmarshalJSON ¶
func (u *UnmarshalApplicationCommandOption) UnmarshalJSON(data []byte) error
type UnmarshalApplicationCommandPermission ¶
type UnmarshalApplicationCommandPermission struct {
ApplicationCommandPermission
}
func (*UnmarshalApplicationCommandPermission) UnmarshalJSON ¶
func (p *UnmarshalApplicationCommandPermission) UnmarshalJSON(data []byte) error
type UnmarshalAutocompleteOption ¶
type UnmarshalAutocompleteOption struct {
// contains filtered or unexported fields
}
func (*UnmarshalAutocompleteOption) UnmarshalJSON ¶
func (o *UnmarshalAutocompleteOption) UnmarshalJSON(data []byte) error
type UnmarshalChannel ¶
type UnmarshalChannel struct {
Channel
}
func (*UnmarshalChannel) UnmarshalJSON ¶
func (u *UnmarshalChannel) UnmarshalJSON(data []byte) error
type UnmarshalComponent ¶
type UnmarshalComponent struct {
Component
}
func (*UnmarshalComponent) UnmarshalJSON ¶
func (u *UnmarshalComponent) UnmarshalJSON(data []byte) error
type UnmarshalIntegration ¶
type UnmarshalIntegration struct {
Integration
}
func (*UnmarshalIntegration) UnmarshalJSON ¶
func (i *UnmarshalIntegration) UnmarshalJSON(data []byte) error
type UnmarshalPermissionOverwrite ¶
type UnmarshalPermissionOverwrite struct {
PermissionOverwrite
}
func (*UnmarshalPermissionOverwrite) UnmarshalJSON ¶
func (o *UnmarshalPermissionOverwrite) UnmarshalJSON(data []byte) error
type UnmarshalSlashCommandOption ¶
type UnmarshalSlashCommandOption struct {
// contains filtered or unexported fields
}
func (*UnmarshalSlashCommandOption) UnmarshalJSON ¶
func (o *UnmarshalSlashCommandOption) UnmarshalJSON(data []byte) error
type UnmarshalWebhook ¶
type UnmarshalWebhook struct {
Webhook
}
func (*UnmarshalWebhook) UnmarshalJSON ¶
func (w *UnmarshalWebhook) UnmarshalJSON(data []byte) error
type User ¶
type User struct {
ID snowflake.ID `json:"id"`
Username string `json:"username"`
Discriminator string `json:"discriminator"`
GlobalName *string `json:"global_name"`
Avatar *string `json:"avatar"`
Banner *string `json:"banner"`
AccentColor *int `json:"accent_color"`
Bot bool `json:"bot"`
System bool `json:"system"`
PublicFlags UserFlags `json:"public_flags"`
AvatarDecorationData *AvatarDecorationData `json:"avatar_decoration_data"`
Collectibles *Collectibles `json:"collectibles"`
PrimaryGuild *PrimaryGuild `json:"primary_guild"`
}
User is a struct for interacting with discord's users
func (User) AvatarDecorationURL ¶ added in v0.16.8
AvatarDecorationURL returns the avatar decoration URL if set or nil
func (User) DefaultAvatarURL ¶
DefaultAvatarURL calculates and returns the default avatar URL
func (User) EffectiveAvatarURL ¶
EffectiveAvatarURL returns the avatar URL of the user if set, falling back to the default avatar URL
func (User) EffectiveName ¶ added in v0.16.6
EffectiveName returns the global (display) name of the user if set, falling back to the username
func (User) GuildTagURL ¶ added in v0.19.0
GuildTagURL returns the server tag badge URL if the user has a primary discord.Guild or nil
type UserCommand ¶
type UserCommand struct {
// contains filtered or unexported fields
}
func (UserCommand) ApplicationID ¶
func (c UserCommand) ApplicationID() snowflake.ID
func (UserCommand) Contexts ¶ added in v0.18.0
func (c UserCommand) Contexts() []InteractionContextType
func (UserCommand) CreatedAt ¶ added in v0.13.17
func (c UserCommand) CreatedAt() time.Time
func (UserCommand) DMPermission ¶ added in v0.10.2
func (c UserCommand) DMPermission() bool
func (UserCommand) DefaultMemberPermissions ¶ added in v0.10.2
func (c UserCommand) DefaultMemberPermissions() Permissions
func (UserCommand) GuildID ¶
func (c UserCommand) GuildID() *snowflake.ID
func (UserCommand) ID ¶
func (c UserCommand) ID() snowflake.ID
func (UserCommand) IntegrationTypes ¶ added in v0.18.0
func (c UserCommand) IntegrationTypes() []ApplicationIntegrationType
func (UserCommand) MarshalJSON ¶
func (c UserCommand) MarshalJSON() ([]byte, error)
func (UserCommand) NSFW ¶ added in v0.14.0
func (c UserCommand) NSFW() bool
func (UserCommand) Name ¶
func (c UserCommand) Name() string
func (UserCommand) NameLocalizations ¶
func (c UserCommand) NameLocalizations() map[Locale]string
func (UserCommand) NameLocalized ¶
func (c UserCommand) NameLocalized() string
func (UserCommand) Type ¶
func (c UserCommand) Type() ApplicationCommandType
func (*UserCommand) UnmarshalJSON ¶
func (c *UserCommand) UnmarshalJSON(data []byte) error
func (UserCommand) Version ¶
func (c UserCommand) Version() snowflake.ID
type UserCommandCreate ¶
type UserCommandCreate struct {
Name string `json:"name"`
NameLocalizations map[Locale]string `json:"name_localizations,omitempty"`
DefaultMemberPermissions omit.Omit[*Permissions] `json:"default_member_permissions,omitzero"`
IntegrationTypes []ApplicationIntegrationType `json:"integration_types,omitempty"`
Contexts []InteractionContextType `json:"contexts,omitempty"`
NSFW *bool `json:"nsfw,omitempty"`
}
func (UserCommandCreate) CommandName ¶
func (c UserCommandCreate) CommandName() string
func (UserCommandCreate) MarshalJSON ¶
func (c UserCommandCreate) MarshalJSON() ([]byte, error)
func (UserCommandCreate) Type ¶
func (UserCommandCreate) Type() ApplicationCommandType
type UserCommandInteractionData ¶
type UserCommandInteractionData struct {
Resolved UserCommandResolved `json:"resolved"`
// contains filtered or unexported fields
}
func (UserCommandInteractionData) CommandID ¶
func (d UserCommandInteractionData) CommandID() snowflake.ID
func (UserCommandInteractionData) CommandName ¶
func (d UserCommandInteractionData) CommandName() string
func (UserCommandInteractionData) GuildID ¶ added in v0.8.9
func (d UserCommandInteractionData) GuildID() *snowflake.ID
func (*UserCommandInteractionData) MarshalJSON ¶
func (d *UserCommandInteractionData) MarshalJSON() ([]byte, error)
func (UserCommandInteractionData) TargetID ¶
func (d UserCommandInteractionData) TargetID() snowflake.ID
func (UserCommandInteractionData) TargetMember ¶
func (d UserCommandInteractionData) TargetMember() ResolvedMember
func (UserCommandInteractionData) TargetUser ¶
func (d UserCommandInteractionData) TargetUser() User
func (UserCommandInteractionData) Type ¶
func (UserCommandInteractionData) Type() ApplicationCommandType
func (*UserCommandInteractionData) UnmarshalJSON ¶
func (d *UserCommandInteractionData) UnmarshalJSON(data []byte) error
type UserCommandResolved ¶
type UserCommandResolved struct {
Users map[snowflake.ID]User `json:"users,omitempty"`
Members map[snowflake.ID]ResolvedMember `json:"members,omitempty"`
}
func (*UserCommandResolved) UnmarshalJSON ¶ added in v0.16.4
func (r *UserCommandResolved) UnmarshalJSON(data []byte) error
type UserCommandUpdate ¶
type UserCommandUpdate struct {
Name *string `json:"name,omitempty"`
NameLocalizations *map[Locale]string `json:"name_localizations,omitempty"`
DefaultMemberPermissions omit.Omit[*Permissions] `json:"default_member_permissions,omitzero"`
IntegrationTypes *[]ApplicationIntegrationType `json:"integration_types,omitempty"`
Contexts *[]InteractionContextType `json:"contexts,omitempty"`
NSFW *bool `json:"nsfw,omitempty"`
}
func (UserCommandUpdate) CommandName ¶
func (c UserCommandUpdate) CommandName() *string
func (UserCommandUpdate) MarshalJSON ¶
func (c UserCommandUpdate) MarshalJSON() ([]byte, error)
func (UserCommandUpdate) Type ¶
func (UserCommandUpdate) Type() ApplicationCommandType
type UserFlags ¶
type UserFlags int
UserFlags defines certain flags/badges a user can have (https://discord.com/developers/docs/resources/user#user-object-user-flags)
const ( UserFlagDiscordEmployee UserFlags = 1 << iota UserFlagPartneredServerOwner UserFlagHypeSquadEvents UserFlagBugHunterLevel1 UserFlagHouseBravery UserFlagHouseBrilliance UserFlagHouseBalance UserFlagEarlySupporter UserFlagTeamUser UserFlagBugHunterLevel2 UserFlagVerifiedBot UserFlagEarlyVerifiedBotDeveloper UserFlagDiscordCertifiedModerator UserFlagBotHTTPInteractions UserFlagsNone UserFlags = 0 )
All UserFlags
func (UserFlags) Add ¶ added in v0.13.21
Add allows you to add multiple bits together, producing a new bit
type UserSelectMenuComponent ¶ added in v0.14.0
type UserSelectMenuComponent struct {
ID int `json:"id,omitempty"`
CustomID string `json:"custom_id"`
Placeholder string `json:"placeholder,omitempty"`
DefaultValues []SelectMenuDefaultValue `json:"default_values,omitempty"`
MinValues *int `json:"min_values,omitempty"`
MaxValues int `json:"max_values,omitempty"`
// Required Indicates if the select menu is required to submit the Modal.
Required bool `json:"required"`
// Disabled whether the select menu is disabled (only supported in messages)
Disabled bool `json:"disabled"`
// Values is only set when the UserSelectMenuComponent is received from an InteractionTypeModalSubmit
Values []snowflake.ID `json:"values,omitempty"`
}
func NewUserSelectMenu ¶ added in v0.14.0
func NewUserSelectMenu(customID string, placeholder string) UserSelectMenuComponent
NewUserSelectMenu builds a new SelectMenuComponent from the provided values
func (UserSelectMenuComponent) AddDefaultValue ¶ added in v0.16.10
func (c UserSelectMenuComponent) AddDefaultValue(defaultValue snowflake.ID) UserSelectMenuComponent
AddDefaultValue returns a new UserSelectMenuComponent with the provided default value added
func (UserSelectMenuComponent) AsDisabled ¶ added in v0.14.0
func (c UserSelectMenuComponent) AsDisabled() UserSelectMenuComponent
AsDisabled returns a new UserSelectMenuComponent but disabled
func (UserSelectMenuComponent) AsEnabled ¶ added in v0.14.0
func (c UserSelectMenuComponent) AsEnabled() UserSelectMenuComponent
AsEnabled returns a new UserSelectMenuComponent but enabled
func (UserSelectMenuComponent) GetCustomID ¶ added in v0.19.0
func (c UserSelectMenuComponent) GetCustomID() string
func (UserSelectMenuComponent) GetID ¶ added in v0.19.0
func (c UserSelectMenuComponent) GetID() int
func (UserSelectMenuComponent) MarshalJSON ¶ added in v0.14.0
func (c UserSelectMenuComponent) MarshalJSON() ([]byte, error)
func (UserSelectMenuComponent) RemoveDefaultValue ¶ added in v0.16.10
func (c UserSelectMenuComponent) RemoveDefaultValue(index int) UserSelectMenuComponent
RemoveDefaultValue returns a new UserSelectMenuComponent with the provided default value at the index removed
func (UserSelectMenuComponent) SetDefaultValues ¶ added in v0.16.10
func (c UserSelectMenuComponent) SetDefaultValues(defaultValues ...snowflake.ID) UserSelectMenuComponent
SetDefaultValues returns a new UserSelectMenuComponent with the provided default values
func (UserSelectMenuComponent) Type ¶ added in v0.14.0
func (UserSelectMenuComponent) Type() ComponentType
func (UserSelectMenuComponent) WithCustomID ¶ added in v0.14.0
func (c UserSelectMenuComponent) WithCustomID(customID string) UserSelectMenuComponent
WithCustomID returns a new UserSelectMenuComponent with the provided customID
func (UserSelectMenuComponent) WithDisabled ¶ added in v0.14.0
func (c UserSelectMenuComponent) WithDisabled(disabled bool) UserSelectMenuComponent
WithDisabled returns a new UserSelectMenuComponent with the provided disabled
func (UserSelectMenuComponent) WithID ¶ added in v0.19.0
func (c UserSelectMenuComponent) WithID(id int) UserSelectMenuComponent
WithID returns a new UserSelectMenuComponent with the provided ID
func (UserSelectMenuComponent) WithMaxValues ¶ added in v0.14.0
func (c UserSelectMenuComponent) WithMaxValues(maxValue int) UserSelectMenuComponent
WithMaxValues returns a new UserSelectMenuComponent with the provided maxValue
func (UserSelectMenuComponent) WithMinValues ¶ added in v0.14.0
func (c UserSelectMenuComponent) WithMinValues(minValue int) UserSelectMenuComponent
WithMinValues returns a new UserSelectMenuComponent with the provided minValue
func (UserSelectMenuComponent) WithPlaceholder ¶ added in v0.14.0
func (c UserSelectMenuComponent) WithPlaceholder(placeholder string) UserSelectMenuComponent
WithPlaceholder returns a new UserSelectMenuComponent with the provided placeholder
func (UserSelectMenuComponent) WithRequired ¶ added in v0.19.0
func (c UserSelectMenuComponent) WithRequired(required bool) UserSelectMenuComponent
WithRequired returns a new UserSelectMenuComponent with the provided required value
type UserSelectMenuInteractionData ¶ added in v0.14.0
type UserSelectMenuInteractionData struct {
Resolved UserSelectMenuResolved `json:"resolved"`
Values []snowflake.ID `json:"values"`
// contains filtered or unexported fields
}
func (UserSelectMenuInteractionData) CustomID ¶ added in v0.14.0
func (d UserSelectMenuInteractionData) CustomID() string
func (UserSelectMenuInteractionData) MarshalJSON ¶ added in v0.14.0
func (d UserSelectMenuInteractionData) MarshalJSON() ([]byte, error)
func (UserSelectMenuInteractionData) Members ¶ added in v0.14.0
func (d UserSelectMenuInteractionData) Members() []ResolvedMember
func (UserSelectMenuInteractionData) Type ¶ added in v0.14.0
func (UserSelectMenuInteractionData) Type() ComponentType
func (*UserSelectMenuInteractionData) UnmarshalJSON ¶ added in v0.14.0
func (d *UserSelectMenuInteractionData) UnmarshalJSON(data []byte) error
func (UserSelectMenuInteractionData) Users ¶ added in v0.14.0
func (d UserSelectMenuInteractionData) Users() []User
type UserSelectMenuResolved ¶ added in v0.14.0
type UserUpdate ¶ added in v0.16.12
type UserUpdate struct {
Username string `json:"username,omitempty"`
Avatar omit.Omit[*Icon] `json:"avatar,omitzero"`
Banner omit.Omit[*Icon] `json:"banner,omitzero"`
}
UserUpdate is the payload used to update the OAuth2User
type UserVoiceStateUpdate ¶
type VerificationLevel ¶
type VerificationLevel int
The VerificationLevel of a Guild that members must be to send messages
const ( VerificationLevelNone VerificationLevel = iota VerificationLevelLow VerificationLevelMedium VerificationLevelHigh VerificationLevelVeryHigh )
Constants for VerificationLevel
type VideoQualityMode ¶
type VideoQualityMode int
VideoQualityMode https://discord.com/developers/docs/resources/channel#channel-object-video-quality-modes
const ( VideoQualityModeAuto VideoQualityMode = iota + 1 VideoQualityModeFull )
type VisibilityType ¶
type VisibilityType int
const ( VisibilityTypeNone VisibilityType = iota VisibilityTypeEveryone )
type VoiceChannelEffectAnimationType ¶ added in v0.18.11
type VoiceChannelEffectAnimationType int
const ( VoiceChannelEffectAnimationTypePremium VoiceChannelEffectAnimationType = iota VoiceChannelEffectAnimationTypeBasic )
type VoiceRegion ¶
type VoiceRegion struct {
ID string `json:"id"`
Name string `json:"name"`
Optimal bool `json:"optimal"`
Deprecated bool `json:"deprecated"`
Custom bool `json:"custom"`
}
VoiceRegion (https://discord.com/developers/docs/resources/voice#voice-region-object)
type VoiceState ¶
type VoiceState struct {
GuildID snowflake.ID `json:"guild_id,omitempty"`
ChannelID *snowflake.ID `json:"channel_id"`
UserID snowflake.ID `json:"user_id"`
SessionID string `json:"session_id"`
GuildDeaf bool `json:"deaf"`
GuildMute bool `json:"mute"`
SelfDeaf bool `json:"self_deaf"`
SelfMute bool `json:"self_mute"`
SelfStream bool `json:"self_stream"`
SelfVideo bool `json:"self_video"`
Suppress bool `json:"suppress"`
RequestToSpeakTimestamp *time.Time `json:"request_to_speak_timestamp"`
}
VoiceState from Discord
type Webhook ¶
type Webhook interface {
json.Marshaler
Type() WebhookType
ID() snowflake.ID
Name() string
Avatar() *string
AvatarURL(opts ...CDNOpt) *string
CreatedAt() time.Time
// contains filtered or unexported methods
}
Webhook (https://discord.com/developers/docs/resources/webhook) is a way to post messages to Discord using the Discord API which do not require bot authentication or use.
type WebhookCreate ¶
WebhookCreate is used to create a Webhook
type WebhookMessageCreate ¶
type WebhookMessageCreate struct {
Content string `json:"content,omitempty"`
Username string `json:"username,omitempty"`
AvatarURL string `json:"avatar_url,omitempty"`
TTS bool `json:"tts,omitempty"`
Embeds []Embed `json:"embeds,omitempty"`
Components []LayoutComponent `json:"components,omitempty"`
Attachments []AttachmentCreate `json:"attachments,omitempty"`
Files []*File `json:"-"`
AllowedMentions *AllowedMentions `json:"allowed_mentions,omitempty"`
Flags MessageFlags `json:"flags,omitempty"`
ThreadName string `json:"thread_name,omitempty"`
AppliedTags []snowflake.ID `json:"applied_tags,omitempty"`
Poll *PollCreate `json:"poll,omitempty"`
}
func NewWebhookMessageCreate ¶ added in v0.19.0
func NewWebhookMessageCreate() WebhookMessageCreate
NewWebhookMessageCreate returns a new WebhookMessageCreate with no fields set.
func NewWebhookMessageCreateV2 ¶ added in v0.19.0
func NewWebhookMessageCreateV2(components ...LayoutComponent) WebhookMessageCreate
NewWebhookMessageCreateV2 returns a new WebhookMessageCreate with MessageFlagIsComponentsV2 flag set & allows to directly pass components.
func (WebhookMessageCreate) AddActionRow ¶ added in v0.19.0
func (m WebhookMessageCreate) AddActionRow(components ...InteractiveComponent) WebhookMessageCreate
AddActionRow returns a new WebhookMessageCreate with a new ActionRowComponent containing the provided InteractiveComponent(s) added.
func (WebhookMessageCreate) AddAppliedTags ¶ added in v0.19.0
func (m WebhookMessageCreate) AddAppliedTags(appliedTags ...snowflake.ID) WebhookMessageCreate
AddAppliedTags returns a new WebhookMessageCreate with the provided applied tags added.
func (WebhookMessageCreate) AddComponents ¶ added in v0.19.0
func (m WebhookMessageCreate) AddComponents(containers ...LayoutComponent) WebhookMessageCreate
AddComponents returns a new WebhookMessageCreate with the provided LayoutComponent(s) added.
func (WebhookMessageCreate) AddEmbeds ¶ added in v0.19.0
func (m WebhookMessageCreate) AddEmbeds(embeds ...Embed) WebhookMessageCreate
AddEmbeds returns a new WebhookMessageCreate with the provided embeds added.
func (WebhookMessageCreate) AddFile ¶ added in v0.19.0
func (m WebhookMessageCreate) AddFile(name string, description string, reader io.Reader, flags ...FileFlags) WebhookMessageCreate
AddFile returns a new WebhookMessageCreate with a File added.
func (WebhookMessageCreate) AddFiles ¶ added in v0.19.0
func (m WebhookMessageCreate) AddFiles(files ...*File) WebhookMessageCreate
AddFiles returns a new WebhookMessageCreate with the File(s) added.
func (WebhookMessageCreate) AddFlags ¶ added in v0.19.0
func (m WebhookMessageCreate) AddFlags(flags ...MessageFlags) WebhookMessageCreate
AddFlags returns a new WebhookMessageCreate with the provided MessageFlags added.
func (WebhookMessageCreate) ClearAllowedMentions ¶ added in v0.19.0
func (m WebhookMessageCreate) ClearAllowedMentions() WebhookMessageCreate
ClearAllowedMentions returns a new WebhookMessageCreate with no AllowedMentions.
func (WebhookMessageCreate) ClearAppliedTags ¶ added in v0.19.0
func (m WebhookMessageCreate) ClearAppliedTags() WebhookMessageCreate
ClearAppliedTags returns a new WebhookMessageCreate with no applied tags.
func (WebhookMessageCreate) ClearComponents ¶ added in v0.19.0
func (m WebhookMessageCreate) ClearComponents() WebhookMessageCreate
ClearComponents returns a new WebhookMessageCreate with no LayoutComponent(s).
func (WebhookMessageCreate) ClearEmbeds ¶ added in v0.19.0
func (m WebhookMessageCreate) ClearEmbeds() WebhookMessageCreate
ClearEmbeds returns a new WebhookMessageCreate with no embeds.
func (WebhookMessageCreate) ClearFiles ¶ added in v0.19.0
func (m WebhookMessageCreate) ClearFiles() WebhookMessageCreate
ClearFiles returns a new WebhookMessageCreate with no File(s).
func (WebhookMessageCreate) ClearFlags ¶ added in v0.19.0
func (m WebhookMessageCreate) ClearFlags() WebhookMessageCreate
ClearFlags returns a new WebhookMessageCreate with no MessageFlags.
func (WebhookMessageCreate) ClearPoll ¶ added in v0.19.0
func (m WebhookMessageCreate) ClearPoll() WebhookMessageCreate
ClearPoll returns a new WebhookMessageCreate with no Poll.
func (WebhookMessageCreate) RemoveAppliedTag ¶ added in v0.19.0
func (m WebhookMessageCreate) RemoveAppliedTag(tagId snowflake.ID) WebhookMessageCreate
RemoveAppliedTag returns a new WebhookMessageCreate with the provided applied tag removed.
func (WebhookMessageCreate) RemoveComponent ¶ added in v0.19.0
func (m WebhookMessageCreate) RemoveComponent(id int) WebhookMessageCreate
RemoveComponent returns a new WebhookMessageCreate with the LayoutComponent at the index removed.
func (WebhookMessageCreate) RemoveEmbed ¶ added in v0.19.0
func (m WebhookMessageCreate) RemoveEmbed(i int) WebhookMessageCreate
RemoveEmbed returns a new WebhookMessageCreate with the embed at the index removed.
func (WebhookMessageCreate) RemoveFile ¶ added in v0.19.0
func (m WebhookMessageCreate) RemoveFile(i int) WebhookMessageCreate
RemoveFile returns a new WebhookMessageCreate with the File at the index removed.
func (WebhookMessageCreate) RemoveFlags ¶ added in v0.19.0
func (m WebhookMessageCreate) RemoveFlags(flags ...MessageFlags) WebhookMessageCreate
RemoveFlags returns a new WebhookMessageCreate with the provided MessageFlags removed.
func (WebhookMessageCreate) ToBody ¶
func (m WebhookMessageCreate) ToBody() (any, error)
ToBody returns the WebhookMessageCreate ready for body.
func (WebhookMessageCreate) UpdateComponent ¶ added in v0.19.0
func (m WebhookMessageCreate) UpdateComponent(id int, component LayoutComponent) WebhookMessageCreate
UpdateComponent returns a new WebhookMessageCreate with the provided LayoutComponent at the index.
func (WebhookMessageCreate) UpdateFile ¶ added in v0.19.0
func (m WebhookMessageCreate) UpdateFile(i int, file *File) WebhookMessageCreate
UpdateFile returns a new WebhookMessageCreate with the provided File at the index.
func (WebhookMessageCreate) WithAllowedMentions ¶ added in v0.19.0
func (m WebhookMessageCreate) WithAllowedMentions(allowedMentions *AllowedMentions) WebhookMessageCreate
WithAllowedMentions returns a new WebhookMessageCreate with the provided AllowedMentions.
func (WebhookMessageCreate) WithAppliedTags ¶ added in v0.19.0
func (m WebhookMessageCreate) WithAppliedTags(appliedTags ...snowflake.ID) WebhookMessageCreate
WithAppliedTags returns a new WebhookMessageCreate with the provided applied tags.
func (WebhookMessageCreate) WithAvatarURL ¶ added in v0.19.0
func (m WebhookMessageCreate) WithAvatarURL(url string) WebhookMessageCreate
WithAvatarURL returns a new WebhookMessageCreate with the provided avatar URL.
func (WebhookMessageCreate) WithComponents ¶ added in v0.19.0
func (m WebhookMessageCreate) WithComponents(components ...LayoutComponent) WebhookMessageCreate
WithComponents returns a new WebhookMessageCreate with the provided LayoutComponent(s).
func (WebhookMessageCreate) WithContent ¶ added in v0.19.0
func (m WebhookMessageCreate) WithContent(content string) WebhookMessageCreate
WithContent returns a new WebhookMessageCreate with the provided content.
func (WebhookMessageCreate) WithContentf ¶ added in v0.19.0
func (m WebhookMessageCreate) WithContentf(content string, a ...any) WebhookMessageCreate
WithContentf returns a new WebhookMessageCreate with the formatted content.
func (WebhookMessageCreate) WithEmbed ¶ added in v0.19.0
func (m WebhookMessageCreate) WithEmbed(i int, embed Embed) WebhookMessageCreate
WithEmbed returns a new WebhookMessageCreate with the provided Embed at the index.
func (WebhookMessageCreate) WithEmbeds ¶ added in v0.19.0
func (m WebhookMessageCreate) WithEmbeds(embeds ...Embed) WebhookMessageCreate
WithEmbeds returns a new WebhookMessageCreate with the provided Embed(s).
func (WebhookMessageCreate) WithFiles ¶ added in v0.19.0
func (m WebhookMessageCreate) WithFiles(files ...*File) WebhookMessageCreate
WithFiles returns a new WebhookMessageCreate with the provided File(s).
func (WebhookMessageCreate) WithFlags ¶ added in v0.19.0
func (m WebhookMessageCreate) WithFlags(flags ...MessageFlags) WebhookMessageCreate
WithFlags returns a new WebhookMessageCreate with the provided message flags.
func (WebhookMessageCreate) WithIsComponentsV2 ¶ added in v0.19.0
func (m WebhookMessageCreate) WithIsComponentsV2(isComponentV2 bool) WebhookMessageCreate
WithIsComponentsV2 returns a new WebhookMessageCreate with MessageFlagIsComponentsV2 added/removed. Once a message with the flag has been sent, it cannot be removed by editing the message.
func (WebhookMessageCreate) WithPoll ¶ added in v0.19.0
func (m WebhookMessageCreate) WithPoll(poll PollCreate) WebhookMessageCreate
WithPoll returns a new WebhookMessageCreate with the provided Poll.
func (WebhookMessageCreate) WithSuppressEmbeds ¶ added in v0.19.0
func (m WebhookMessageCreate) WithSuppressEmbeds(suppressEmbeds bool) WebhookMessageCreate
WithSuppressEmbeds returns a new WebhookMessageCreate with MessageFlagSuppressEmbeds added/removed.
func (WebhookMessageCreate) WithSuppressNotifications ¶ added in v0.19.0
func (m WebhookMessageCreate) WithSuppressNotifications(suppressNotifications bool) WebhookMessageCreate
WithSuppressNotifications returns a new WebhookMessageCreate with MessageFlagSuppressNotifications added/removed.
func (WebhookMessageCreate) WithTTS ¶ added in v0.19.0
func (m WebhookMessageCreate) WithTTS(tts bool) WebhookMessageCreate
WithTTS returns a new WebhookMessageCreate with the provided TTS setting.
func (WebhookMessageCreate) WithThreadName ¶ added in v0.19.0
func (m WebhookMessageCreate) WithThreadName(threadName string) WebhookMessageCreate
WithThreadName returns a new WebhookMessageCreate with the provided thread name.
func (WebhookMessageCreate) WithUsername ¶ added in v0.19.0
func (m WebhookMessageCreate) WithUsername(username string) WebhookMessageCreate
WithUsername returns a new WebhookMessageCreate with the provided username.
type WebhookMessageUpdate ¶
type WebhookMessageUpdate struct {
Content *string `json:"content,omitempty"`
Embeds *[]Embed `json:"embeds,omitempty"`
Components *[]LayoutComponent `json:"components,omitempty"`
Attachments *[]AttachmentUpdate `json:"attachments,omitempty"`
Files []*File `json:"-"`
AllowedMentions *AllowedMentions `json:"allowed_mentions,omitempty"`
Poll *PollCreate `json:"poll,omitempty"`
// Flags are the MessageFlags of the message.
// Be careful not to override the current flags when editing messages from other users - this will result in a permission error.
// Use MessageFlags.Add for flags like discord.MessageFlagIsComponentsV2.
Flags *MessageFlags `json:"flags,omitempty"`
}
WebhookMessageUpdate is used to edit a Message.
func NewWebhookMessageUpdate ¶ added in v0.19.0
func NewWebhookMessageUpdate() WebhookMessageUpdate
NewWebhookMessageUpdate returns a new WebhookMessageUpdate with no fields set.
func NewWebhookMessageUpdateV2 ¶ added in v0.19.0
func NewWebhookMessageUpdateV2(components []LayoutComponent) WebhookMessageUpdate
NewWebhookMessageUpdateV2 returns a new WebhookMessageUpdate with MessageFlagIsComponentsV2 set and no other fields set.
func (WebhookMessageUpdate) AddActionRow ¶ added in v0.19.0
func (m WebhookMessageUpdate) AddActionRow(components ...InteractiveComponent) WebhookMessageUpdate
AddActionRow returns a new WebhookMessageUpdate with a new ActionRowComponent containing the provided InteractiveComponent(s) added.
func (WebhookMessageUpdate) AddComponents ¶ added in v0.19.0
func (m WebhookMessageUpdate) AddComponents(containers ...LayoutComponent) WebhookMessageUpdate
AddComponents returns a new WebhookMessageUpdate with the provided LayoutComponent(s) added.
func (WebhookMessageUpdate) AddEmbeds ¶ added in v0.19.0
func (m WebhookMessageUpdate) AddEmbeds(embeds ...Embed) WebhookMessageUpdate
AddEmbeds returns a new WebhookMessageUpdate with the provided embeds added.
func (WebhookMessageUpdate) AddFile ¶ added in v0.19.0
func (m WebhookMessageUpdate) AddFile(name string, description string, reader io.Reader, flags ...FileFlags) WebhookMessageUpdate
AddFile returns a new WebhookMessageUpdate with a File added.
func (WebhookMessageUpdate) AddFiles ¶ added in v0.19.0
func (m WebhookMessageUpdate) AddFiles(files ...*File) WebhookMessageUpdate
AddFiles returns a new WebhookMessageUpdate with the File(s) added.
func (WebhookMessageUpdate) AddFlags ¶ added in v0.19.0
func (m WebhookMessageUpdate) AddFlags(flags ...MessageFlags) WebhookMessageUpdate
AddFlags returns a new WebhookMessageUpdate with the provided MessageFlags added.
func (WebhookMessageUpdate) ClearAllowedMentions ¶ added in v0.19.0
func (m WebhookMessageUpdate) ClearAllowedMentions() WebhookMessageUpdate
ClearAllowedMentions returns a new WebhookMessageUpdate with no AllowedMentions.
func (WebhookMessageUpdate) ClearComponents ¶ added in v0.19.0
func (m WebhookMessageUpdate) ClearComponents() WebhookMessageUpdate
ClearComponents returns a new WebhookMessageUpdate with no LayoutComponent(s).
func (WebhookMessageUpdate) ClearContent ¶ added in v0.19.0
func (m WebhookMessageUpdate) ClearContent() WebhookMessageUpdate
ClearContent returns a new WebhookMessageUpdate with no content.
func (WebhookMessageUpdate) ClearEmbeds ¶ added in v0.19.0
func (m WebhookMessageUpdate) ClearEmbeds() WebhookMessageUpdate
ClearEmbeds returns a new WebhookMessageUpdate with no embeds.
func (WebhookMessageUpdate) ClearFiles ¶ added in v0.19.0
func (m WebhookMessageUpdate) ClearFiles() WebhookMessageUpdate
ClearFiles returns a new WebhookMessageUpdate with no File(s).
func (WebhookMessageUpdate) ClearFlags ¶ added in v0.19.0
func (m WebhookMessageUpdate) ClearFlags() WebhookMessageUpdate
ClearFlags returns a new WebhookMessageUpdate with no MessageFlags.
func (WebhookMessageUpdate) ClearPoll ¶ added in v0.19.0
func (m WebhookMessageUpdate) ClearPoll() WebhookMessageUpdate
ClearPoll returns a new WebhookMessageUpdate with no Poll.
func (WebhookMessageUpdate) RemoveComponent ¶ added in v0.19.0
func (m WebhookMessageUpdate) RemoveComponent(id int) WebhookMessageUpdate
RemoveComponent returns a new WebhookMessageUpdate with the LayoutComponent with the provided ID removed.
func (WebhookMessageUpdate) RemoveEmbed ¶ added in v0.19.0
func (m WebhookMessageUpdate) RemoveEmbed(i int) WebhookMessageUpdate
RemoveEmbed returns a new WebhookMessageUpdate with the embed at the index removed.
func (WebhookMessageUpdate) RemoveFile ¶ added in v0.19.0
func (m WebhookMessageUpdate) RemoveFile(i int) WebhookMessageUpdate
RemoveFile returns a new WebhookMessageUpdate with the File at the index removed.
func (WebhookMessageUpdate) RemoveFlags ¶ added in v0.19.0
func (m WebhookMessageUpdate) RemoveFlags(flags ...MessageFlags) WebhookMessageUpdate
RemoveFlags returns a new WebhookMessageUpdate with the provided MessageFlags removed.
func (WebhookMessageUpdate) RetainAttachments ¶ added in v0.19.0
func (m WebhookMessageUpdate) RetainAttachments(attachments ...Attachment) WebhookMessageUpdate
RetainAttachments returns a new WebhookMessageUpdate that retains the provided Attachment(s).
func (WebhookMessageUpdate) RetainAttachmentsByID ¶ added in v0.19.0
func (m WebhookMessageUpdate) RetainAttachmentsByID(attachmentIDs ...snowflake.ID) WebhookMessageUpdate
RetainAttachmentsByID returns a new WebhookMessageUpdate that retains the Attachment(s) with the provided IDs.
func (WebhookMessageUpdate) ToBody ¶
func (m WebhookMessageUpdate) ToBody() (any, error)
ToBody returns the WebhookMessageUpdate ready for body.
func (WebhookMessageUpdate) UpdateComponent ¶ added in v0.19.0
func (m WebhookMessageUpdate) UpdateComponent(id int, component LayoutComponent) WebhookMessageUpdate
UpdateComponent returns a new WebhookMessageUpdate with the provided LayoutComponent at the index.
func (WebhookMessageUpdate) UpdateFile ¶ added in v0.19.0
func (m WebhookMessageUpdate) UpdateFile(i int, file *File) WebhookMessageUpdate
UpdateFile returns a new WebhookMessageUpdate with the File at the index.
func (WebhookMessageUpdate) WithAllowedMentions ¶ added in v0.19.0
func (m WebhookMessageUpdate) WithAllowedMentions(allowedMentions *AllowedMentions) WebhookMessageUpdate
WithAllowedMentions returns a new WebhookMessageUpdate with the provided AllowedMentions.
func (WebhookMessageUpdate) WithComponents ¶ added in v0.19.0
func (m WebhookMessageUpdate) WithComponents(components ...LayoutComponent) WebhookMessageUpdate
WithComponents returns a new WebhookMessageUpdate with the provided LayoutComponent(s).
func (WebhookMessageUpdate) WithContent ¶ added in v0.19.0
func (m WebhookMessageUpdate) WithContent(content string) WebhookMessageUpdate
WithContent returns a new WebhookMessageUpdate with the provided content.
func (WebhookMessageUpdate) WithContentf ¶ added in v0.19.0
func (m WebhookMessageUpdate) WithContentf(content string, a ...any) WebhookMessageUpdate
WithContentf returns a new WebhookMessageUpdate with the formatted content.
func (WebhookMessageUpdate) WithEmbed ¶ added in v0.19.0
func (m WebhookMessageUpdate) WithEmbed(i int, embed Embed) WebhookMessageUpdate
WithEmbed returns a new WebhookMessageUpdate with the provided Embed at the index.
func (WebhookMessageUpdate) WithEmbeds ¶ added in v0.19.0
func (m WebhookMessageUpdate) WithEmbeds(embeds ...Embed) WebhookMessageUpdate
WithEmbeds returns a new WebhookMessageUpdate with the provided Embed(s).
func (WebhookMessageUpdate) WithFiles ¶ added in v0.19.0
func (m WebhookMessageUpdate) WithFiles(files ...*File) WebhookMessageUpdate
WithFiles returns a new WebhookMessageUpdate with the provided File(s).
func (WebhookMessageUpdate) WithFlags ¶ added in v0.19.0
func (m WebhookMessageUpdate) WithFlags(flags MessageFlags) WebhookMessageUpdate
WithFlags returns a new WebhookMessageUpdate with the provided MessageFlags. Be careful not to override the current flags when editing messages from other users - this will result in a permission error. Use WithSuppressEmbeds or AddFlags for flags like MessageFlagSuppressEmbeds.
func (WebhookMessageUpdate) WithIsComponentsV2 ¶ added in v0.19.0
func (m WebhookMessageUpdate) WithIsComponentsV2(isComponentV2 bool) WebhookMessageUpdate
WithIsComponentsV2 returns a new WebhookMessageUpdate with MessageFlagIsComponentsV2 added/removed. Once a message with the flag has been sent, it cannot be removed by editing the message.
func (WebhookMessageUpdate) WithPoll ¶ added in v0.19.0
func (m WebhookMessageUpdate) WithPoll(poll PollCreate) WebhookMessageUpdate
WithPoll returns a new WebhookMessageUpdate with the provided Poll.
func (WebhookMessageUpdate) WithSuppressEmbeds ¶ added in v0.19.0
func (m WebhookMessageUpdate) WithSuppressEmbeds(suppressEmbeds bool) WebhookMessageUpdate
WithSuppressEmbeds returns a new WebhookMessageUpdate with MessageFlagSuppressEmbeds added/removed.
type WebhookSourceChannel ¶
type WebhookSourceGuild ¶
type WebhookType ¶
type WebhookType int
WebhookType (https: //discord.com/developers/docs/resources/webhook#webhook-object-webhook-types)
const ( WebhookTypeIncoming WebhookType = iota + 1 WebhookTypeChannelFollower WebhookTypeApplication )
All WebhookType(s)
type WebhookUpdate ¶
type WebhookUpdate struct {
Name *string `json:"name,omitempty"`
Avatar omit.Omit[*Icon] `json:"avatar,omitzero"`
ChannelID *snowflake.ID `json:"channel_id,omitempty"`
}
WebhookUpdate is used to update a Webhook
type WebhookUpdateWithToken ¶
type WebhookUpdateWithToken struct {
Name *string `json:"name,omitempty"`
Avatar omit.Omit[*Icon] `json:"avatar,omitzero"`
}
WebhookUpdateWithToken is used to update a Webhook with the token
type YouTubeIntegration ¶
type YouTubeIntegration struct {
IntegrationID snowflake.ID `json:"id"`
Name string `json:"name"`
Enabled bool `json:"enabled"`
Syncing bool `json:"syncing"`
RoleID snowflake.ID `json:"role_id"`
ExpireBehavior IntegrationExpireBehavior `json:"expire_behavior"`
ExpireGracePeriod int `json:"expire_grace_period"`
User User `json:"user"`
Account IntegrationAccount `json:"account"`
SyncedAt string `json:"synced_at"`
SubscriberCount int `json:"subscriber_account"`
Revoked bool `json:"revoked"`
}
func (YouTubeIntegration) CreatedAt ¶ added in v0.13.17
func (i YouTubeIntegration) CreatedAt() time.Time
func (YouTubeIntegration) ID ¶
func (i YouTubeIntegration) ID() snowflake.ID
func (YouTubeIntegration) MarshalJSON ¶
func (i YouTubeIntegration) MarshalJSON() ([]byte, error)
func (YouTubeIntegration) Type ¶
func (YouTubeIntegration) Type() IntegrationType
Source Files
¶
- access_token.go
- activity.go
- allowed_mentions.go
- application.go
- application_command.go
- application_command_autocomplete_option.go
- application_command_create.go
- application_command_option.go
- application_command_permission.go
- application_command_raw.go
- application_command_update.go
- application_role_connection_metadata.go
- attachment.go
- audit_log.go
- auto_moderation.go
- ban.go
- cdn_endpoints.go
- channel.go
- channel_create.go
- channel_update.go
- channels_raw.go
- component.go
- component_iter.go
- connection.go
- embed.go
- embed_builder.go
- emoji.go
- entitlement.go
- errors.go
- file.go
- gateway.go
- guild.go
- guild_onboarding.go
- guild_scheduled_event.go
- guild_template.go
- icon.go
- integration.go
- interaction.go
- interaction_application_command.go
- interaction_autocomplete.go
- interaction_base.go
- interaction_callback.go
- interaction_component.go
- interaction_modal_submit.go
- interaction_ping.go
- interaction_response.go
- invite.go
- locale.go
- member.go
- mentionable.go
- message.go
- message_create.go
- message_update.go
- modal_create.go
- permission_overwrite.go
- permissions.go
- poll.go
- poll_create_builder.go
- presence.go
- role.go
- select_menu.go
- sku.go
- slash_command_option.go
- sound.go
- soundboard.go
- stage_instance.go
- sticker.go
- subscription.go
- thread.go
- thread_member.go
- timestamp.go
- url.go
- user.go
- voice_region.go
- voice_state.go
- webhook.go
- webhook_message_create.go
- webhook_message_update.go