objects

package
v0.0.12 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 17, 2023 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TypeIntegerLessThanOrEqual = iota + 1
	TypeIntegerGreaterThanOrEqual
	TypeIntegerEqual
	TypeIntegerNotEqual
	TypeDatetimeLessThanOrEqual
	TypeDatetimeGreaterThanOrEqual
	TypeBooleanEqual
	TypeBooleanNotEqual
)
View Source
const UserFlagsNone = UserFlags(0)

Variables

This section is empty.

Functions

func HasFlag added in v0.0.5

func HasFlag[T constraints.Integer](bitset T, flag T) bool

Types

type Activity

type Activity struct {
	Name          string           `json:"name,omitempty"`
	Type          ActivityType     `json:"type"`
	URL           string           `json:"url,omitempty"`
	CreatedAt     int              `json:"created_at"`
	Timestamps    Timestamps       `json:"timestamps,omitempty"`
	ApplicationID Snowflake        `json:"application_id,omitempty"`
	Details       string           `json:"details,omitempty"`
	State         string           `json:"state,omitempty"`
	Emoji         *Emoji           `json:"emoji,omitempty"`
	Party         *ActivityParty   `json:"party,omitempty"`
	Assets        *ActivityAssets  `json:"assets,omitempty"`
	Secrets       *ActivitySecrets `json:"secrets,omitempty"`
	Instance      bool             `json:"instance,omitempty"`
	Flags         ActivityFlag     `json:"flags,omitempty"`
}

type ActivityAssets

type ActivityAssets struct {
	LargeImage string `json:"large_image,omitempty"`
	LargeText  string `json:"large_text,omitempty"`
	SmallImage string `json:"small_image,omitempty"`
	SmallText  string `json:"small_text,omitempty"`
}

type ActivityFlag

type ActivityFlag uint
const (
	ActivityInstance ActivityFlag = 1 << iota
	ActivityJoin
	ActivitySpectate
	ActivityJoinRequest
	ActivitySync
	ActivityPlay
)

func (ActivityFlag) String

func (i ActivityFlag) String() string

type ActivityParty

type ActivityParty struct {
	ID   string `json:"id,omitempty"`
	Size [2]int `json:"size,omitempty"`
}

type ActivitySecrets

type ActivitySecrets struct {
	Join     string `json:"join,omitempty"`
	Spectate string `json:"spectate,omitempty"`
	Match    string `json:"match,omitempty"`
}

type ActivityType

type ActivityType uint
const (
	Game ActivityType = iota
	Streaming
	Listening
	Custom
	Competing
)

func (ActivityType) String

func (i ActivityType) String() string

type AllowedMentions

type AllowedMentions struct {
	Parse       []string    `json:"parse"`
	Roles       []Snowflake `json:"roles,omitempty"`
	Users       []Snowflake `json:"users,omitempty"`
	RepliedUser bool        `json:"replied_user,omitempty"`
}

type Application

type Application struct {
	ID                  Snowflake       `json:"id"`
	Name                string          `json:"name"`
	Icon                string          `json:"icon"`
	Description         string          `json:"description"`
	RPCOrigins          []string        `json:"rpc_origins"`
	BotPublic           bool            `json:"bot_public"`
	BotRequireCodeGrant bool            `json:"bot_require_code_grant"`
	TermsOfServiceURL   string          `json:"terms_of_service_url"`
	PrivacyPolicyURL    string          `json:"privacy_policy_url"`
	Owner               *User           `json:"owner"`
	Summary             string          `json:"summary"`
	VerifyKey           string          `json:"verify_key"`
	Team                *Team           `json:"team"`
	GuildID             Snowflake       `json:"guild_id"`
	PrimarySKUID        Snowflake       `json:"primary_sku_id"`
	Slug                string          `json:"slug"`
	CoverImage          string          `json:"cover_image"`
	Flags               ApplicationFlag `json:"flags"`
	Tags                []string        `json:"tags"`
	InstallParams       InstallParams   `json:"install_params"`
	CustomInstallURL    string          `json:"custom_install_url"`
}

A Discord API Application object. https://discord.com/developers/docs/resources/application#application-object-application-structure

type ApplicationCommand

type ApplicationCommand struct {
	// ID is the unique id of the command
	ID Snowflake `json:"id,omitempty"`
	// Type is	the type of command, defaults 1 if not set
	Type *ApplicationCommandType `json:"type,omitempty"`
	// Application ID is the unique id of the parent application
	ApplicationID Snowflake `json:"application_id,omitempty"`
	// GuildID guild id of the command, if not global
	GuildID *Snowflake `json:"guild_id,omitempty"`
	// Name is a 1-32 character name
	Name string `json:"name"`
	// Localization dictionary for name field. Values follow the same restrictions as name
	NameLocalizations map[string]string `json:"name_localizations,omitempty"`
	// Description is a 1-100 character description for CHAT_INPUT commands, empty string for USER and MESSAGE commands
	Description string `json:"description,omitempty"`
	// Localization dictionary for description field. Values follow the same restrictions as description
	DescriptionLocalizations map[string]string `json:"description_localizations,omitempty"`
	// Options are the parameters for the command, max 25, only valid for CHAT_INPUT commands
	Options []ApplicationCommandOption `json:"options"`
	// Set of permissions represented as a bit set
	DefaultPermissions *permissions.PermissionBit `json:"default_member_permissions,omitempty"`
	// Indicates whether the command is available in DMs with the app, only for globally-scoped commands. By default, commands are visible.
	AllowUseInDMs *bool `json:"dm_permission,omitempty"`
	// DefaultPermission is whether the command is enabled by default when the app is added to a guild
	DefaultPermission *bool `json:"default_permission,omitempty"`
	// Version is an autoincrementing version identifier updated during substantial record changes
	Version Snowflake `json:"version,omitempty"`
}

type ApplicationCommandData

type ApplicationCommandData struct {
	ID       Snowflake                       `json:"id"`
	Name     string                          `json:"name"`
	Type     ApplicationCommandType          `json:"type"`
	Resolved ResolvedData                    `json:"resolved"`
	Options  []*ApplicationCommandDataOption `json:"options"`
	GuildID  Snowflake                       `json:"guild_id"`
	TargetID Snowflake                       `json:"target_id"`
}

type ApplicationCommandDataOption

type ApplicationCommandDataOption struct {
	Type    ApplicationCommandOptionType    `json:"type"`
	Name    string                          `json:"name"`
	Value   interface{}                     `json:"value,omitempty"`
	Focused bool                            `json:"focused,omitempty"`
	Options []*ApplicationCommandDataOption `json:"options,omitempty"`
}

type ApplicationCommandOption

type ApplicationCommandOption struct {
	OptionType               ApplicationCommandOptionType     `json:"type"`
	Name                     string                           `json:"name"`
	NameLocalizations        map[string]string                `json:"name_localizations,omitempty"`
	Description              string                           `json:"description"`
	DescriptionLocalizations map[string]string                `json:"description_localizations,omitempty"`
	Required                 bool                             `json:"required,omitempty"`
	Choices                  []ApplicationCommandOptionChoice `json:"choices,omitempty"`
	Options                  []ApplicationCommandOption       `json:"options,omitempty"`
	ChannelTypes             []ChannelType                    `json:"channel_types,omitempty"`
	MinValue                 json.Number                      `json:"min_value,omitempty"`
	MaxValue                 json.Number                      `json:"max_value,omitempty"`
	MinLength                int64                            `json:"min_length,omitempty"`
	MaxLength                int64                            `json:"max_length,omitempty"`
	Autocomplete             bool                             `json:"autocomplete,omitempty"`
}

type ApplicationCommandOptionChoice

type ApplicationCommandOptionChoice struct {
	Name              string            `json:"name"`
	NameLocalizations map[string]string `json:"name_localizations,omitempty"`
	Value             interface{}       `json:"value"`
}

type ApplicationCommandOptionType

type ApplicationCommandOptionType int
const (
	TypeSubCommand ApplicationCommandOptionType = iota + 1
	TypeSubCommandGroup
	TypeString
	TypeInteger
	TypeBoolean
	TypeUser
	TypeChannel
	TypeRole
	TypeMentionable
	TypeNumber
	TypeAttachment
)

func (ApplicationCommandOptionType) String

type ApplicationCommandPermissionType

type ApplicationCommandPermissionType int
const (
	PermissionTypeRole ApplicationCommandPermissionType = iota + 1
	PermissionTypeUser
	PermissionTypeChannel
)

func (ApplicationCommandPermissionType) String

type ApplicationCommandPermissions

type ApplicationCommandPermissions struct {
	ID         Snowflake                        `json:"id"`
	Type       ApplicationCommandPermissionType `json:"type"`
	Permission bool                             `json:"permission"`
}

type ApplicationCommandPermissionsUpdate added in v0.0.5

type ApplicationCommandPermissionsUpdate struct {
	*ApplicationCommandPermissions
}

type ApplicationCommandType

type ApplicationCommandType int
const (
	CommandTypeChatInput ApplicationCommandType = iota + 1
	CommandTypeUser
	CommandTypeMessage
)

ApplicationCommand types

func (ApplicationCommandType) String

func (i ApplicationCommandType) String() string

type ApplicationFlag

type ApplicationFlag int
const (
	ApplicationFlagGatewayPresence ApplicationFlag = 1 << (iota + 12)
	ApplicationFlagGatewayPresenceLimited
	ApplicationFlagGatewayGuildMembers
	ApplicationFlagGatewayGuildMembersLimited
	ApplicationFlagVerificationPendingGuildLimit
	ApplicationFlagEmbedded
	ApplicationFlagMessageContent
	ApplicationFlagMessageContentLimited
)

func (ApplicationFlag) String

func (i ApplicationFlag) String() string

type ApplicationRoleConnection added in v0.0.4

type ApplicationRoleConnection struct {
	PlatformName     string                 `json:"platform_name"`
	PlatformUsername string                 `json:"platform_username"`
	Metadata         map[string]interface{} `json:"metadata"`
}

type ApplicationRoleConnectionMetadata added in v0.0.4

type ApplicationRoleConnectionMetadata struct {
	Type                     ApplicationRoleConnectionMetadataType `json:"type"`
	Key                      string                                `json:"key"`
	Name                     string                                `json:"name"`
	NameLocalizations        map[string]string                     `json:"name_localizations"`
	Description              string                                `json:"description"`
	DescriptionLocalizations map[string]string                     `json:"description_localizations"`
}

type ApplicationRoleConnectionMetadataType added in v0.0.4

type ApplicationRoleConnectionMetadataType uint

type Asset added in v0.0.5

type Asset[T CDNObject] struct {
	// contains filtered or unexported fields
}

func (*Asset[T]) Asset added in v0.0.5

func (a *Asset[T]) Asset() T

func (*Asset[T]) MarshalJSON added in v0.0.5

func (a *Asset[T]) MarshalJSON() ([]byte, error)

func (*Asset[T]) UnmarshalJSON added in v0.0.5

func (a *Asset[T]) UnmarshalJSON(data []byte) error

type AssetOption added in v0.0.5

type AssetOption func(o *assetOptions)

func WithExtension added in v0.0.5

func WithExtension(ext string) AssetOption

func WithSize added in v0.0.5

func WithSize(size int) AssetOption

type Attachment

type Attachment struct {
	ID          Snowflake `json:"id"`
	Filename    string    `json:"filename,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"`
}

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              []*Channel             `json:"threads"`
	Users                []*User                `json:"users"`
	Webhooks             []*Webhook             `json:"webhooks"`
}

type AuditLogChange

type AuditLogChange struct {
	NewValue interface{} `json:"new_value,omitempty"`
	OldValue interface{} `json:"old_value,omitempty"`
	Key      string      `json:"key"`
}

AuditLogChange is the struct representing changes made to the target ID. More details can be found at https://discord.com/developers/docs/resources/audit-log#audit-log-change-object-audit-log-change-structure

type AuditLogChangeKey

