objects

package module
v0.0.15 Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2021 License: MIT Imports: 4 Imported by: 6

Documentation

Index

Constants

View Source
const (
	ApplicationFlag_GATEWAY_PRESENCE = 1 << (iota + 12)
	ApplicationFlag_GATEWAY_PRESENCE_LIMITED
	ApplicationFlag_GATEWAY_GUILD_MEMBERS
	ApplicationFlag_GATEWAY_GUILD_MEMBERS_LIMITED
	ApplicationFlag_VERIFICATION_PENDING_GUILD_LIMIT
	ApplicationFlag_EMBEDDED
)
View Source
const (
	ResponseFlagNormal    = 0
	ResponseFlagEphemeral = 1 << 6
)

Response flags

View Source
const (
	ComponentTypeActionRow = iota + 1
	ComponentTypeButton
	ComponentTypeSelectMenu
)
View Source
const (
	ButtonStylePrimary = iota + 1
	ButtonStyleSecondary
	ButtonStyleSuccess
	ButtonStyleDanger
	ButtonStyleLink
)
View Source
const (
	PrivacyLevel_PUBLIC = iota + 1
	PrivacyLevel_GUILD_ONLY
)
View Source
const (
	DiscordEpoch = 1420070400000
)
View Source
const UserFlagsNone = UserFlags(0)

Variables

This section is empty.

Functions

This section is empty.

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
)

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
)

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 added in v0.0.15

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               int       `json:"flags"`
}

type ApplicationCommand

type ApplicationCommand struct {
	ID                Snowflake                  `json:"id,omitempty"`
	ApplicationID     Snowflake                  `json:"application_id,omitempty"`
	Name              string                     `json:"name"`
	Description       string                     `json:"description,omitempty"`
	Options           []ApplicationCommandOption `json:"options"`
	DefaultPermission bool                       `json:"default_permission"`
	Type              *ApplicationCommandType    `json:"type,omitempty"`
}

type ApplicationCommandInteractionData

type ApplicationCommandInteractionData struct {
	ID       Snowflake                                  `json:"id"`
	Name     string                                     `json:"name"`
	Type     ApplicationCommandType                     `json:"type"`
	Version  Snowflake                                  `json:"version"`
	Options  []*ApplicationCommandInteractionDataOption `json:"options"`
	Resolved ApplicationCommandInteractionDataResolved  `json:"resolved"`
	TargetID Snowflake                                  `json:"target_id"`
}

type ApplicationCommandInteractionDataOption

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

type ApplicationCommandInteractionDataResolved

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

type ApplicationCommandOption

type ApplicationCommandOption struct {
	OptionType   ApplicationCommandOptionType     `json:"type"`
	Name         string                           `json:"name"`
	Description  string                           `json:"description"`
	Default      bool                             `json:"default"`
	Required     bool                             `json:"required"`
	Choices      []ApplicationCommandOptionChoice `json:"choices,omitempty"`
	Options      []ApplicationCommandOption       `json:"options,omitempty"`
	Autocomplete bool                             `json:"autocomplete,omitempty"`
}

type ApplicationCommandOptionChoice

type ApplicationCommandOptionChoice struct {
	Name  string      `json:"name"`
	Value interface{} `json:"value"`
}

type ApplicationCommandOptionType

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

type ApplicationCommandPermissionType

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

type ApplicationCommandPermissions

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

type ApplicationCommandType

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

ApplicationCommand types

type ApplicationComponentInteractionData

type ApplicationComponentInteractionData struct {
	CustomID      string        `json:"custom_id"`
	ComponentType ComponentType `json:"component_type"`
	Values        []string      `json:"values,omitempty"`
}

type Attachment

type Attachment struct {
	ID       Snowflake `json:"id"`
	Filename string    `json:"filename"`
	Size     int       `json:"size"`
	URL      string    `json:"url"`
	ProxyURL string    `json:"proxy_url"`
	Height   int       `json:"height,omitempty"`
	Width    int       `json:"width,omitempty"`
}

type AuditLog

type AuditLog struct {
	Webhooks      []*Webhook       `json:"webhooks"`
	Users         []*User          `json:"users"`
	AuditLogEntry []*AuditLogEntry `json:"audit_log_entry"`
	Integrations  []*Integration
}

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
)
const (
	AuditLogEvtGuildUpdate AuditLogEvent = 1
)

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 Ban

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

type ButtonStyle

type ButtonStyle int

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                *string               `json:"permissions,omitempty"`
}

type ChannelCreate added in v0.0.15

type ChannelCreate struct {
	*Channel
}