type AuditLogChangeKey string
const (
	AuditLogChangeAFKChannelID                AuditLogChangeKey = "afk_channel_id"
	AuditLogChangeAFKTimeout                  AuditLogChangeKey = "afk_timeout"
	AuditLogChangeAdd                         AuditLogChangeKey = "$add"
	AuditLogChangeAllow                       AuditLogChangeKey = "allow"
	AuditLogChangeApplicationID               AuditLogChangeKey = "application_id"
	AuditLogChangeAvatarHash                  AuditLogChangeKey = "avatar_hash"
	AuditLogChangeBannerHash                  AuditLogChangeKey = "banner_hash"
	AuditLogChangeBitrate                     AuditLogChangeKey = "bitrate"
	AuditLogChangeChannelID                   AuditLogChangeKey = "channel_id"
	AuditLogChangeCode                        AuditLogChangeKey = "code"
	AuditLogChangeColor                       AuditLogChangeKey = "color"
	AuditLogChangeDeaf                        AuditLogChangeKey = "deaf"
	AuditLogChangeDefaultMessageNotifications AuditLogChangeKey = "default_message_notifications"
	AuditLogChangeDeny                        AuditLogChangeKey = "deny"
	AuditLogChangeDescription                 AuditLogChangeKey = "description"
	AuditLogChangeDiscoverySplashHash         AuditLogChangeKey = "discovery_splash_hash"
	AuditLogChangeEnableEmoticons             AuditLogChangeKey = "enable_emoticons"
	AuditLogChangeExpireBehaviour             AuditLogChangeKey = "expire_behaviour"
	AuditLogChangeExpireGracePeriod           AuditLogChangeKey = "expire_grace_period"
	AuditLogChangeExplicitContentFilter       AuditLogChangeKey = "explicit_content_filter"
	AuditLogChangeHoist                       AuditLogChangeKey = "hoist"
	AuditLogChangeID                          AuditLogChangeKey = "id"
	AuditLogChangeIconHash                    AuditLogChangeKey = "icon_hash"
	AuditLogChangeInviterID                   AuditLogChangeKey = "inviter_id"
	AuditLogChangeMFALevel                    AuditLogChangeKey = "mfa_level"
	AuditLogChangeMaxAge                      AuditLogChangeKey = "max_age"
	AuditLogChangeMaxUses                     AuditLogChangeKey = "max_uses"
	AuditLogChangeMentionable                 AuditLogChangeKey = "mentionable"
	AuditLogChangeMute                        AuditLogChangeKey = "mute"
	AuditLogChangeNSFW                        AuditLogChangeKey = "nsfw"
	AuditLogChangeName                        AuditLogChangeKey = "name"
	AuditLogChangeNick                        AuditLogChangeKey = "nick"
	AuditLogChangeOwnerID                     AuditLogChangeKey = "owner_id"
	AuditLogChangePermissionOverwrites        AuditLogChangeKey = "permission_overwrites"
	AuditLogChangePermissions                 AuditLogChangeKey = "permissions"
	AuditLogChangePosition                    AuditLogChangeKey = "position"
	AuditLogChangePreferredLocale             AuditLogChangeKey = "preferred_locale"
	AuditLogChangePruneDeleteDays             AuditLogChangeKey = "prune_delete_days"
	AuditLogChangePublicUpdatesChannelID      AuditLogChangeKey = "public_updates_channel_id"
	AuditLogChangeRateLimitPerUser            AuditLogChangeKey = "rate_limit_per_user"
	AuditLogChangeRegion                      AuditLogChangeKey = "region"
	AuditLogChangeRemove                      AuditLogChangeKey = "$remove"
	AuditLogChangeRuleChannelID               AuditLogChangeKey = "rules_channel_id"
	AuditLogChangeSplashHash                  AuditLogChangeKey = "splash_hash"
	AuditLogChangeSystemChannelID             AuditLogChangeKey = "system_channel_id"
	AuditLogChangeTemporary                   AuditLogChangeKey = "temporary"
	AuditLogChangeTopic                       AuditLogChangeKey = "topic"
	AuditLogChangeType                        AuditLogChangeKey = "type"
	AuditLogChangeUserLimit                   AuditLogChangeKey = "user_limit"
	AuditLogChangeUses                        AuditLogChangeKey = "uses"
	AuditLogChangeVanityURLCode               AuditLogChangeKey = "vanity_url_code"
	AuditLogChangeVerificationLevel           AuditLogChangeKey = "verification_level"
	AuditLogChangeWidgetChannelID             AuditLogChangeKey = "widget_channel_id"
	AuditLogChangeWidgetEnabled               AuditLogChangeKey = "widget_enabled"
)

type AuditLogEntry

type AuditLogEntry struct {
	TargetID Snowflake         `json:"target_id"`
	Changes  []*AuditLogChange `json:"changes,omitempty"`
	UserID   Snowflake         `json:"user_id"`
	ID       Snowflake         `json:"id"`
	Event    AuditLogEvent     `json:"action_type"`
	Options  *AuditLogOption   `json:"options,omitempty"`
	Reason   string            `json:"reason,omitempty"`
}

AuditLogEntry represents a single audit log.

type AuditLogEvent

type AuditLogEvent uint
const (
	AuditLogEventChannelCreate AuditLogEvent = iota + 10
	AuditLogEventChannelUpdate
	AuditLogEventChannelDelete
	AuditLogEventOverwriteCreate
	AuditLogEventOverwriteUpdate
	AuditLogEventOverwriteDelete
)
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 (
	AuditLogEventGuildScheduledEventCreate AuditLogEvent = iota + 100
	AuditLogEventGuildScheduledEventUpdate
	AuditLogEventGuildScheduledEventDelete
)
const (
	AuditLogEventThreadCreate AuditLogEvent = iota + 110
	AuditLogEventThreadUpdate
	AuditLogEventThreadDelete
)
const (
	AuditLogAutoModerationRuleCreate AuditLogEvent = iota + 140
	AuditLogAutoModerationRuleUpdate
	AuditLogAutoModerationRuleDelete
	AuditLogAutoModerationBlockMessage
	AuditLogAutoModerationFlagToChannel
	AuditLogAutoModerationUserCommunicationDisabled
)
const (
	AuditLogApplicationCommandPermissionUpdate AuditLogEvent = iota + 121
)
const (
	AuditLogEventGuildUpdate AuditLogEvent = 1
)

func (AuditLogEvent) String

func (i AuditLogEvent) String() string

type AuditLogOption

type AuditLogOption struct {

	// number of days after which inactive members were kicked
	// triggered on MEMBER_PRUNE actions
	DeleteMemberDays string `json:"delete_member_days"`

	// number of members removed by the prune
	// triggered on MEMBER_PRUNE actions
	MembersRemoved string `json:"members_removed"`

	// channel in which the entities were targeted
	// triggered on MEMBER_MOVE & MESSAGE_PIN & MESSAGE_UNPIN & MESSAGE_DELETE actions
	ChannelID Snowflake `json:"channel_id"`

	// id of the message that was targeted
	// triggered for MESSAGE_PIN & MESSAGE_UNPIN actions
	MessageID Snowflake `json:"message_id"`

	// number of entities that were targeted
	// triggered on MESSAGE_DELETE & MESSAGE_BULK_DELETE & MEMBER_DISCONNECT & MEMBER_MOVE actions
	Count string `json:"count"`

	// id of the overwritten entity
	// triggered on CHANNEL_OVERWRITE_CREATE & CHANNEL_OVERWRITE_UPDATE & CHANNEL_OVERWRITE_DELETE actions
	ID Snowflake `json:"id"`

	// type of overwritten entity - "0" for "role" or "1" for "member"
	// triggered on CHANNEL_OVERWRITE_CREATE & CHANNEL_OVERWRITE_UPDATE & CHANNEL_OVERWRITE_DELETE actions
	Type string `json:"type"`

	// name of the role if type is "0" (not present if type is "1")
	// triggered on CHANNEL_OVERWRITE_CREATE & CHANNEL_OVERWRITE_UPDATE & CHANNEL_OVERWRITE_DELETE actions
	RoleName string `json:"role_name"`
}

AuditLogOptions is the options for an audit log entry. More details can be found at https://discord.com/developers/docs/resources/audit-log#audit-log-entry-object-optional-audit-entry-info

type AutoModerationAction

type AutoModerationAction struct {
	Type     AutoModerationActionType      `json:"type"`
	Metadata *AutoModerationActionMetadata `json:"metadata,omitempty"`
}

type AutoModerationActionExecution added in v0.0.5

type AutoModerationActionExecution struct {
	GuildID              Snowflake                 `json:"guild_id"`
	Action               *AutoModerationAction     `json:"action"`
	RuleID               Snowflake                 `json:"rule_id"`
	RuleTriggerType      AutoModerationTriggerType `json:"rule_trigger_type"`
	UserID               Snowflake                 `json:"user_id"`
	ChannelID            *Snowflake                `json:"channel_id"`
	MessageID            *Snowflake                `json:"message_id"`
	AlertSystemMessageID *Snowflake                `json:"alert_system_message_id"`
	Content              string                    `json:"content"`
	MatchedKeyword       *string                   `json:"matched_keyword"`
	MatchedContent       *string                   `json:"matched_content"`
}

type AutoModerationActionMetadata

type AutoModerationActionMetadata struct {
	ChannelID       Snowflake `json:"channel_id,omitempty"`
	DurationSeconds int64     `json:"duration_seconds,omitempty"`
}

type AutoModerationActionType

type AutoModerationActionType uint64
const (
	AutoModerationActionTypeBlockMessage AutoModerationActionType = iota + 1
	AutoModerationActionTypeSendAlertMessage
	AutoModerationActionTypeTimeout
)

func (AutoModerationActionType) String

func (i AutoModerationActionType) String() string

type AutoModerationEventType

type AutoModerationEventType uint64
const (
	AutoModerationEventTypeMessageSend AutoModerationEventType = iota + 1
)

func (AutoModerationEventType) String

func (i AutoModerationEventType) String() string

type AutoModerationKeywordPresetType

type AutoModerationKeywordPresetType uint64
const (
	AutoModerationKeywordPresetTypeProfanity AutoModerationKeywordPresetType = iota + 1
	AutoModerationKeywordPresetTypeSexualContent
	AutoModerationKeywordPresetTypeSlurs
)

func (AutoModerationKeywordPresetType) String

type AutoModerationRule

type AutoModerationRule struct {
	ID              Snowflake                 `json:"id"`
	GuildID         Snowflake                 `json:"guild_id"`
	Name            string                    `json:"name"`
	CreatorID       Snowflake                 `json:"creator_id"`
	EventType       AutoModerationEventType   `json:"event_type"`
	TriggerType     AutoModerationTriggerType `json:"trigger_type"`
	TriggerMetadata TriggerMetadata           `json:"trigger_metadata"`
	Actions         []*AutoModerationAction   `json:"actions"`
	Enabled         bool                      `json:"enabled"`
	ExemptRoles     []Snowflake               `json:"exempt_roles"`
	ExemptChannel   []Snowflake               `json:"exempt_channels"`
}

type AutoModerationRuleCreate added in v0.0.5

type AutoModerationRuleCreate struct {
	*AutoModerationRule
}

type AutoModerationRuleDelete added in v0.0.5

type AutoModerationRuleDelete struct {
	*AutoModerationRule
}

type AutoModerationRuleUpdate added in v0.0.5

type AutoModerationRuleUpdate struct {
	*AutoModerationRule
}

type AutoModerationTriggerMetadata

type AutoModerationTriggerMetadata struct {
	KeywordFilter     []string                          `json:"keyword_filter,omitempty"`
	Presets           []AutoModerationKeywordPresetType `json:"presets,omitempty"`
	AllowList         []string                          `json:"allow_list,omitempty"`
	MentionTotalLimit int                               `json:"mention_total_limit,omitempty"`
}

type AutoModerationTriggerType

type AutoModerationTriggerType uint64
const (
	AutoModerationTriggerTypeKeyword AutoModerationTriggerType = iota + 1
	AutoModerationTriggerTypeSpam
	AutoModerationTriggerTypeKeywordPreset
	AutoModerationTriggerTypeMentionSpam
)

func (AutoModerationTriggerType) String

func (i AutoModerationTriggerType) String() string

type Avatar added in v0.0.5

type Avatar string

func (Avatar) URL added in v0.0.5

func (a Avatar) URL(userID Snowflake, opts ...AssetOption) string

type Ban

type Ban struct {
	Reason string `json:"reason,omitempty"`
	User   *User  `json:"user"`
}

type ButtonStyle

type ButtonStyle int
const (
	ButtonStylePrimary ButtonStyle = iota + 1
	ButtonStyleSecondary
	ButtonStyleSuccess
	ButtonStyleDanger
	ButtonStyleLink
)

func (ButtonStyle) String

func (i ButtonStyle) String() string

type CDNObject added in v0.0.5

type CDNObject interface {
	Avatar | CustomEmoji | GuildIcon
}

type Channel

type Channel struct {
	ID                            Snowflake                 `json:"id"`
	Type                          ChannelType               `json:"type"`
	GuildID                       Snowflake                 `json:"guild_id,omitempty"`
	Position                      int                       `json:"position,omitempty"`
	PermissionOverwrites          []PermissionOverwrite     `json:"permission_overwrites,omitempty"`
	Name                          string                    `json:"name,omitempty"`
	Topic                         string                    `json:"topic,omitempty"`
	NSFW                          bool                      `json:"nsfw,omitempty"`
	LastMessageID                 Snowflake                 `json:"last_message_id,omitempty"`
	Bitrate                       uint                      `json:"bitrate,omitempty"`
	UserLimit                     uint                      `json:"user_limit,omitempty"`
	RateLimitPerUser              uint                      `json:"rate_limit_per_user,omitempty"`
	Recipients                    []*User                   `json:"recipient,omitempty"`
	Icon                          string                    `json:"icon,omitempty"`
	OwnerID                       Snowflake                 `json:"owner_id,omitempty"`
	ApplicationID                 Snowflake                 `json:"application_id,omitempty"`
	ParentID                      Snowflake                 `json:"parent_id,omitempty"`
	LastPinTimestamp              Time                      `json:"last_pin_timestamp,omitempty"`
	RtcRegion                     *string                   `json:"rtc_region,omitempty"`
	VideoQualityMode              *int                      `json:"video_quality_mode,omitempty"`
	MessageCount                  *int                      `json:"message_count,omitempty"`
	MemberCount                   *int                      `json:"member_count,omitempty"`
	ThreadMetadata                *ThreadMetadata           `json:"thread_metadata,omitempty"`
	Member                        *ThreadMember             `json:"member,omitempty"`
	DefaultAutoArchiveDuration    *int                      `json:"default_auto_archive_duration,omitempty"`
	Permissions                   permissions.PermissionBit `json:"permissions,omitempty"`
	Flags                         ChannelFlag               `json:"flags,omitempty"`
	TotalMessagesSent             uint                      `json:"total_message_sent,omitempty"`
	AvailableTags                 []*ForumTag               `json:"available_tags,omitempty"`
	AppliedTags                   []Snowflake               `json:"applied_tags,omitempty"`
	DefaultReactionEmoji          *DefaultReaction          `json:"default_reaction_emoji,omitempty"`
	DefaultThreadRateLimitPerUser int                       `json:"default_thread_rate_limit_per_user,omitempty"`
	DefaultSortOrder              *int                      `json:"default_sort_order,omitempty"`
}

func (*Channel) Mention

func (c *Channel) Mention() string

type ChannelCreate

type ChannelCreate struct {
	*Channel
}

type ChannelDelete

type ChannelDelete struct {
	*Channel
}

type ChannelFlag

type ChannelFlag uint64
const (
	ChannelFlagPinned ChannelFlag = 1 << (iota + 1)

	ChannelFlagRequireTag
)

func (ChannelFlag) String

func (i ChannelFlag) String() string

type ChannelForumSortOrder

type ChannelForumSortOrder uint64
const (
	ChannelForumSortOrderLatestActivity ChannelForumSortOrder = iota
	ChannelForumSortOrderCreationDate
)

func (ChannelForumSortOrder) String

func (i ChannelForumSortOrder) String() string

type ChannelMention

type ChannelMention struct {
	ID      Snowflake   `json:"id"`
	GuildID Snowflake   `json:"guild_id"`
	Type    ChannelType `json:"type"`
	Name    string      `json:"name"`
}

type ChannelPinsUpdate

type ChannelPinsUpdate struct {
	GuildID          Snowflake `json:"guild_id"`
	ChannelID        Snowflake `json:"channel_id"`
	LastPinTimestamp Time      `json:"last_pin_timestamp"`
}

type ChannelType

type ChannelType uint
const (
	ChannelTypeGuildText ChannelType = iota
	ChannelTypeDM
	ChannelTypeGuildVoice
	ChannelTypeGroupDM
	ChannelTypeGuildCategory
	ChannelTypeGuildAnnouncement

	ChannelTypeAnnouncementThread
	ChannelTypePublicThread
	ChannelTypePrivateThread
	ChannelTypeGuildStageVoice
	ChannelTypeGuildDirectory
	ChannelTypeGuildForum
)

func (ChannelType) String

func (i ChannelType) String() string

type ChannelUpdate

type ChannelUpdate struct {
	*Channel
}

type ClientStatus

type ClientStatus struct {
	Desktop string `json:"desktop,omitempty"`
	Mobile  string `json:"mobile,omitempty"`
	Web     string `json:"web,omitempty"`
}

type Component

type Component struct {
	Type         ComponentType    `json:"type"`
	CustomID     string           `json:"custom_id,omitempty"`
	Disabled     bool             `json:"disabled,omitempty"`
	Label        string           `json:"label,omitempty"`
	Style        ButtonStyle      `json:"style,omitempty"`
	Emoji        *Emoji           `json:"emoji,omitempty"`
	URL          string           `json:"url,omitempty"`
	Options      []*SelectOptions `json:"options,omitempty"`
	ChannelTypes []ChannelType    `json:"channel_types,omitempty"`
	Placeholder  string           `json:"placeholder,omitempty"`
	// Must be a pointer, discord assumes omitted value = 1
	MinValues  *int         `json:"min_values,omitempty"`
	MaxValues  *int         `json:"max_values,omitempty"`
	MinLength  *int         `json:"min_length,omitempty"`
	MaxLength  *int         `json:"max_length,omitempty"`
	Value      string       `json:"value,omitempty"`
	Required   bool         `json:"required,omitempty"`
	Components []*Component `json:"components,omitempty"`
}

type ComponentType

type ComponentType int
const (
	ComponentTypeActionRow ComponentType = iota + 1
	ComponentTypeButton
	ComponentTypeSelectMenu
	// ComponentTypeInputText is only usable in modals
	ComponentTypeInputText
	ComponentTypeUserSelect
	ComponentTypeRoleSelect
	ComponentTypeMentionableSelect
	ComponentTypeChannelSelect
)

func (ComponentType) String

func (i ComponentType) String() string

type Connection

type Connection struct {
	ID           string         `json:"id"`
	Name         string         `json:"name"`
	Type         Service        `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"`
	TwoWayLink   bool           `json:"two_way_link"`
	Visibility   Visibility     `json:"visibility"`
}

type CustomEmoji added in v0.0.5

type CustomEmoji Snowflake

func (CustomEmoji) URL added in v0.0.5

func (c CustomEmoji) URL(opts ...AssetOption) string

type DefaultReaction

type DefaultReaction struct {
	EmojiID   Snowflake `json:"emoji_id,omitempty"`
	EmojiName string    `json:"emoji_name,omitempty"`
}

type DiscordFile

type DiscordFile struct {
	*bytes.Buffer
	Filename    string
	Description string
	ContentType string
	Spoiler     bool
}

func NewDiscordFile

func NewDiscordFile(r io.Reader, filename, description string) (*DiscordFile, error)

func (*DiscordFile) GenerateAttachment

func (f *DiscordFile) GenerateAttachment(index Snowflake, m *multipart.Writer) (*Attachment, error)

type Embed

type Embed struct {
	Title       string          `json:"title,omitempty"`
	Type        string          `json:"type,omitempty"`
	Description string          `json:"description,omitempty"`
	URL         string          `json:"url,omitempty"`
	Timestamp   Time            `json:"timetimestamp"`
	Color       int             `json:"color,omitempty"`
	Footer      *EmbedFooter    `json:"footer,omitempty"`
	Image       *EmbedImage     `json:"image,omitempty"`
	Thumbnail   *EmbedThumbnail `json:"thumbnail,omitempty"`
	Video       *EmbedVideo     `json:"video,omitempty"`
	Provider    *EmbedProvider  `json:"provider,omitempty"`
	Author      *EmbedAuthor    `json:"author,omitempty"`
	Fields      []*EmbedField   `json:"fields,omitempty"`
}

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"`
}

type EmbedField

type EmbedField struct {
	Name   string `json:"name"`
	Value  string `json:"value"`
	Inline bool   `json:"inline,omitempty"`
}

type EmbedFooter

type EmbedFooter struct {
	Text         string `json:"text"`
	IconURL      string `json:"icon_url,omitempty"`
	ProxyIconURl string `json:"proxy_icon_url,omitempty"`
}

type EmbedImage

type EmbedImage struct {
	URL      string `json:"url,omitempty"`
	ProxyURL string `json:"proxy_url,omitempty"`
	Height   int    `json:"height,omitempty"`
	Width    int    `json:"width,omitempty"`
}

type EmbedProvider

type EmbedProvider struct {
	Name string `json:"name,omitempty"`
	URL  string `json:"url,omitempty"`
}

type EmbedThumbnail

type EmbedThumbnail struct {
	URL      string `json:"url,omitempty"`
	ProxyURL string `json:"proxy_url,omitempty"`
	Height   int    `json:"height,omitempty"`
	Width    int    `json:"width,omitempty"`
}

type EmbedVideo

type EmbedVideo struct {
	URL    string `json:"url,omitempty"`
	Height int    `json:"height,omitempty"`
	Width  int    `json:"width,omitempty"`
}

type Emoji

type Emoji struct {
	ID            Snowflake   `json:"id"`
	Name          string      `json:"name,omitempty"`
	Roles         []Snowflake `json:"roles,omitempty"`
	User          *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"`
}

func (*Emoji) Mention

func (e *Emoji) Mention() string

func (*Emoji) String

func (e *Emoji) String() string

type ExpireBehavior

type ExpireBehavior uint
const (
	ExpireBehaviorRemoveRole ExpireBehavior = iota
	ExpireBehaviorKick
)

func (ExpireBehavior) String

func (i ExpireBehavior) String() string

type ExplicitContentFilterLevel

type ExplicitContentFilterLevel uint
const (
	ExplicitContentFilterLevelDisabled ExplicitContentFilterLevel = iota
	ExplicitContentFilterLevelMembersWithoutRoles
	ExplicitContentFilterLevelAllMembers
)

func (ExplicitContentFilterLevel) String

type FollowedChannel

type FollowedChannel struct {
	ChannelID Snowflake `json:"channel_id"`
	WebhookID Snowflake `json:"webhook_id"`
}

type ForumTag

type ForumTag struct {
	ID        Snowflake `json:"id"`
	Name      string    `json:"name"`
	Moderated bool      `json:"moderated"`
	EmojiID   Snowflake `json:"emoji_id"`
	EmojiName string    `json:"string,omitempty"`
}

type ForumThreadChannel

type ForumThreadChannel struct {
	*Channel
	Message *Message
}

type Gateway

type Gateway struct {
	URL               string `json:"url"`
	Shards            int    `json:"shards"`
	SessionStartLimit struct {
		Total          int `json:"total"`
		Remaining      int `json:"remaining"`
		ResetAfter     int `json:"reset_after"`
		MaxConcurrency int `json:"max_concurrency"`
	} `json:"session_start_limit"`
}

type Guild

type Guild struct {
	ID                          Snowflake                  `json:"id"`
	Name                        string                     `json:"name"`
	Icon                        Asset[GuildIcon]           `json:"icon,omitempty"`
	IconHash                    string                     `json:"icon_hash,omitempty"`
	Splash                      string                     `json:"splash,omitempty"`
	DiscoverySplash             string                     `json:"discovery_splash,omitempty"`
	Owner                       bool                       `json:"owner,omitempty"`
	OwnerID                     Snowflake                  `json:"owner_id"`
	Permissions                 permissions.PermissionBit  `json:"permissions,omitempty"`
	Region                      string                     `json:"region"`
	AFKChannelID                Snowflake                  `json:"afk_channel_id,omitempty"`
	AFKTimeout                  int                        `json:"afk_timeout,omitempty"`
	WidgetEnabled               bool                       `json:"widget_enabled,omitempty"`
	WidgetChannelID             Snowflake                  `json:"widget_channel_id,omitempty"`
	VerificationLevel           VerificationLevel          `json:"verification_level"`
	DefaultMessageNotifications MessageNotificationsLevel  `json:"default_message_notifications"`
	ExplicitContentFilter       ExplicitContentFilterLevel `json:"explicit_content_filter"`
	Roles                       []*Role                    `json:"roles"`
	Emojis                      []*Emoji                   `json:"emojis"`
	Features                    []GuildFeature             `json:"features"`
	MFALevel                    MFALevel                   `json:"mfa_level"`
	ApplicationID               Snowflake                  `json:"application_id,omitempty"`
	SystemChannelID             Snowflake                  `json:"system_channel_id,omitempty"`
	SystemChannelFlags          SystemChannelFlags         `json:"system_channel_flags"`
	RulesChannelID              Snowflake                  `json:"rules_channel_id,omitempty"`
	JoinedAt                    Time                       `json:"joined_at,omitempty"`
	Large                       bool                       `json:"large,omitempty"`
	Unavailable                 bool                       `json:"unavailable,omitempty"`
	MemberCount                 int                        `json:"member_count,omitempty"`
	VoiceStates                 []*VoiceState              `json:"voice_states,omitempty"`
	Members                     []*GuildMember             `json:"members,omitempty"`
	Channels                    []*Channel                 `json:"channels,omitempty"`
	Presences                   []*PresenceUpdate          `json:"presences,omitempty"`
	MaxPresences                int                        `json:"max_presences,omitempty"`
	MaxMembers                  int                        `json:"max_members,omitempty"`
	VanityURLCode               string                     `json:"vanity_url_code,omitempty"`
	Description                 string                     `json:"description,omitempty"`
	Banner                      string                     `json:"banned,omitempty"`
	PremiumTier                 PremiumTierLevel           `json:"premium_tier"`
	PremiumSubscriptionCount    int                        `json:"premium_subscription_count,omitempty"`
	PreferredLocale             string                     `json:"preferred_locale"`
	PublicUpdatesChannelID      Snowflake                  `json:"public_updates_channel_id,omitempty"`
	MaxVideoChannelUsers        int                        `json:"max_video_channel_users,omitempty"`
	ApproximateMemberCount      int                        `json:"approximate_member_count,omitempty"`
	ApproximatePresenceCount    int                        `json:"approximate_presence_count,omitempty"`
	WelcomeScreen               *WelcomeScreen             `json:"welcome_screen,omitempty"`
	NSFWLevel                   GuildNSFWLevel             `json:"nsfw_level"`
	Stickers                    []*Sticker                 `json:"stickers"`
	PremiumBarEnabled           bool                       `json:"premium_progress_bar_enabled"`
}

type GuildApplicationCommandPermissions

type GuildApplicationCommandPermissions struct {
	ID            Snowflake                       `json:"id"`
	ApplicationID Snowflake                       `json:"application_id"`
	GuildID       Snowflake                       `json:"guild_id"`
	Permissions   []ApplicationCommandPermissions `json:"permissions"`
}

type GuildAuditLogEntryCreate added in v0.0.5

type GuildAuditLogEntryCreate struct {
	GuildID Snowflake `json:"guild_id"`
	*AuditLogEntry
}

type GuildBanAdd

type GuildBanAdd struct {
	GuildID Snowflake `json:"guild_id"`
	User    *User     `json:"user"`
}

type GuildBanRemove

type GuildBanRemove struct {
	GuildID Snowflake `json:"guild_id"`
	User    *User     `json:"user"`
}

type GuildCreate

type GuildCreate struct {
	*Guild
}

type GuildDelete

type GuildDelete struct {
	*Guild
}

type GuildEmojisUpdate

type GuildEmojisUpdate struct {
	GuildID Snowflake `json:"guild_id"`
	Emojis  []*Emoji  `json:"emojis"`
}

type GuildFeature