type ChannelDelete added in v0.0.15

type ChannelDelete struct {
	*Channel
}

type ChannelMention

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

type ChannelPinsUpdate added in v0.0.15

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
	ChannelTypeGuildNews
	ChannelTypeGuildStore
)

type ChannelUpdate added in v0.0.15

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"`
	Components  []*Component  `json:"components,omitempty"`
	Label       string        `json:"label,omitempty"`
	Style       ButtonStyle   `json:"style,omitempty"`
	Emoji       *Emoji        `json:"emoji,omitempty"`
	CustomID    string        `json:"custom_id,omitempty"`
	URL         string        `json:"url,omitempty"`
	Disabled    bool          `json:"disabled,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"`
	Options   []*SelectOptions `json:"options,omitempty"`
}

type ComponentEmoji

type ComponentEmoji struct {
	Name     string `json:"name"`
	ID       string `json:"id"`
	Animated bool   `json:"animated"`
}

type ComponentType

type ComponentType int

type Connection

type Connection struct {
	ID           string         `json:"id"`
	Name         string         `json:"name"`
	Type         string         `json:"type"`
	Revoked      bool           `json:"revoked,omitempty"`
	Integrations []*Integration `json:"integrations,omitempty"`
	Verified     bool           `json:"verified"`
	FriendSync   bool           `json:"friend_sync"`
	ShowActivity bool           `json:"show_activity"`
	Visibility   Visibility     `json:"visibility"`
}

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

type ExpireBehaviour

type ExpireBehaviour uint
const (
	ExpireBehaviourRemoveRole ExpireBehaviour = iota
	ExpireBehaviourKick
)

type ExplicitContentFilterLevel

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

type FollowedChannel

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

type Guild

type Guild struct {
	ID                          Snowflake                  `json:"id"`
	Name                        string                     `json:"name"`
	Icon                        string                     `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                 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"`
}

type GuildApplicationCommandPermissions

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

type GuildBanAdd added in v0.0.15

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

type GuildBanRemove added in v0.0.15

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

type GuildCreate added in v0.0.15

type GuildCreate struct {
	*Guild
}

type GuildDelete added in v0.0.15

type GuildDelete struct {
	*Guild
}

type GuildEmojisUpdate added in v0.0.15

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

type GuildFeature

type GuildFeature string
const (
	GuildFeatureInviteSplash GuildFeature = "INVITE_SPLASH"
	GuildFeatureVIPRegions   GuildFeature = "VIP_REGIONS"
	GuildFeatureVanityURl    GuildFeature = "VANITY_URL"

	GuildFeatureVerified             GuildFeature = "VERIFIED"
	GuildFeaturePartnered            GuildFeature = "PARTNERED"
	GuildFeatureCommunity            GuildFeature = "COMMUNITY"
	GuildFeatureCommerce             GuildFeature = "COMMERCE"
	GuildFeatureNews                 GuildFeature = "NEWS"
	GuildFeatureDiscoverable         GuildFeature = "DISCOVERABLE"
	GuildFeatureFeaturable           GuildFeature = "FEATURABLE"
	GuildFeatureAnimatedIcon         GuildFeature = "ANIMATED_ICON"
	GuildFeatureBanner               GuildFeature = "BANNER"
	GuildFeatureWelcomeScreenEnabled GuildFeature = "WELCOME_SCREEN_ENABLED"
)

type GuildIntegrationsUpdate added in v0.0.15

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

type GuildMember

type GuildMember struct {
	User         *User       `json:"user,omitempty"`
	Nick         string      `json:"nick,omitempty"`
	Roles        []Snowflake `json:"roles"`
	JoinedAt     Time        `json:"joined_at"`
	PremiumSince Time        `json:"premium_since,omitempty"`
	Deaf         bool        `json:"deaf"`
	Mute         bool        `json:"mute"`
	Pending      bool        `json:"pending,omitempty"`
}

type GuildMemberAdd added in v0.0.15

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

type GuildMemberRemove added in v0.0.15

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

type GuildMemberUpdate added in v0.0.15

type GuildMemberUpdate struct {
	GuildID      Snowflake   `json:"guild_id"`
	Roles        []Snowflake `json:"roles"`
	User         *User       `json:"user"`
	Nick         string      `json:"nick"`
	JoinedAt     Time        `json:"joined_at"`
	PremiumSince Time        `json:"premium_since"`
	Deaf         bool        `json:"deaf"`
	Mute         bool        `json:"mute"`
	Pending      bool        `json:"pending"`
}

type GuildMembersChunk added in v0.0.15

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 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 added in v0.0.15

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

type GuildRoleDelete added in v0.0.15

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

type GuildRoleUpdate added in v0.0.15

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

type GuildStickersUpdate added in v0.0.15

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

type GuildUnavailable

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

type GuildUpdate added in v0.0.15

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

type IntegrationAccount

type IntegrationAccount struct {
	ID   string `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 added in v0.0.15

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

type IntegrationDelete added in v0.0.15

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

type IntegrationUpdate added in v0.0.15

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

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"`
	Message       *Message        `json:"message,omitempty"`
	Version       int             `json:"version,omitempty"`
}

type InteractionApplicationCommandCallbackData

type InteractionApplicationCommandCallbackData struct {
	TTS             bool                              `json:"tts,omitempty"`
	Content         string                            `json:"content"`
	Embeds          []*Embed                          `json:"embeds,omitempty"`
	AllowedMentions *AllowedMentions                  `json:"allowed_mentions,omitempty"`
	Flags           int                               `json:"flags"`
	Components      []*Component                      `json:"components"`
	Choices         []*ApplicationCommandOptionChoice `json:"choices,omitempty"`
}

type InteractionCreate added in v0.0.15

type InteractionCreate struct {
	*Interaction
}

type InteractionResponse

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

type InteractionType

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

Interaction types

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 user for this invite
	TargetUser *User `json:"target_user,omitempty"`

	// the type of user target for this invite
	// https://discord.com/developers/docs/resources/invite#invite-object-example-invite-object
	TargetUserType InviteTargetUser `json:"target_user_type,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"`

	// 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 added in v0.0.15

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 added in v0.0.15

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

type InviteTargetType added in v0.0.15

type InviteTargetType int
const (
	InviteTargetType_STREAM InviteTargetType = iota + 1
	InviteTargetType_EMBEDDED_APPLICATION
)

type MFALevel

type MFALevel uint
const (
	MFALevelNone MFALevel = iota
	MFALevelElevated
)

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 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"`
	Interaction       *MessageInteraction `json:"interaction,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"`
	MessageReference  *MessageReference   `json:"message_reference,omitempty"`
	Flags             MessageFlag         `json:"flags,omitempty"`
	Stickers          []*MessageSticker   `json:"stickers,omitempty"`
	ReferencedMessage *Message            `json:"referenced_message,omitempty"`
	Components        []*Component        `json:"components,omitempty"`
}

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 = 5
)

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 MessageCreate added in v0.0.15

type MessageCreate struct {
	*Message
}

type MessageDelete added in v0.0.15

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

type MessageDeleteBulk added in v0.0.15

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
)

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
)

type MessageReactionAdd added in v0.0.15

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 added in v0.0.15

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 added in v0.0.15

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

type MessageReactionRemoveEmoji added in v0.0.15

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

type MessageSticker

type MessageSticker struct {
	ID           Snowflake            `json:"id"`
	PackID       Snowflake            `json:"pack_id"`
	Name         string               `json:"name"`
	Description  string               `json:"description"`
	Tags         string               `json:"tags,omitempty"`
	Asset        string               `json:"asset"`
	PreviewAsset string               `json:"preview_asset"`
	FormatType   MessageStickerFormat `json:"format_type"`
}

type MessageStickerFormat

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

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
)

type MessageUpdate added in v0.0.15

type MessageUpdate struct {
	*Message
}

type PermissionBit

type PermissionBit uint64
const (
	CREATE_INSTANT_INVITE PermissionBit = 1 << iota
	KICK_MEMBERS
	BAN_MEMBERS
	ADMINISTRATOR
	MANAGE_CHANNELS
	MANAGE_GUILD
	ADD_REACTIONS
	VIEW_AUDIT_LOG
	PRIORITY_SPEAKER
	STREAM
	VIEW_CHANNEL
	SEND_MESSAGES
	SEND_TTS_MESSAGES
	MANAGE_MESSAGES
	EMBED_LINKS
	ATTACH_FILES
	READ_MESSAGE_HISTORY
	MENTION_EVERYONE
	USE_EXTERNAL_EMOJIS
	VIEW_GUILD_INSIGHTS
	CONNECT
	SPEAK
	MUTE_MEMBERS
	DEAFEN_MEMBERS
	MOVE_MEMBERS
	USE_VAD
	CHANGE_NICKNAME
	MANAGE_NICKNAMES
	MANAGE_ROLES
	MANAGE_WEBHOOKS
	MANAGE_EMOJIS
	USE_APPLICATION_COMMANDS
)

func (PermissionBit) Has

func (p PermissionBit) Has(bits PermissionBit) bool