type GuildFeature string
const (
	GuildFeatureAnimatedBanner                GuildFeature = "ANIMATED_BANNER"
	GuildFeatureAnimatedIcon                  GuildFeature = "ANIMATED_ICON"
	GuildFeatureAutoModeration                GuildFeature = "AUTO_MODERATION"
	GuildFeatureBanner                        GuildFeature = "BANNER"
	GuildFeatureCommunity                     GuildFeature = "COMMUNITY"
	GuildDeveloperSupportServer               GuildFeature = "DEVELOPER_SUPPORT_SERVER"
	GuildFeatureDiscoverable                  GuildFeature = "DISCOVERABLE"
	GuildFeatureFeaturable                    GuildFeature = "FEATURABLE"
	GuildFeatureInvitesDisabled               GuildFeature = "INVITES_DISABLED"
	GuildFeatureInviteSplash                  GuildFeature = "INVITE_SPLASH"
	GuildFeatureMemberVerificationGateEnabled GuildFeature = "MEMBER_VERIFICATION_GATE_ENABLED"
	GuildFeatureMonetizationEnabled           GuildFeature = "MONETIZATION_ENABLED"
	GuildFeatureMoreStickers                  GuildFeature = "MORE_STICKERS"
	GuildFeatureNews                          GuildFeature = "NEWS"
	GuildFeaturePartnered                     GuildFeature = "PARTNERED"
	GuildFeaturePreviewEnabled                GuildFeature = "PREVIEW_ENABLED"
	GuildFeaturePrivateThreads                GuildFeature = "PRIVATE_THREADS"
	GuildFeatureRoleIcons                     GuildFeature = "ROLE_ICONS"
	GuildFeatureTicketedEventsEnabled         GuildFeature = "TICKETED_EVENTS_ENABLED"
	GuildFeatureVanityURL                     GuildFeature = "VANITY_URL"
	GuildFeatureVerified                      GuildFeature = "VERIFIED"
	GuildFeatureVIPRegions                    GuildFeature = "VIP_REGIONS"
	GuildFeatureWelcomeScreenEnabled          GuildFeature = "WELCOME_SCREEN_ENABLED"
)

type GuildIcon added in v0.0.5

type GuildIcon string

func (GuildIcon) URL added in v0.0.5

func (g GuildIcon) URL(guildID Snowflake, opts ...AssetOption) string

type GuildIntegrationsUpdate

type GuildIntegrationsUpdate struct {
	GuildID Snowflake `json:"guild_id"`
}

type GuildMember

type GuildMember struct {
	User                       *User                     `json:"user,omitempty"`
	Nick                       string                    `json:"nick,omitempty"`
	Avatar                     string                    `json:"avatar,omitempty"`
	Roles                      []Snowflake               `json:"roles"`
	JoinedAt                   Time                      `json:"joined_at"`
	PremiumSince               Time                      `json:"premium_since,omitempty"`
	Deaf                       bool                      `json:"deaf"`
	Mute                       bool                      `json:"mute"`
	Flags                      GuildMemberFlag           `json:"flags,omitempty"`
	Pending                    bool                      `json:"pending,omitempty"`
	Permissions                permissions.PermissionBit `json:"permissions,omitempty"`
	CommunicationDisabledUntil *Time                     `json:"communication_disabled_until,omitempty"`
}

func (*GuildMember) Mention

func (m *GuildMember) Mention() string

type GuildMemberAdd

type GuildMemberAdd struct {
	GuildID Snowflake `json:"guild_id"`
	*GuildMember
}

type GuildMemberFlag added in v0.0.5

type GuildMemberFlag uint
const (
	DidRejoin GuildMemberFlag = 1 << iota
	CompletedOnboarding
	BypassesVerification
	StartedOnboarding
)

type GuildMemberRemove

type GuildMemberRemove struct {
	GuildID Snowflake `json:"guild_id"`
	User    *User     `json:"user"`
}

type GuildMemberUpdate

type GuildMemberUpdate struct {
	GuildID Snowflake `json:"guild_id"`
	*GuildMember
}

type GuildMembersChunk

type GuildMembersChunk struct {
	GuildID    Snowflake      `json:"guild_id"`
	Members    []*GuildMember `json:"members"`
	ChunkIndex int            `json:"chunk_index"`
	ChunkCount int            `json:"chunk_count"`
	NotFound   []Snowflake    `json:"not_found"`
	// Presences []*Presence `json:"presences"`
	Nonce string `json:"nonce"`
}

type GuildNSFWLevel

type GuildNSFWLevel int
const (
	GuildNSFWLevelDefault GuildNSFWLevel = iota
	GuildNSFWLevelExplicit
	GuildNSFWLevelSafe
	GuildNSFWLevelAgeRestricted
)

func (GuildNSFWLevel) String

func (i GuildNSFWLevel) String() string

type GuildOnboarding added in v0.0.5

type GuildOnboarding struct {
	GuildID      Snowflake                `json:"guild_id"`
	Options      []*GuildOnboardingPrompt `json:"options"`
	Title        string                   `json:"title"`
	SingleSelect bool                     `json:"single_select"`
	InOnboarding bool                     `json:"in_onboarding"`
	Type         PromptType               `json:"type"`
}

type GuildOnboardingPrompt added in v0.0.5

type GuildOnboardingPrompt struct {
	ID          Snowflake   `json:"id"`
	ChannelIDs  []Snowflake `json:"channel_ids"`
	RoleIDs     []Snowflake `json:"role_ids"`
	EmojiID     Snowflake   `json:"emoji_id"`
	EmojiName   string      `json:"emoji_name"`
	Title       string      `json:"tile"`
	Description string      `json:"description"`
}

type GuildPreview

type GuildPreview struct {
	ID                       Snowflake      `json:"id"`
	Name                     string         `json:"name"`
	Icon                     string         `json:"icon,omitempty"`
	Splash                   string         `json:"splash,omitempty"`
	DiscoverySplash          string         `json:"discovery_splash,omitempty"`
	Emojis                   []*Emoji       `json:"emojis"`
	Features                 []GuildFeature `json:"features"`
	ApproximateMemberCount   int            `json:"approximate_member_count"`
	ApproximatePresenceCount int            `json:"approximate_presence_count"`
	Description              string         `json:"description,omitempty"`
}

type GuildRoleCreate

type GuildRoleCreate struct {
	GuildID Snowflake `json:"guild_id"`
	Role    *Role     `json:"role"`
}

type GuildRoleDelete

type GuildRoleDelete struct {
	GuildID Snowflake `json:"guild_id"`
	RoleID  Snowflake `json:"role_id"`
}

type GuildRoleUpdate

type GuildRoleUpdate struct {
	GuildID Snowflake `json:"guild_id"`
	Role    *Role     `json:"role"`
}

type GuildScheduledEvent

type GuildScheduledEvent struct {
	ID                 Snowflake                          `json:"id"`
	GuildID            Snowflake                          `json:"guild_id"`
	ChannelID          *Snowflake                         `json:"channel_id,omitempty"`
	CreatorID          *Snowflake                         `json:"creator_id,omitempty"`
	Name               string                             `json:"name"`
	Description        *string                            `json:"description,omitempty"`
	ScheduledStartTime Time                               `json:"scheduled_start_time"`
	ScheduledEndTime   Time                               `json:"scheduled_end_time"`
	PrivacyLevel       PrivacyLevel                       `json:"privacy_level"`
	Status             GuildScheduledEventStatus          `json:"status"`
	EntityType         GuildScheduledEventEntityType      `json:"entity_type"`
	EntityID           *Snowflake                         `json:"entity_id,omitempty"`
	EntityMetadata     *GuildScheduledEventEntityMetadata `json:"entity_metadata,omitempty"`
	Creator            *User                              `json:"creator,omitempty"`
	UserCount          int                                `json:"user_count"`
	Image              string                             `json:"image"`
}

type GuildScheduledEventCreate added in v0.0.5

type GuildScheduledEventCreate struct {
	*GuildScheduledEvent
}

type GuildScheduledEventDelete added in v0.0.5

type GuildScheduledEventDelete struct {
	*GuildScheduledEvent
}

type GuildScheduledEventEntityMetadata

type GuildScheduledEventEntityMetadata struct {
	Location string `json:"location"`
}

type GuildScheduledEventEntityType

type GuildScheduledEventEntityType int
const (
	EntityTypeStageInstance GuildScheduledEventEntityType = iota + 1
	EntityTypeVoice
	EntityTypeExternal
)

func (GuildScheduledEventEntityType) String

type GuildScheduledEventStatus

type GuildScheduledEventStatus int
const (
	EventStatusScheduled GuildScheduledEventStatus = iota + 1
	EventStatusActive
	EventStatusCompleted
	EventStatusCanceled
)

func (GuildScheduledEventStatus) String

func (i GuildScheduledEventStatus) String() string

type GuildScheduledEventUpdate added in v0.0.5

type GuildScheduledEventUpdate struct {
	*GuildScheduledEvent
}

type GuildScheduledEventUser

type GuildScheduledEventUser struct {
	ScheduledEventID Snowflake    `json:"guild_scheduled_event_id"`
	User             *User        `json:"user"`
	Member           *GuildMember `json:"member"`
}

type GuildScheduledEventUserAdd added in v0.0.5

type GuildScheduledEventUserAdd struct {
	EventID Snowflake `json:"guild_scheduled_event_id"`
	UserID  Snowflake `json:"user_id"`
	GuildID Snowflake `json:"guild_id"`
}

type GuildScheduledEventUserRemove added in v0.0.5

type GuildScheduledEventUserRemove struct {
	EventID Snowflake `json:"guild_scheduled_event_id"`
	UserID  Snowflake `json:"user_id"`
	GuildID Snowflake `json:"guild_id"`
}

type GuildStickersUpdate

type GuildStickersUpdate struct {
	GuildID  Snowflake  `json:"guild_id"`
	Stickers []*Sticker `json:"stickers"`
}

type GuildUpdate

type GuildUpdate struct {
	*Guild
}

type GuildWidget

type GuildWidget struct {
	Enabled   bool      `json:"enabled"`
	ChannelID Snowflake `json:"channel_id,omitempty"`
}

type GuildWidgetJSON

type GuildWidgetJSON struct {
	ID            Snowflake     `json:"id"`
	Name          string        `json:"name"`
	Channels      []*Channel    `json:"channels"`
	Members       []*WidgetUser `json:"members"`
	PresenceCount int           `json:"presence_count"`
}

type HandlerFunc

type HandlerFunc func(data *Interaction) *InteractionResponse

type Hello

type Hello struct {
	HeartbeatInterval int64 `json:"heartbeat_interval"`
}

type Identify

type Identify struct {
	Token          string         `json:"token"`
	Properties     Properties     `json:"properties"`
	LargeThreshold int64          `json:"large_threshold"`
	Compress       bool           `json:"compress"`
	Shard          []int          `json:"shard"`
	Presence       UpdatePresence `json:"presence"`
	Intents        Intent         `json:"intents"`
}

type InstallParams

type InstallParams struct {
	Scopes      []string `json:"scopes"`
	Permissions string   `json:"permissions"`
}

type Integration

type Integration struct {
	ID                Snowflake               `json:"id"`
	Name              string                  `json:"name"`
	Type              string                  `json:"type"`
	Enabled           bool                    `json:"enabled"`
	Syncing           bool                    `json:"syncing,omitempty"`
	RoleID            Snowflake               `json:"role_id,omitempty"`
	EnableEmoticons   bool                    `json:"enable_emoticons,omitempty"`
	ExpireBehavior    ExpireBehavior          `json:"expire_behaviour,omitempty"`
	ExpireGracePeriod int64                   `json:"expire_grace_period,omitempty"`
	User              *User                   `json:"user,omitempty"`
	Account           *IntegrationAccount     `json:"account,omitempty"`
	SyncedAt          Time                    `json:"synced_at,omitempty"`
	SubscriberCount   int64                   `json:"subscriber_count,omitempty"`
	Revoked           bool                    `json:"revoked,omitempty"`
	Application       *IntegrationApplication `json:"application,omitempty"`
	Scopes            []string                `json:"scopes,omitempty"`
}

type IntegrationAccount

type IntegrationAccount struct {
	ID   Snowflake `json:"id"`
	Name string    `json:"name"`
}

type IntegrationApplication

type IntegrationApplication struct {
	ID          Snowflake `json:"id"`
	Name        string    `json:"name"`
	Icon        string    `json:"icon,omitempty"`
	Description string    `json:"description"`
	Summary     string    `json:"summary"`
	Bot         *User     `json:"bot,omitempty"`
}

type IntegrationCreate

type IntegrationCreate struct {
	GuildID Snowflake `json:"guild_id"`
	*Integration
}

type IntegrationDelete

type IntegrationDelete struct {
	ID            Snowflake `json:"id"`
	GuildID       Snowflake `json:"guild_id"`
	ApplicationID Snowflake `json:"application_id"`
}

type IntegrationUpdate

type IntegrationUpdate struct {
	GuildID Snowflake `json:"guild_id"`
	*Integration
}

type Intent

type Intent int
const (
	IntentsGuilds Intent = 1 << iota
	IntentsGuildMembers
	IntentsGuildModeration
	IntentsGuildEmojisAndStickers
	IntentsGuildIntegrations
	IntentsGuildWebhooks
	IntentsGuildInvites
	IntentsGuildVoiceStates
	IntentsGuildPresences
	IntentsGuildMessages
	IntentsGuildMessageReactions
	IntentsGuildMessageTyping
	IntentsDirectMessages
	IntentsDirectMessageReactions
	IntentsDirectMessageTyping
	IntentsMessageContent
	IntentsGuildScheduledEvents

	IntentsAutoModerationConfiguration
	IntentsAutoModerationExecution
)

type Interaction

type Interaction struct {
	ID             Snowflake                 `json:"id"`
	ApplicationID  Snowflake                 `json:"application_id"`
	Type           InteractionType           `json:"type"`
	Data           json.RawMessage           `json:"data,omitempty"`
	GuildID        Snowflake                 `json:"guild_id"`
	ChannelID      Snowflake                 `json:"channel_id"`
	Member         *GuildMember              `json:"member"`
	User           *User                     `json:"user"`
	Token          string                    `json:"token"`
	Version        int                       `json:"version,omitempty"`
	Message        *Message                  `json:"message,omitempty"`
	AppPermissions permissions.PermissionBit `json:"app_permissions"`
	Locale         string                    `json:"locale"`
	GuildLocale    string                    `json:"guild_locale"`
}

type InteractionApplicationCommandCallbackData deprecated

type InteractionApplicationCommandCallbackData struct {
	TTS             bool                              `json:"tts,omitempty"`
	Content         string                            `json:"content,omitempty"`
	Embeds          []*Embed                          `json:"embeds,omitempty"`
	AllowedMentions *AllowedMentions                  `json:"allowed_mentions,omitempty"`
	Flags           MessageFlag                       `json:"flags,omitempty"`
	Components      []*Component                      `json:"components"`
	Attachments     []*Attachment                     `json:"attachments,omitempty"`
	Files           []*DiscordFile                    `json:"-"`
	Choices         []*ApplicationCommandOptionChoice `json:"choices,omitempty"`
	// Data for modal response
	CustomID string `json:"custom_id,omitempty"`
	Title    string `json:"title,omitempty"`
}

Deprecated: InteractionApplicationCommandCallbackData is deprecated. Please see InteractionMessagesCallbackData, InteractionAutocompleteCallbackData, and InteractionModalCallbackData

type InteractionAutocompleteCallbackData added in v0.0.3

type InteractionAutocompleteCallbackData struct {
	Choices []*ApplicationCommandOptionChoice `json:"choices,omitempty"`
}

type InteractionCreate

type InteractionCreate struct {
	*Interaction
}

type InteractionMessagesCallbackData added in v0.0.3

type InteractionMessagesCallbackData struct {
	TTS             bool             `json:"tts,omitempty"`
	Content         string           `json:"content,omitempty"`
	Embeds          []*Embed         `json:"embeds,omitempty"`
	AllowedMentions *AllowedMentions `json:"allowed_mentions,omitempty"`
	Flags           MessageFlag      `json:"flags,omitempty"`
	Components      []*Component     `json:"components"`
	Attachments     []*Attachment    `json:"attachments,omitempty"`
	Files           []*DiscordFile   `json:"-"`
}

type InteractionModalCallbackData added in v0.0.3

type InteractionModalCallbackData struct {
	CustomID   string       `json:"custom_id,omitempty"`
	Title      string       `json:"title,omitempty"`
	Components []*Component `json:"components"`
}

type InteractionResponse

type InteractionResponse struct {
	Type ResponseType `json:"type"`
	Data interface{}  `json:"data,omitempty"`
}

type InteractionResponseComponent

type InteractionResponseComponent struct {
	Type       ComponentType                   `json:"type"`
	CustomID   string                          `json:"custom_id"`
	Value      string                          `json:"value"`
	Components []*InteractionResponseComponent `json:"components,omitempty"`
}

type InteractionType

type InteractionType int
const (
	InteractionRequestPing InteractionType = iota + 1
	InteractionApplicationCommand
	InteractionComponent
	InteractionAutoComplete
	InteractionModalSubmit
)

Interaction types

func (InteractionType) String

func (i InteractionType) String() string

type Invite

type Invite struct {
	// the invite code (unique ID)
	Code string `json:"code"`

	// the guild this invite is for
	Guild *Guild `json:"guild,omitempty"`

	// the channel this invite is for
	Channel *Channel `json:"channel"`

	// the user who created the invite
	Inviter *User `json:"inviter,omitempty"`

	// The target type for this invite
	TargetType InviteTargetType `json:"target_type,omitempty"`

	// the target user for this invite
	TargetUser *User `json:"target_user,omitempty"`

	// The application the invite is targeting
	TargetApplication *Application `json:"target_application,omitempty"`

	// approximate count of online members (only present when target_user is set)
	ApproximatePresenceCount int `json:"approximate_presence_count,omitempty"`

	// approximate count of total members
	ApproximateMemberCount int `json:"approximate_member_count,omitempty"`

	// the expiration date of this invite, returned from the GET /invites/<code> endpoint when with_expiration is true
	ExpiresAt *Time `json:"expires_at,omitempty"`

	// guild scheduled event data, only included if guild_scheduled_event_id contains a valid guild scheduled event id
	GuildScheduledEvent *GuildScheduledEvent `json:"guild_scheduled_event,omitempty"`

	// number of times this invite has been used
	Uses int `json:"uses"`

	// max number of times this invite can be used
	MaxUses int `json:"max_uses"`

	// duration (in seconds) after which the invite expires
	MaxAge int `json:"max_age"`

	// whether this invite only grants temporary membership
	Temporary bool `json:"temporary"`

	// when this invite was created
	CreatedAt Time `json:"created_at"`
}

Invite represents a code that when used, adds a user to a guild or group DM channel. https://discord.com/developers/docs/resources/invite#invite-object-invite-structure

type InviteCreate

type InviteCreate struct {
	ChannelID         Snowflake        `json:"channel_id"`
	Code              string           `json:"code"`
	CreatedAt         Time             `json:"created_at"`
	GuildID           Snowflake        `json:"guild_id"`
	Inviter           *User            `json:"inviter"`
	MaxAge            int              `json:"max_age"`
	MaxUses           int              `json:"max_uses"`
	TargetType        InviteTargetType `json:"target_type"`
	TargetUser        *User            `json:"target_user"`
	TargetApplication *Application     `json:"target_application"`
	Temporary         bool             `json:"temporary"`
	Uses              int              `json:"uses"`
}

type InviteDelete

type InviteDelete struct {
	ChannelID Snowflake `json:"channel_id"`
	GuildID   Snowflake `json:"guild_id"`
	Code      string    `json:"code"`
}

type InviteTargetType

type InviteTargetType int

https://discord.com/developers/docs/resources/invite#invite-object-invite-structure

const (
	InviteTargetTypeStream InviteTargetType = iota + 1
	InviteTargetTypeEmbeddedApplication
)

func (InviteTargetType) String

func (i InviteTargetType) String() string

type JSONErrorCode