func (PermissionBit) HasOrAdmin

func (p PermissionBit) HasOrAdmin(bits PermissionBit) bool

func (*PermissionBit) MarshalJSON

func (p *PermissionBit) MarshalJSON() ([]byte, error)

func (PermissionBit) String

func (p PermissionBit) String() string

func (*PermissionBit) UnmarshalJSON

func (p *PermissionBit) UnmarshalJSON(bytes []byte) error

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
)

type PremiumType

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

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 added in v0.0.15

type PrivacyLevel int

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 added in v0.0.15

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

type ResponseType

type ResponseType int
const (
	ResponsePong ResponseType = iota + 1

	ResponseChannelMessageWithSource
	ResponseDeferredChannelMessageWithSource
	ResponseDeferredMessageUpdate // buttons only
	ResponseUpdateMessage
	ResponseCommandAutocompleteResult
)

Response types

type Role

type Role struct {
	ID          Snowflake     `json:"id"`
	Name        string        `json:"name"`
	Color       int           `json:"color"`
	Hoist       bool          `json:"hoist"`
	Position    int           `json:"position"`
	Permissions PermissionBit `json:"permissions"`
	Managed     bool          `json:"managed"`
	Mentionable bool          `json:"mentionable"`
}

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 Snowflake

type Snowflake uint64

func (Snowflake) CreatedAt

func (s Snowflake) CreatedAt() time.Time

CreatedAt returns a time.Time representing the time a Snowflake was created

func (Snowflake) MarshalJSON

func (s Snowflake) MarshalJSON() ([]byte, error)

func (*Snowflake) UnmarshalJSON

func (s *Snowflake) UnmarshalJSON(bytes []byte) error

type StageInstance added in v0.0.15

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

type StageInstanceCreate added in v0.0.15

type StageInstanceCreate struct {
	*StageInstance
}

type StageInstanceDelete added in v0.0.15

type StageInstanceDelete struct {
	*StageInstance
}

type StageInstanceUpdate added in v0.0.15

type StageInstanceUpdate struct {
	*StageInstance
}

type SystemChannelFlags

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

type Team added in v0.0.15

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

type TeamMember added in v0.0.15

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

type TeamMembershipState added in v0.0.15

type TeamMembershipState int
const (
	TeamMembershipState_INVITED TeamMembershipState = iota + 1
	TeamMembershipState_ACCEPTED
)

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 ThreadCreate added in v0.0.15

type ThreadCreate struct {
	*Channel
	*ThreadMember
}

type ThreadDelete added in v0.0.15

type ThreadDelete struct {
	*Channel
}

type ThreadListSync added in v0.0.15

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 added in v0.0.15

type ThreadMemberUpdate struct {
	*ThreadMember
}

type ThreadMembersUpdate added in v0.0.15

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 added in v0.0.14

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 added in v0.0.15

type ThreadUpdate struct {
	*Channel
}

type Time

type Time struct {
	time.Time
}

func (*Time) MarshalJSON

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

func (*Time) String

func (t *Time) String() string

func (*Time) UnmarshalJSON

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

type Timestamps

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

type TypingStart added in v0.0.15

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 User

type User struct {
	ID            Snowflake   `json:"id"`
	Username      string      `json:"username"`
	Discriminator string      `json:"discriminator"`
	Avatar        string      `json:"avatar,omitempty"`
	Bot           bool        `json:"bot,omitempty"`
	System        bool        `json:"system,omitempty"`
	MFAEnabled    bool        `json:"mfa_enabled,omitempty"`
	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"`
}

type UserFlags

type UserFlags uint
const (
	DiscordEmployee UserFlags = 1 << iota
	PartneredServerOwner
	HypesquadEvents
	BugHunterLevel1
	HouseBravery
	HouseBrilliance
	HouseBalance
	EarlySupporter
	TeamUser

	System          = 1 << 12
	BugHunterLevel2 = 1 << 14

	VerifiedBot               = 1 << 16
	EarlyVerifiedBotDeveloper = 1 << 17
)

type UserUpdate added in v0.0.15

type UserUpdate struct {
	*User
}

type VerificationLevel

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

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 added in v0.0.15

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

type VoiceStateUpdate added in v0.0.15

type VoiceStateUpdate struct {
	*VoiceState
}

type Webhook

type Webhook struct {

	// the id of the webhook
	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"`
}

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 (
	IncomingWebhook WebhookType = iota + 1
	ChannelFollowWebhook
)

type WebhooksUpdate added in v0.0.15

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

Jump to

Keyboard shortcuts

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