type JSONErrorCode uint
const (
	JSONErrorGeneralError                                                     JSONErrorCode = 0      // General error (such as a malformed request body, amongst other things)
	JSONErrorUnknownAccount                                                   JSONErrorCode = 10001  // Unknown account
	JSONErrorUnknownApplication                                               JSONErrorCode = 10002  // Unknown application
	JSONErrorUnknownChannel                                                   JSONErrorCode = 10003  // Unknown channel
	JSONErrorUnknownGuild                                                     JSONErrorCode = 10004  // Unknown guild
	JSONErrorUnknownIntegration                                               JSONErrorCode = 10005  // Unknown integration
	JSONErrorUnknownInvite                                                    JSONErrorCode = 10006  // Unknown invite
	JSONErrorUnknownMember                                                    JSONErrorCode = 10007  // Unknown member
	JSONErrorUnknownMessage                                                   JSONErrorCode = 10008  // Unknown message
	JSONErrorUnknownPermissionOverwrite                                       JSONErrorCode = 10009  // Unknown permission overwrite
	JSONErrorUnknownProvider                                                  JSONErrorCode = 10010  // Unknown provider
	JSONErrorUnknownRole                                                      JSONErrorCode = 10011  // Unknown role
	JSONErrorUnknownToken                                                     JSONErrorCode = 10012  // Unknown token
	JSONErrorUnknownUser                                                      JSONErrorCode = 10013  // Unknown user
	JSONErrorUnknownEmoji                                                     JSONErrorCode = 10014  // Unknown emoji
	JSONErrorUnknownWebhook                                                   JSONErrorCode = 10015  // Unknown webhook
	JSONErrorUnknownWebhookService                                            JSONErrorCode = 10016  // Unknown webhook service
	JSONErrorUnknownSession                                                   JSONErrorCode = 10020  // Unknown session
	JSONErrorUnknownBan                                                       JSONErrorCode = 10026  // Unknown ban
	JSONErrorUnknownSKU                                                       JSONErrorCode = 10027  // Unknown SKU
	JSONErrorUnknownStoreListing                                              JSONErrorCode = 10028  // Unknown Store Listing
	JSONErrorUnknownEntitlement                                               JSONErrorCode = 10029  // Unknown entitlement
	JSONErrorUnknownBuild                                                     JSONErrorCode = 10030  // Unknown build
	JSONErrorUnknownLobby                                                     JSONErrorCode = 10031  // Unknown lobby
	JSONErrorUnknownBranch                                                    JSONErrorCode = 10032  // Unknown branch
	JSONErrorUnknownStoreDirectoryLayout                                      JSONErrorCode = 10033  // Unknown store directory layout
	JSONErrorUnknownRedistributable                                           JSONErrorCode = 10036  // Unknown redistributable
	JSONErrorUnknownGiftCode                                                  JSONErrorCode = 10038  // Unknown gift code
	JSONErrorUnknownStream                                                    JSONErrorCode = 10049  // Unknown stream
	JSONErrorUnknownPremiumServerSubscribeCooldown                            JSONErrorCode = 10050  // Unknown premium server subscribe cooldown
	JSONErrorUnknownGuildTemplate                                             JSONErrorCode = 10057  // Unknown guild template
	JSONErrorUnknownDiscoverableServerCategory                                JSONErrorCode = 10059  // Unknown discoverable server category
	JSONErrorUnknownSticker                                                   JSONErrorCode = 10060  // Unknown sticker
	JSONErrorUnknownInteraction                                               JSONErrorCode = 10062  // Unknown interaction
	JSONErrorUnknownApplicationCommand                                        JSONErrorCode = 10063  // Unknown application command
	JSONErrorUnknownApplicationCommandPermissions                             JSONErrorCode = 10066  // Unknown application command permissions
	JSONErrorUnknownStageInstance                                             JSONErrorCode = 10067  // Unknown Stage Instance
	JSONErrorUnknownGuildMemberVerificationForm                               JSONErrorCode = 10068  // Unknown Guild Member Verification Form
	JSONErrorUnknownGuildWelcomeScreen                                        JSONErrorCode = 10069  // Unknown Guild Welcome Screen
	JSONErrorUnknownGuildScheduledEvent                                       JSONErrorCode = 10070  // Unknown Guild Scheduled Event
	JSONErrorUnknownGuildScheduledEventUser                                   JSONErrorCode = 10071  // Unknown Guild Scheduled Event User
	JSONErrorBotsCannotUseThisEndpoint                                        JSONErrorCode = 20001  // Bots cannot use this endpoint
	JSONErrorOnlyBotsCanUseThisEndpoint                                       JSONErrorCode = 20002  // Only bots can use this endpoint
	JSONErrorExplicitContentCannotBeSentToTheDesiredRecipient                 JSONErrorCode = 20009  // Explicit content cannot be sent to the desired recipient(s)
	JSONErrorYouAreNotAuthorizedToPerformThisActionOnThisApplication          JSONErrorCode = 20012  // You are not authorized to perform this action on this application
	JSONErrorThisActionCannotBePerformedDueToSlowmodeRateLimit                JSONErrorCode = 20016  // This action cannot be performed due to slowmode rate limit
	JSONErrorOnlyTheOwnerOfThisAccountCanPerformThisAction                    JSONErrorCode = 20018  // Only the owner of this account can perform this action
	JSONErrorThisMessageCannotBeEditedDueToAnnouncementRateLimits             JSONErrorCode = 20022  // This message cannot be edited due to announcement rate limits
	JSONErrorTheChannelYouAreWritingHasHitTheWriteRateLimit                   JSONErrorCode = 20028  // The channel you are writing has hit the write rate limit
	JSONErrorTheWriteActionYouArePerformingOnTheServerHasHitTheWriteRateLimit JSONErrorCode = 20029  // The write action you are performing on the server has hit the write rate limit
	JSONErrorYourStageTopic                                                   JSONErrorCode = 20031  // Your Stage topic, server name, server description, or channel names contain words that are not allowed
	JSONErrorGuildPremiumSubscriptionLevelTooLow                              JSONErrorCode = 20035  // Guild premium subscription level too low
	JSONErrorMaximumNumberOfGuildsReached                                     JSONErrorCode = 30001  // Maximum number of guilds reached (100)
	JSONErrorMaximumNumberOfFriendsReached                                    JSONErrorCode = 30002  // Maximum number of friends reached (1000)
	JSONErrorMaximumNumberOfPinsReachedForTheChannel                          JSONErrorCode = 30003  // Maximum number of pins reached for the channel (50)
	JSONErrorMaximumNumberOfRecipientsReached                                 JSONErrorCode = 30004  // Maximum number of recipients reached (10)
	JSONErrorMaximumNumberOfGuildRolesReached                                 JSONErrorCode = 30005  // Maximum number of guild roles reached (250)
	JSONErrorMaximumNumberOfWebhooksReached                                   JSONErrorCode = 30007  // Maximum number of webhooks reached (10)
	JSONErrorMaximumNumberOfEmojisReached                                     JSONErrorCode = 30008  // Maximum number of emojis reached
	JSONErrorMaximumNumberOfReactionsReached                                  JSONErrorCode = 30010  // Maximum number of reactions reached (20)
	JSONErrorMaximumNumberOfGuildChannelsReached                              JSONErrorCode = 30013  // Maximum number of guild channels reached (500)
	JSONErrorMaximumNumberOfAttachmentsInAMessageReached                      JSONErrorCode = 30015  // Maximum number of attachments in a message reached (10)
	JSONErrorMaximumNumberOfInvitesReached                                    JSONErrorCode = 30016  // Maximum number of invites reached (1000)
	JSONErrorMaximumNumberOfAnimatedEmojisReached                             JSONErrorCode = 30018  // Maximum number of animated emojis reached
	JSONErrorMaximumNumberOfServerMembersReached                              JSONErrorCode = 30019  // Maximum number of server members reached
	JSONErrorMaximumNumberOfServerCategoriesHasBeenReached                    JSONErrorCode = 30030  // Maximum number of server categories has been reached (5)
	JSONErrorGuildAlreadyHasATemplate                                         JSONErrorCode = 30031  // Guild already has a template
	JSONErrorMaxNumberOfThreadParticipantsHasBeenReached                      JSONErrorCode = 30033  // Max number of thread participants has been reached (1000)
	JSONErrorMaximumNumberOfBansForNon                                        JSONErrorCode = 30035  // Maximum number of bans for non-guild members have been exceeded
	JSONErrorMaximumNumberOfBansFetchesHasBeenReached                         JSONErrorCode = 30037  // Maximum number of bans fetches has been reached
	JSONErrorMaximumNumberOfUncompletedGuildScheduledEventsReached            JSONErrorCode = 30038  // Maximum number of uncompleted guild scheduled events reached (100)
	JSONErrorMaximumNumberOfStickersReached                                   JSONErrorCode = 30039  // Maximum number of stickers reached
	JSONErrorMaximumNumberOfPruneRequestsHasBeenReached                       JSONErrorCode = 30040  // Maximum number of prune requests has been reached. Try again later
	JSONErrorMaximumNumberOfGuildWidgetSettingsUpdatesHasBeenReached          JSONErrorCode = 30042  // Maximum number of guild widget settings updates has been reached. Try again later
	JSONErrorMaximumNumberOfEditsToMessagesOlderThan1HourReached              JSONErrorCode = 30046  // Maximum number of edits to messages older than 1 hour reached. Try again later
	JSONErrorUnauthorized                                                     JSONErrorCode = 40001  // Unauthorized. Provide a valid token and try again
	JSONErrorYouNeedToVerifyYourAccountInOrderToPerformThisAction             JSONErrorCode = 40002  // You need to verify your account in order to perform this action
	JSONErrorYouAreOpeningDirectMessagesTooFast                               JSONErrorCode = 40003  // You are opening direct messages too fast
	JSONErrorSendMessagesHasBeenTemporarilyDisabled                           JSONErrorCode = 40004  // Send messages has been temporarily disabled
	JSONErrorRequestEntityTooLarge                                            JSONErrorCode = 40005  // Request entity too large. Try sending something smaller in size
	JSONErrorThisFeatureHasBeenTemporarilyDisabledServer                      JSONErrorCode = 40006  // This feature has been temporarily disabled server-side
	JSONErrorTheUserIsBannedFromThisGuild                                     JSONErrorCode = 40007  // The user is banned from this guild
	JSONErrorTargetUserIsNotConnectedToVoice                                  JSONErrorCode = 40032  // Target user is not connected to voice
	JSONErrorThisMessageHasAlreadyBeenCrossposted                             JSONErrorCode = 40033  // This message has already been crossposted
	JSONErrorAnApplicationCommandWithThatNameAlreadyExists                    JSONErrorCode = 40041  // An application command with that name already exists
	JSONErrorMissingAccess                                                    JSONErrorCode = 50001  // Missing access
	JSONErrorInvalidAccountType                                               JSONErrorCode = 50002  // Invalid account type
	JSONErrorCannotExecuteActionOnADMChannel                                  JSONErrorCode = 50003  // Cannot execute action on a DM channel
	JSONErrorGuildWidgetDisabled                                              JSONErrorCode = 50004  // Guild widget disabled
	JSONErrorCannotEditAMessageAuthoredByAnotherUser                          JSONErrorCode = 50005  // Cannot edit a message authored by another user
	JSONErrorCannotSendAnEmptyMessage                                         JSONErrorCode = 50006  // Cannot send an empty message
	JSONErrorCannotSendMessagesToThisUser                                     JSONErrorCode = 50007  // Cannot send messages to this user
	JSONErrorCannotSendMessagesInAVoiceChannel                                JSONErrorCode = 50008  // Cannot send messages in a voice channel
	JSONErrorChannelVerificationLevelIsTooHighForYouToGainAccess              JSONErrorCode = 50009  // Channel verification level is too high for you to gain access
	JSONErrorOAuth2ApplicationDoesNotHaveABot                                 JSONErrorCode = 50010  // OAuth2 application does not have a bot
	JSONErrorOAuth2ApplicationLimitReached                                    JSONErrorCode = 50011  // OAuth2 application limit reached
	JSONErrorInvalidOAuth2State                                               JSONErrorCode = 50012  // Invalid OAuth2 state
	JSONErrorYouLackPermissionsToPerformThatAction                            JSONErrorCode = 50013  // You lack permissions to perform that action
	JSONErrorInvalidAuthenticationTokenProvided                               JSONErrorCode = 50014  // Invalid authentication token provided
	JSONErrorNoteWasTooLong                                                   JSONErrorCode = 50015  // Note was too long
	JSONErrorProvidedTooFewOrTooManyMessagesToDelete                          JSONErrorCode = 50016  // Provided too few or too many messages to delete. Must provide at least 2 and fewer than 100 messages to delete
	JSONErrorAMessageCanOnlyBePinnedToTheChannelItWasSentIn                   JSONErrorCode = 50019  // A message can only be pinned to the channel it was sent in
	JSONErrorInviteCodeWasEitherInvalidOrTaken                                JSONErrorCode = 50020  // Invite code was either invalid or taken
	JSONErrorCannotExecuteActionOnASystemMessage                              JSONErrorCode = 50021  // Cannot execute action on a system message
	JSONErrorCannotExecuteActionOnThisChannelType                             JSONErrorCode = 50024  // Cannot execute action on this channel type
	JSONErrorInvalidOAuth2AccessTokenProvided                                 JSONErrorCode = 50025  // Invalid OAuth2 access token provided
	JSONErrorMissingRequiredOAuth2Scope                                       JSONErrorCode = 50026  // Missing required OAuth2 scope
	JSONErrorInvalidWebhookTokenProvided                                      JSONErrorCode = 50027  // Invalid webhook token provided
	JSONErrorInvalidRole                                                      JSONErrorCode = 50028  // Invalid role
	JSONErrorInvalidRecipient                                                 JSONErrorCode = 50033  // Invalid Recipient(s)
	JSONErrorAMessageProvidedWasTooOldToBulkDelete                            JSONErrorCode = 50034  // A message provided was too old to bulk delete
	JSONErrorInvalidFormBody                                                  JSONErrorCode = 50035  // Invalid form body (returned for both
	JSONErrorAnInviteWasAcceptedToAGuildTheApplication                        JSONErrorCode = 50036  // An invite was accepted to a guild the application's bot is not in
	JSONErrorInvalidAPIVersionProvided                                        JSONErrorCode = 50041  // Invalid API version provided
	JSONErrorFileUploadedExceedsTheMaximumSize                                JSONErrorCode = 50045  // File uploaded exceeds the maximum size
	JSONErrorInvalidFileUploaded                                              JSONErrorCode = 50046  // Invalid file uploaded
	JSONErrorCannotSelf                                                       JSONErrorCode = 50054  // Cannot self-redeem this gift
	JSONErrorInvalidGuild                                                     JSONErrorCode = 50055  // Invalid Guild
	JSONErrorInvalidMessageType                                               JSONErrorCode = 50068  // Invalid message type
	JSONErrorPaymentSourceRequiredToRedeemGift                                JSONErrorCode = 50070  // Payment source required to redeem gift
	JSONErrorCannotDeleteAChannelRequiredForCommunityGuilds                   JSONErrorCode = 50074  // Cannot delete a channel required for Community guilds
	JSONErrorInvalidStickerSent                                               JSONErrorCode = 50081  // Invalid sticker sent
	JSONErrorTriedToPerformAnOperationOnAnArchivedThread                      JSONErrorCode = 50083  // Tried to perform an operation on an archived thread, such as editing a message or adding a user to the thread
	JSONErrorInvalidThreadNotificationSettings                                JSONErrorCode = 50084  // Invalid thread notification settings
	JSONErrorValueIsEarlierThanTheThreadCreationDate                          JSONErrorCode = 50085  //  value is earlier than the thread creation date
	JSONErrorCommunityServerChannelsMustBeTextChannels                        JSONErrorCode = 50086  // Community server channels must be text channels
	JSONErrorThisServerIsNotAvailableInYourLocation                           JSONErrorCode = 50095  // This server is not available in your location
	JSONErrorThisServerNeedsMonetizationEnabledInOrderToPerformThisAction     JSONErrorCode = 50097  // This server needs monetization enabled in order to perform this action
	JSONErrorThisServerNeedsMoreBoostsToPerformThisAction                     JSONErrorCode = 50101  // This server needs more boosts to perform this action
	JSONErrorTheRequestBodyContainsInvalidJSON                                JSONErrorCode = 50109  // The request body contains invalid JSON.
	JSONErrorTwoFactorIsRequiredForThisOperation                              JSONErrorCode = 60003  // Two factor is required for this operation
	JSONErrorNoUsersWithDiscordTagExist                                       JSONErrorCode = 80004  // No users with DiscordTag exist
	JSONErrorReactionWasBlocked                                               JSONErrorCode = 90001  // Reaction was blocked
	JSONErrorAPIResourceIsCurrentlyOverloaded                                 JSONErrorCode = 130000 // API resource is currently overloaded. Try again a little later
	JSONErrorTheStageIsAlreadyOpen                                            JSONErrorCode = 150006 // The Stage is already open
	JSONErrorCannotReplyWithoutPermissionToReadMessageHistory                 JSONErrorCode = 160002 // Cannot reply without permission to read message history
	JSONErrorAThreadHasAlreadyBeenCreatedForThisMessage                       JSONErrorCode = 160004 // A thread has already been created for this message
	JSONErrorThreadIsLocked                                                   JSONErrorCode = 160005 // Thread is locked
	JSONErrorMaximumNumberOfActiveThreadsReached                              JSONErrorCode = 160006 // Maximum number of active threads reached
	JSONErrorMaximumNumberOfActiveAnnouncementThreadsReached                  JSONErrorCode = 160007 // Maximum number of active announcement threads reached
	JSONErrorInvalidJSONForUploadedLottieFile                                 JSONErrorCode = 170001 // Invalid JSON for uploaded Lottie file
	JSONErrorUploadedLottiesCannotContainRasterizedImagesSuchAsPNGOrJPEG      JSONErrorCode = 170002 // Uploaded Lotties cannot contain rasterized images such as PNG or JPEG
	JSONErrorStickerMaximumFramerateExceeded                                  JSONErrorCode = 170003 // Sticker maximum framerate exceeded
	JSONErrorStickerFrameCountExceedsMaximumOf1000Frames                      JSONErrorCode = 170004 // Sticker frame count exceeds maximum of 1000 frames
	JSONErrorLottieAnimationMaximumDimensionsExceeded                         JSONErrorCode = 170005 // Lottie animation maximum dimensions exceeded
	JSONErrorStickerFrameRateIsEitherTooSmallOrTooLarge                       JSONErrorCode = 170006 // Sticker frame rate is either too small or too large
	JSONErrorStickerAnimationDurationExceedsMaximumOf5Seconds                 JSONErrorCode = 170007 // Sticker animation duration exceeds maximum of 5 seconds
	JSONErrorCannotUpdateAFinishedEvent                                       JSONErrorCode = 180000 // Cannot update a finished event
	JSONErrorFailedToCreateStageNeededForStageEvent                           JSONErrorCode = 180002 // Failed to create stage needed for stage event
)

func (JSONErrorCode) String

func (i JSONErrorCode) String() string

type MFALevel

type MFALevel uint
const (
	MFALevelNone MFALevel = iota
	MFALevelElevated
)

func (MFALevel) String

func (i MFALevel) String() string

type MembershipFieldType

type MembershipFieldType string
const (
	MembershipFieldTypeTerms MembershipFieldType = "TERMS"
)

type MembershipScreening

type MembershipScreening struct {
	Version     Time                        `json:"version"`
	FormFields  []*MembershipScreeningField `json:"form_fields"`
	Description string                      `json:"description,omitempty"`
}

type MembershipScreeningField

type MembershipScreeningField struct {
	FieldType MembershipFieldType `json:"field_type"`
	Label     string              `json:"label"`
	Values    []string            `json:"values,omitempty"`
	Required  bool                `json:"required"`
}

type Mentionable

type Mentionable interface {
	Mention() string
}

type Message

type Message struct {
	ID                Snowflake           `json:"id"`
	ChannelID         Snowflake           `json:"channel_id"`
	GuildID           Snowflake           `json:"guild_id,omitempty"`
	Author            *User               `json:"author"`
	Member            *GuildMember        `json:"member,omitempty"`
	Content           string              `json:"content"`
	Timestamp         Time                `json:"timestamp"`
	EditedTimestamp   Time                `json:"edited_timestamp"`
	TTS               bool                `json:"tts"`
	MentionEveryone   bool                `json:"mention_everyone"`
	Mentions          []*User             `json:"mentions,omitempty"`
	MentionRoles      []Snowflake         `json:"mention_roles,omitempty"`
	MentionChannels   []*ChannelMention   `json:"mention_channels,omitempty"`
	Attachments       []*Attachment       `json:"attachments,omitempty"`
	Embeds            []*Embed            `json:"embeds"`
	Reactions         []*Reaction         `json:"reactions,omitempty"`
	Nonce             interface{}         `json:"nonce,omitempty"`
	Pinned            bool                `json:"pinned"`
	WebhookID         Snowflake           `json:"webhook_id,omitempty"`
	Type              MessageType         `json:"type"`
	Activity          *MessageActivity    `json:"activity,omitempty"`
	Application       *MessageApplication `json:"application,omitempty"`
	ApplicationID     Snowflake           `json:"application_id"`
	MessageReference  *MessageReference   `json:"message_reference,omitempty"`
	Flags             MessageFlag         `json:"flags,omitempty"`
	ReferencedMessage *Message            `json:"referenced_message,omitempty"`
	Interaction       *MessageInteraction `json:"interaction,omitempty"`
	Thread            *Channel            `json:"thread,omitempty"`
	Components        []*Component        `json:"components,omitempty"`
	StickerItems      []*StickerItem      `json:"sticker_items"`
	Stickers          []*Sticker          `json:"stickers,omitempty"`
}

func (*Message) URL added in v0.0.5

func (m *Message) URL() string

type MessageActivity

type MessageActivity struct {
	Type    MessageActivityType `json:"type"`
	PartyID string              `json:"party_id,omitempty"`
}

type MessageActivityType

type MessageActivityType uint
const (
	MessageActivityTypeJoin MessageActivityType = iota + 1
	MessageActivityTypeSpectate
	MessageActivityTypeListen

	MessageActivityTypeJoinRequest
)

func (MessageActivityType) String

func (i MessageActivityType) String() string

type MessageApplication

type MessageApplication struct {
	ID          Snowflake `json:"id"`
	CoverImage  string    `json:"cover_image,omitempty"`
	Description string    `json:"description"`
	Icon        string    `json:"icon,omitempty"`
	Name        string    `json:"name"`
}

type MessageComponentData

type MessageComponentData struct {
	CustomID      string        `json:"custom_id"`
	ComponentType ComponentType `json:"component_type"`
	Resolved      ResolvedData  `json:"resolved"`
	Values        []string      `json:"values,omitempty"`
}

type MessageCreate

type MessageCreate struct {
	*Message
}

type MessageDelete

type MessageDelete struct {
	ID        Snowflake `json:"id"`
	ChannelID Snowflake `json:"channel_id"`
	GuildID   Snowflake `json:"guild_id"`
}

type MessageDeleteBulk

type MessageDeleteBulk struct {
	IDs       []Snowflake `json:"ids"`
	ChannelID Snowflake   `json:"channel_id"`
	GuildID   Snowflake   `json:"guild_id"`
}

type MessageFlag

type MessageFlag uint
const (
	MsgFlagCrossposted MessageFlag = 1 << iota
	MsgFlagIsCrosspost
	MsgFlagSupressEmbeds
	MsgFlagSourceMessageDeleted
	MsgFlagUrgent

	MsgFlagEphemeral
	MsgFlagLoading
)

func (MessageFlag) String

func (i MessageFlag) String() string

type MessageInteraction

type MessageInteraction struct {
	ID   Snowflake       `json:"id"`
	Type InteractionType `json:"type"`
	Name string          `json:"name"`
	User *User           `json:"user"`
}

type MessageNotificationsLevel

type MessageNotificationsLevel uint
const (
	MessageNotificationsLevelAll MessageNotificationsLevel = iota
	MessageNotificationsLevelOnlyMentions
)

func (MessageNotificationsLevel) String

func (i MessageNotificationsLevel) String() string

type MessageReactionAdd

type MessageReactionAdd struct {
	UserID    Snowflake    `json:"user_id"`
	ChannelID Snowflake    `json:"channel_id"`
	MessageID Snowflake    `json:"message_id"`
	GuildID   Snowflake    `json:"guild_id"`
	Member    *GuildMember `json:"member"`
	Emoji     *Emoji       `json:"emoji"`
}

type MessageReactionRemove

type MessageReactionRemove struct {
	UserID    Snowflake `json:"user_id"`
	ChannelID Snowflake `json:"channel_id"`
	MessageID Snowflake `json:"message_id"`
	GuildID   Snowflake `json:"guild_id"`
	Emoji     *Emoji    `json:"emoji"`
}

type MessageReactionRemoveAll

type MessageReactionRemoveAll struct {
	ChannelID Snowflake `json:"channel_id"`
	MessageID Snowflake `json:"message_id"`
	GuildID   Snowflake `json:"guild_id"`
}

type MessageReactionRemoveEmoji

type MessageReactionRemoveEmoji struct {
	ChannelID Snowflake `json:"channel_id"`
	MessageID Snowflake `json:"message_id"`
	GuildID   Snowflake `json:"guild_id"`
	Emoji     *Emoji    `json:"emoji"`
}

type MessageReference

type MessageReference struct {
	MessageID       Snowflake `json:"message_id,omitempty"`
	ChannelID       Snowflake `json:"channel_id,omitempty"`
	GuildID         Snowflake `json:"guild_id,omitempty"`
	FailIfNotExists *bool     `json:"fail_if_not_exists,omitempty"`
}

type MessageStickerFormat

type MessageStickerFormat uint
const (
	PNGStickerFormat MessageStickerFormat = iota + 1
	APNGStickerFormat
	LottieStickerFormat
)

func (MessageStickerFormat) String

func (i MessageStickerFormat) String() string

type MessageType

type MessageType uint
const (
	MessageTypeDefault MessageType = iota
	MessageTypeRecipientAdd
	MessageTypeRecipientRemove
	MessageTypeCall
	MessageTypeChannelNameChange
	MessageTypeChannelIconChange
	MessageTypeChannelPinnedMessage
	MessageTypeGuildMemberJoin
	MessageTypeUserPremiumGuildSubscription
	MessageTypeUserPremiumGuildSubscriptionTier1
	MessageTypeUserPremiumGuildSubscriptionTier2
	MessageTypeUserPremiumGuildSubscriptionTier3
	MessageTypeChannelFollowAdd

	MessageTypeGuildDiscoveryDisqualified
	MessageTypeGuildDiscoveryRequalified
	MessageTypeGuildDiscoveryGracePeriodInitialWarning
	MessageTypeGuildDiscoveryGracePeriodFinalWarning

	MessageTypeReply
	MessageTypeApplicationCommand
)

func (MessageType) String

func (i MessageType) String() string

type MessageUpdate

type MessageUpdate struct {
	*Message
}

type ModalSubmitData

type ModalSubmitData struct {
	CustomID   string                          `json:"custom_id"`
	Components []*InteractionResponseComponent `json:"components"`
}

type OpCode

type OpCode int
const (
	OpDispatch OpCode = iota
	OpHeartbeat
	OpIdentify
	OpPresenceUpdate
	OpVoiceStateUpdate

	OpResume
	OpReconnect
	OpRequestGuildMembers
	OpInvalidSession
	OpHello
	OpHeartbeatACK
)

type Payload

type Payload struct {
	Op        OpCode          `json:"op"`
	Data      json.RawMessage `json:"d"`
	Sequence  uint64          `json:"s,omitempty"`
	EventName string          `json:"t,omitempty"`
}

type PermissionOverwrite

type PermissionOverwrite struct {
	ID    Snowflake `json:"id"`
	Type  uint      `json:"type"`
	Allow string    `json:"allow"`
	Deny  string    `json:"deny"`
}

type PremiumTierLevel

type PremiumTierLevel uint
const (
	PremiumTierNone PremiumTierLevel = iota
	PremiumTier1
	PremiumTier2
	PremiumTier3
)

func (PremiumTierLevel) String

func (i PremiumTierLevel) String() string

type PremiumType

type PremiumType uint
const (
	PremiumTypeNone PremiumType = iota
	NitroClassic
	Nitro
	NitroBasic
)

func (PremiumType) String

func (i PremiumType) String() string

type PresenceUpdate

type PresenceUpdate struct {
	User         *User         `json:"user"`
	GuildID      Snowflake     `json:"guild_id"`
	Status       string        `json:"status"`
	Activities   []*Activity   `json:"activities"`
	ClientStatus *ClientStatus `json:"client_status"`
}

type PrivacyLevel

type PrivacyLevel int
const (
	PrivacyLevelPublic PrivacyLevel = iota + 1
	PrivacyLevelGuildOnly
)

func (PrivacyLevel) String

func (i PrivacyLevel) String() string

type PromptType added in v0.0.5

type PromptType uint
const (
	PromptTypeMultipleChoice PromptType = iota
	PromptTypeDropdown
)

type Properties

type Properties struct {
	OS      string `json:"$os"`
	Browser string `json:"$browser"`
	Device  string `json:"$device"`
}

type Ratelimit

type Ratelimit struct {
	Message    string  `json:"message"`
	RetryAfter float64 `json:"retry_after"`
	Global     bool    `json:"global"`
}

type Reaction

type Reaction struct {
	Count int   `json:"count"`
	Me    bool  `json:"me"`
	Emoji Emoji `json:"emoji"`
}

type Ready

type Ready struct {
	Version          int          `json:"v"`
	User             *User        `json:"user"`
	Guilds           []*Guild     `json:"guilds"`
	SessionID        string       `json:"session_id"`
	ResumeGatewayURL string       `json:"resume_gateway_url"`
	Shard            [2]int       `json:"shard"`
	Application      *Application `json:"application"`
}

type ResolvedData added in v0.0.3

type ResolvedData struct {
	Users       map[Snowflake]User        `json:"users"`
	Members     map[Snowflake]GuildMember `json:"members"`
	Roles       map[Snowflake]Role        `json:"roles"`
	Channels    map[Snowflake]Channel     `json:"channels"`
	Messages    map[Snowflake]Message     `json:"messages"`
	Attachments map[Snowflake]Attachment  `json:"attachments"`
}

type ResponseType

type ResponseType int
const (
	ResponsePong ResponseType = iota + 1

	ResponseChannelMessageWithSource
	ResponseDeferredChannelMessageWithSource
	ResponseDeferredMessageUpdate // buttons only
	ResponseUpdateMessage
	ResponseCommandAutocompleteResult
	ResponseModal
)

Response types

func (ResponseType) String

func (i ResponseType) String() string

type Resume

type Resume struct {
	Token     string `json:"token"`
	SessionID string `json:"session_id"`
	Sequence  uint64 `json:"seq"`
}

type Role

type Role struct {
	ID           Snowflake                 `json:"id"`
	Name         string                    `json:"name"`
	Color        int                       `json:"color"`
	Hoist        bool                      `json:"hoist"`
	Icon         string                    `json:"icon"`
	UnicodeEmoji string                    `json:"unicode_emoji"`
	Position     int                       `json:"position"`
	Permissions  permissions.PermissionBit `json:"permissions"`
	Managed      bool                      `json:"managed"`
	Mentionable  bool                      `json:"mentionable"`
	Tags         RoleTags                  `json:"tags"`
}

func (*Role) Mention

func (r *Role) Mention() string

type RoleTags

type RoleTags struct {
	BotID             Snowflake `json:"bot_id"`
	IntegrationID     Snowflake `json:"integration_id"`
	PremiumSubscriber bool
}

func (*RoleTags) UnmarshalJSON

func (r *RoleTags) UnmarshalJSON(in []byte) error

type SelectOptions

type SelectOptions struct {
	Label       string `json:"label"`
	Value       string `json:"value"`
	Description string `json:"description,omitempty"`
	Emoji       *Emoji `json:"emoji,omitempty"`
	Default     bool   `json:"default"`
}

type Service

type Service string
const (
	ServiceBattleNet       Service = "battlenet"
	ServiceEbay            Service = "ebay"
	ServiceEpicGames       Service = "epicgames"
	ServiceFacebook        Service = "facebook"
	ServiceGithub          Service = "github"
	ServiceLeagueOfLegends Service = "leagueoflegends"
	ServicePaypal          Service = "paypal"
	ServicePlaystation     Service = "playstation"
	ServiceReddit          Service = "reddit"
	ServiceRiotGames       Service = "riotgames"
	ServiceSpotify         Service = "spotify"
	ServiceSkype           Service = "skype"
	ServiceSteam           Service = "steam"
	ServiceTwitch          Service = "twitch"
	ServiceTwitter         Service = "twitter"
	ServiceXbox            Service = "xbox"
	ServiceYouTube         Service = "youtube"
)

type Snowflake

type Snowflake = snowflake.Snowflake

type StageInstance

type StageInstance struct {
	ID                    Snowflake    `json:"id"`
	GuildID               Snowflake    `json:"guild_id"`
	ChannelID             Snowflake    `json:"channel_id"`
	Topic                 string       `json:"topic"`
	PrivacyLevel          PrivacyLevel `json:"privacy_level"`
	DiscoverableDisabled  bool         `json:"discoverable_disabled"`
	GuildScheduledEventID *Snowflake   `json:"guild_scheduled_event_id,omitempty"`
}

type StageInstanceCreate

type StageInstanceCreate struct {
	*StageInstance
}

type StageInstanceDelete

type StageInstanceDelete struct {
	*StageInstance
}

type StageInstanceUpdate

type StageInstanceUpdate struct {
	*StageInstance
}

type StatusType

type StatusType string
const (
	StatusOnline       StatusType = "online"
	StatusDoNotDisturb StatusType = "dnd"
	StatusAFK          StatusType = "idle"
	StatusInvisible    StatusType = "invisible"
	StatusOffline      StatusType = "offline"
)

type Sticker

type Sticker struct {
	ID          Snowflake         `json:"id"`
	PackID      Snowflake         `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,omitempty"`
	GuildID     Snowflake         `json:"guild_id,omitempty"`
	User        *User             `json:"user,omitempty"`
	SortValue   *int              `json:"sort_value,omitempty"`
}

type StickerFormatType

type StickerFormatType int
const (
	StickerFormatTypePNG StickerFormatType = iota + 1
	StickerFormatTypeAPNG
	StickerFormatTypeLOTTIE
)

func (StickerFormatType) String

func (i StickerFormatType) String() string

type StickerItem

type StickerItem struct {
	ID         Snowflake         `json:"id"`
	Name       string            `json:"name"`
	FormatType StickerFormatType `json:"format_type"`
}

type StickerPack

type StickerPack struct {
	ID             Snowflake  `json:"id"`
	Stickers       []*Sticker `json:"stickers"`
	Name           string     `json:"name"`
	SKU            Snowflake  `json:"sku_id"`
	CoverStickerID Snowflake  `json:"cover_sticker_id"`
	Description    string     `json:"description"`
	BannerAssetID  Snowflake  `json:"banner_asset_id"`
}

type StickerTags

type StickerTags []string

func (StickerTags) MarshalJSON

func (t StickerTags) MarshalJSON() ([]byte, error)

func (*StickerTags) UnmarshalJSON

func (t *StickerTags) UnmarshalJSON(bytes []byte) error

type StickerType

type StickerType int
const (
	StickerTypeStandard StickerType = iota + 1
	StickerTypeGuild
)

func (StickerType) String

func (i StickerType) String() string

type SystemChannelFlags

type SystemChannelFlags uint
const (
	FlagSupressJoinNotifications SystemChannelFlags = 1 << iota
	FlagSupressPremiumSubscriptions
	FlagSupressGuildReminderNotifications
	FlagSupressJoinNotificationReplies
)

func (SystemChannelFlags) String

func (i SystemChannelFlags) String() string

type Team

type Team struct {
	ID          Snowflake     `json:"id"`
	Icon        string        `json:"icon"`
	Members     []*TeamMember `json:"members"`
	Name        string        `json:"name"`
	OwnerUserID Snowflake     `json:"owner_user_id"`
}

type TeamMember

type TeamMember struct {
	MembershipState TeamMembershipState `json:"membership_state"`
	Permissions     []string            `json:"permissions"`
	TeamID          Snowflake           `json:"team_id"`
	User            *User               `json:"user"`
}

type TeamMembershipState

type TeamMembershipState int
const (
	TeamMembershipStateInvited TeamMembershipState = iota + 1
	TeamMembershipStateAccepted
)

func (TeamMembershipState) String

func (i TeamMembershipState) String() string

type Template

type Template struct {
	Code                  string    `json:"code"`
	Name                  string    `json:"name"`
	Description           string    `json:"description"`
	UsageCount            int       `json:"usage_count"`
	CreatorID             Snowflake `json:"creator_id"`
	Creator               *User     `json:"creator"`
	CreatedAt             Time      `json:"created_at"`
	UpdatedAt             Time      `json:"updated_at"`
	SourceGuildID         Snowflake `json:"source_guild_id"`
	SerializedSourceGuild Snowflake `json:"serialized_source_guild"`
	IsDirty               bool      `json:"is_dirty"`
}

type TextStyle

type TextStyle int
const (
	TextStyleShort TextStyle = iota + 1
	TextStyleParagraph
)

func (TextStyle) String

func (i TextStyle) String() string

type ThreadCreate

type ThreadCreate struct {
	*Channel
	*ThreadMember
}

type ThreadDelete

type ThreadDelete struct {
	*Channel
}

type ThreadListSync

type ThreadListSync struct {
	GuildID    Snowflake       `json:"guild_id"`
	ChannelIDs []Snowflake     `json:"channel_ids"`
	Threads    []*Channel      `json:"threads"`
	Members    []*ThreadMember `json:"members"`
}

type ThreadMember

type ThreadMember struct {
	ID       Snowflake `json:"id"`
	UserID   Snowflake `json:"user_id"`
	JoinedAt Time      `json:"join_timestamp"`
	Flags    uint      `json:"flags"`
}

type ThreadMemberUpdate

type ThreadMemberUpdate struct {
	*ThreadMember
}

type ThreadMembersUpdate

type ThreadMembersUpdate struct {
	ID               Snowflake       `json:"id"`
	GuildID          Snowflake       `json:"guild_id"`
	MemberCount      int             `json:"member_count"`
	AddedMembers     []*ThreadMember `json:"added_members"`
	RemovedMemberIDs []Snowflake     `json:"removed_member_ids"`
}

type ThreadMetadata

type ThreadMetadata struct {
	Archived            bool `json:"archived"`
	AutoArchiveDuration int  `json:"auto_archive_duration"`
	ArchivedTimestamp   Time `json:"archived_timestamp"`
	Locked              bool `json:"locked"`
	Invitable           bool `json:"invitable"`
}

type ThreadUpdate

type ThreadUpdate struct {
	*Channel
}

type Time

type Time struct {
	time.Time
}

func NewTime

func NewTime(t time.Time) Time

func (Time) Format

func (t Time) Format(style TimestampStyle) string

func (Time) LongDate

func (t Time) LongDate() string

func (Time) LongDateTime

func (t Time) LongDateTime() string

func (Time) LongTime

func (t Time) LongTime() string

func (Time) MarshalJSON

func (t Time) MarshalJSON() ([]byte, error)

func (Time) Mention

func (t Time) Mention() string

func (Time) Relative

func (t Time) Relative() string

func (Time) ShortDate

func (t Time) ShortDate() string

func (Time) ShortDateTime

func (t Time) ShortDateTime() string

func (Time) ShortTime

func (t Time) ShortTime() string

func (Time) String

func (t Time) String() string

func (*Time) UnmarshalJSON

func (t *Time) UnmarshalJSON(b []byte) error

type TimestampStyle

type TimestampStyle string
const (
	StyleShortTime     TimestampStyle = "t"
	StyleLongTime      TimestampStyle = "T"
	StyleShortDate     TimestampStyle = "d"
	StyleLongDate      TimestampStyle = "D"
	StyleShortDateTime TimestampStyle = "f"
	StyleLongDateTime  TimestampStyle = "F"
	StyleRelative      TimestampStyle = "R"
)

type Timestamps

type Timestamps struct {
	Start int `json:"start,omitempty"`
	End   int `json:"end,omitempty"`
}

type TokenType

type TokenType string
const (
	TokenTypeBot    TokenType = "Bot"
	TokenTypeBearer TokenType = "Bearer"
)

type TriggerMetadata

type TriggerMetadata struct {
	KeywordFilter     []string                          `json:"keyword_filter,omitempty"`
	Presets           []AutoModerationKeywordPresetType `json:"presets,omitempty"`
	AllowList         []string                          `json:"allow_list,omitempty"`
	MentionTotalLimit int                               `json:"mention_total_limit"`
}

type TypingStart

type TypingStart struct {
	ChannelID Snowflake    `json:"channel_id"`
	GuildID   Snowflake    `json:"guild_id"`
	UserID    Snowflake    `json:"user_id"`
	Timestamp int          `json:"timestamp"`
	Member    *GuildMember `json:"member"`
}

type UnavailableGuild

type UnavailableGuild struct {
	ID          Snowflake `json:"id"`
	Unavailable bool      `json:"unavailable"`
}

type UpdatePresence

type UpdatePresence struct {
	Since      int64      `json:"since"`
	Activities []Activity `json:"activities"`
	Status     StatusType `json:"status"`
	AFK        bool       `json:"afk"`
}

type User

type User struct {
	ID            Snowflake     `json:"id"`
	Username      string        `json:"username"`
	Discriminator string        `json:"discriminator"`
	Avatar        Asset[Avatar] `json:"avatar,omitempty"`
	Bot           bool          `json:"bot,omitempty"`
	System        bool          `json:"system,omitempty"`
	MFAEnabled    bool          `json:"mfa_enabled,omitempty"`
	Banner        string        `json:"banner,omitempty"`
	AccentColor   int           `json:"accent_color"`
	Locale        string        `json:"locale,omitempty"`
	Verified      bool          `json:"verified,omitempty"`
	Email         string        `json:"email,omitempty"`
	Flags         UserFlags     `json:"flags"`
	PremiumType   PremiumType   `json:"premium_type,omitempty"`
	PublicFlags   UserFlags     `json:"public_flags,omitempty"`
}

func (*User) Mention

func (u *User) Mention() string

type UserFlags

type UserFlags uint
const (
	DiscordEmployee UserFlags = 1 << iota
	PartneredServerOwner
	HypesquadEvents
	BugHunterLevel1

	HouseBravery
	HouseBrilliance
	HouseBalance
	EarlySupporter
	TeamUser

	BugHunterLevel2

	VerifiedBot
	EarlyVerifiedBotDeveloper
	DiscordCertifiedModerator
	BotHTTPInteractions
	ActiveDeveloper
)

func (UserFlags) String

func (i UserFlags) String() string

type UserUpdate

type UserUpdate struct {
	*User
}

type VerificationLevel

type VerificationLevel uint
const (
	VerificationLevelNone VerificationLevel = iota
	VerificationLevelLow
	VerificationLevelMedium
	VerificationLevelHigh
	VerificationLevelVeryHigh
)

func (VerificationLevel) String

func (i VerificationLevel) String() string

type Visibility

type Visibility uint
const (
	VisibilityNone Visibility = iota
	VisibilityEveryone
)

type VoiceRegion

type VoiceRegion struct {
	ID         string `json:"id"`
	Name       string `json:"name"`
	VIP        bool   `json:"vip"`
	Optimal    bool   `json:"optimal"`
	Deprecated bool   `json:"deprecated"`
	Custom     bool   `json:"custom"`
}

type VoiceServerUpdate

type VoiceServerUpdate struct {
	Token    string    `json:"token"`
	GuildID  Snowflake `json:"guild_id"`
	Endpoint string    `json:"endpoint"`
}

type VoiceState

type VoiceState struct {
	GuildID                 Snowflake    `json:"guild_id,omitempty"`
	ChannelID               Snowflake    `json:"channel_id,omitempty"`
	UserID                  Snowflake    `json:"user_id"`
	Member                  *GuildMember `json:"guild_member,omitempty"`
	SessionID               string       `json:"session_id"`
	Deaf                    bool         `json:"deaf"`
	Mute                    bool         `json:"mute"`
	SelfDeaf                bool         `json:"self_deaf"`
	SelfMute                bool         `json:"self_mute"`
	SelfStream              bool         `json:"self_stream,omitempty"`
	SelfVideo               bool         `json:"self_video"`
	Suppress                bool         `json:"suppress"`
	RequestToSpeakTimestamp *Time        `json:"request_to_speak_timestamp,omitempty"`
}

type VoiceStateUpdate

type VoiceStateUpdate struct {
	*VoiceState
}

type Webhook

type Webhook struct {
	ID Snowflake `json:"id"`

	// the type of the webhook
	Type WebhookType `json:"type"`

	// the guild id this webhook is for
	GuildID Snowflake `json:"guild_id,omitempty"`

	// the channel id this webhook is for
	ChannelID Snowflake `json:"channel_id"`

	// the user this webhook was created by (not returned when getting a webhook with its token)
	User *User `json:"user,omitempty"`

	// the default name of the webhook
	Name string `json:"name,omitempty"`

	// the default avatar of the webhook
	Avatar string `json:"avatar,omitempty"`

	// the secure token of the webhook (returned for Incoming Webhooks)
	Token string `json:"token,omitempty"`

	// the bot/OAuth2 application that created this webhook
	ApplicationID Snowflake `json:"application_id,omitempty"`

	// the guild of the channel that this webhook is following (returned for Channel Follower Webhooks)
	SourceGuild *Guild `json:"source_guild,omitempty"`

	// the channel that this webhook is following (returned for Channel Follower Webhooks)
	SourceChannel *Channel `json:"source_channel,omitempty"`

	// the url used for executing the webhook (returned by the webhooks OAuth2 flow)
	URL string `json:"url,omitempty"`
}

https://discord.com/developers/docs/resources/invite#invite-object-invite-structure

type WebhookType

type WebhookType uint

https://discord.com/developers/docs/resources/webhook#webhook-object-webhook-types

const (
	WebhookIncoming WebhookType = iota + 1
	WebhookChannelFollower
	WebhookApplication
)

func (WebhookType) String

func (i WebhookType) String() string

type WebhooksUpdate

type WebhooksUpdate struct {
	ChannelID Snowflake `json:"channel_id"`
	GuildID   Snowflake `json:"guild_id"`
}

type WelcomeChannel

type WelcomeChannel struct {
	ChannelID   Snowflake `json:"channel_id"`
	Description string    `json:"description"`
	EmojiID     Snowflake `json:"emoji_id,omitempty"`
	EmojiName   string    `json:"emoji_name,omitempty"`
}

type WelcomeScreen

type WelcomeScreen struct {
	Description     string            `json:"description,omitempty"`
	WelcomeChannels []*WelcomeChannel `json:"welcome_channels"`
}

type WidgetUser

type WidgetUser struct {
	ID            Snowflake `json:"id"`
	Username      string    `json:"username"`
	Discriminator string    `json:"discriminator"`
	Status        string    `json:"status"`
	AvatarURL     string    `json:"avatar_url"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL