primitives

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2022 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	//DiscordCDNBaseURL is the baseUrl for all CDN endpoints
	DiscordCDNBaseURL = "https://cdn.discordapp.com/"
)
View Source
const (
	DiscordEpoch int64 = 1420070400000
)

Variables

View Source
var (
	//ErrorInvalidUTF8 is when a message does not contain valid utf8
	ErrorInvalidUTF8 = fmt.Errorf("primitives: message contains invalid utf8")
	//ErrorEmbedTooLarge is when the combined sum of characters in Embed.Title, Embed.Description, all EmbedFields (EmbedField.Name, EmbedField.Value), EmbedFooter.Text, and EmbedAuthor.Name fields across all embeds attached to a message exceeds 6000 characters
	ErrorEmbedTooLarge = fmt.Errorf("primitives: embed data too large")
	//ErrorEmbedTitleTooLarge is when Embed.Title is over 256 characters
	ErrorEmbedTitleTooLarge = fmt.Errorf("primitives: embed title too large")
	//ErrorEmbedDescriptionTooLarge is when Embed.Description is over 4096 characters
	ErrorEmbedDescriptionTooLarge = fmt.Errorf("primitives: embed description too large")
	//ErrorEmbedFieldsTooLarge is when len(Embed.Fields) > 25
	ErrorEmbedFieldsTooLarge = fmt.Errorf("primitives: too many embed fields")
	//ErrorEmbedFieldNameTooLarge is when EmbedField.Name is over 256 characters
	ErrorEmbedFieldNameTooLarge = fmt.Errorf("primitives: embedfield name too large")
	//ErrorEmbedFieldValueTooLarge is when EmbedField.Value is over 1024 characters
	ErrorEmbedFieldValueTooLarge = fmt.Errorf("primitives: embedfield value too large")
	//ErrorEmbedFooterTextTooLarge is when EmbedFooter.Text is over 2048 characters
	ErrorEmbedFooterTextTooLarge = fmt.Errorf("primitives: embed footer text too large")
	//ErrorEmbedAuthorNameTooLarge is when EmbedAuthor.Name is over 256 characters
	ErrorEmbedAuthorNameTooLarge = fmt.Errorf("primitives: embed author name too large")
)
View Source
var ErrorNoGatewayEventByName = fmt.Errorf("primitives: no valid GatewayEvent for given GatewayEventName")

Functions

This section is empty.

Types

type Activity

type Activity struct {
	//Name of Activity
	Name string `json:"name"`
	//Type of Activity
	Type ActivityType `json:"type,string"`
	//Url of Stream when Type=Streaming
	Url string `json:"url"`
	//CreatedAt unix timestamp in milliseconds when activity was created in user session
	CreatedAt time.Time `json:"created_at"`
	//Timestamps for start and end of game
	Timestamps []ActivityTimestamp `json:"timestamps"`
	//ApplicationID of game
	ApplicationID Snowflake `json:"application_id"`
	//Details of what User is doing
	Details string `json:"details"`
	//State of current User party
	State string `json:"state"`
	//Emoji for in custom status
	Emoji Emoji `json:"emoji"`
	//Party of User
	Party ActivityParty `json:"party"`
	//Assets such as images and hover-texts for presence
	Assets ActivityAssets `json:"assets"`
	//Secrets for Rich Presence joining and spectating
	Secrets ActivitySecrets `json:"secrets"`
	//IsInstance of game session
	IsInstance bool `json:"is_instance,string"`
	//Flags of Activity ORed together
	Flags ActivityFlag `json:"flags,string"`
	//Buttons shown in RichPresence (max 2)
	Buttons []Buttons `json:"buttons"`
}

Activity struct documented at https://discord.com/developers/docs/topics/gateway#activity-object

type ActivityAssets

type ActivityAssets struct {
	//LargeImage Asset todo: check if this is for CDN
	LargeImage Snowflake `json:"large_image"`
	//LargeText shown when hovering over large image of Activity
	LargeText string `json:"large_text"`
	//SmallImage Asset todo: check if this is for CDN
	SmallImage Snowflake `json:"small_image"`
	//SmallText shown when hovering over small image of Activity
	SmallText Snowflake `json:"small_text"`
}

ActivityAssets documented at https://discord.com/developers/docs/topics/gateway#activity-object-activity-assets

type ActivityFlag

type ActivityFlag uint8

ActivityFlag (bitwise, potential combination of flags) documented at https://discord.com/developers/docs/topics/gateway#activity-object-activity-flags

const (
	//ActivityFlagInvalid is a purposefully invalid Flag; for it is the default value of ActivityFlag
	ActivityFlagInvalid ActivityFlag = 0
	//ActivityFlagInstance of an Activity
	ActivityFlagInstance ActivityFlag = 1 << (iota - 1)
	//ActivityFlagJoin of an Activity
	ActivityFlagJoin
	//ActivityFlagSpectate of an Activity
	ActivityFlagSpectate
	//ActivityFlagJoinRequest of an Activity
	ActivityFlagJoinRequest
	//ActivityFlagSync of an Activity
	ActivityFlagSync
	//ActivityFlagPlay of an Activity
	ActivityFlagPlay
	//ActivityFlagAll ANDed bitmask of all ActivityFlag(s)
	ActivityFlagAll ActivityFlag = (1 << (iota - 1)) - 1
)

func (ActivityFlag) Contains

func (activityFlag ActivityFlag) Contains(flags ActivityFlag) bool

Contains a ActivityFlag

func (ActivityFlag) IsValid

func (activityFlag ActivityFlag) IsValid() bool

IsValid ActivityFlag

type ActivityParty

type ActivityParty struct {
	//ID of ActivityParty
	ID string `json:"id"`
	//Size of ActivityParty; size[0] is current size, size[1] is max size
	Size [2]int `json:"size"`
}

ActivityParty documented at https://discord.com/developers/docs/topics/gateway#activity-object-activity-party

type ActivitySecrets

type ActivitySecrets struct {
	//Join Secret for ActivityParty
	Join string `json:"join"`
	//Spectate Secret for ActivityParty
	Spectate string `json:"spectate"`
	//Match Secret for an Instanced Match
	Match string `json:"match"`
}

ActivitySecrets documented at https://discord.com/developers/docs/topics/gateway#activity-object-activity-secrets

type ActivityTimestamp

type ActivityTimestamp struct {
	//Start of Activity
	Start time.Time `json:"start"`
	//End of Activity
	End time.Time `json:"end"`
}

ActivityTimestamp documented at https://discord.com/developers/docs/topics/gateway#activity-object-activity-timestamps

type ActivityType

type ActivityType uint8

ActivityType documented at https://discord.com/developers/docs/topics/gateway#activity-object-activity-types

const (
	//ActivityTypeGame is when ActivityType is a Game
	ActivityTypeGame ActivityType = iota
	//ActivityTypeStreaming is when ActivityType is a Stream
	ActivityTypeStreaming
	//ActivityTypeListening is when ActivityType is Listening
	ActivityTypeListening
	//ActivityTypeWatching is when ActivityType is Watching
	ActivityTypeWatching
	//ActivityTypeCustom is when ActivityType is a Custom PresenceStatus
	ActivityTypeCustom
	//ActivityTypeCompeting is when ActivityType is Competing
	ActivityTypeCompeting
	//ActivityTypeInvalid is purposefully when ActivityType is Invalid
	ActivityTypeInvalid = math.MaxUint8
)

todo: potentially make ActivityType default value not the same as the discord API; makes the default value not ActivityTypeGame

func (ActivityType) IsValid

func (activityType ActivityType) IsValid() bool

IsValid ActivityType

type Application

type Application struct {
	//ID of Application
	ID Snowflake `json:"id,string"`
	//Name of Application
	Name string `json:"name"`
	//IconHash of Application
	IconHash ImageHash `json:"icon"`
	//Description of Application
	Description string `json:"description"`
	//RPCOriginsURLs if RPC enabled
	RPCOriginURLS []string `json:"rpc_origin_urls"`
	//IsBotPublic or can only Owner User join this Bot to Guild(s)
	IsBotPublic bool `json:"bot_public"`
	//BotRequiresCodeGrant completion of oauth2 flow
	BotRequiresCodeGrant bool `json:"bot_require_code_grant"`
	//TermsOfServiceURL of Application
	TermsOfServiceURL string `json:"terms_of_service_url"`
	//PrivacyPolicyURL of Application
	PrivacyPolicyURL string `json:"privacy_policy_url"`
	//Owner of Application (with discriminator, flags, id, and username fields filled)
	Owner User `json:"owner"`
	//Summary of Application if sold on Discord Store
	Summary string `json:"summary"`
	//VerifyKey in HEX for Application Interactions and GameSDK GetTicker
	VerifyKey string `json:"verify_key"`
	//Team if Application belongs to a Team
	Team Team `json:"team"`
	//GuildID Application has been linked to
	GuildID Snowflake `json:"guild_id,string"`
	//PrimarySKUID of Game SKU
	PrimarySKUID Snowflake `json:"primary_sku_id,string"`
	//URLSlug if sold on Discord as a Game
	URLSlug string `json:"slug"`
	//CoverImageHash of Application's default rich presence Invite
	CoverImageHash ImageHash `json:"cover_image"`
	//Flags of Application that are public
	Flags ApplicationFlag `json:"flags"`
}

Application documented at https://discord.com/developers/docs/resources/application#application-object

type Attachment

type Attachment struct {
	//ID of the Attachment
	ID Snowflake `json:"id"`
	//FileName of the Attachment
	FileName string `json:"filename"`
	//Description for the File
	Description string `json:"description"`
	//ContentType is the MIME type of the Attachment
	ContentType string `json:"content_type"`
	//Size of the File in bytes
	Size int `json:"size"`
	//URL for File
	URL string `json:"URL"`
	//ProxyURL of a proxied Attachment
	ProxyURL string `json:"proxy_url"`
	//Height of File (if image)
	Height int `json:"height"`
	//Width of File (if image)k
	Width int `json:"width"`
	//IsEphemeral Attachment that will be removed after set period of time
	IsEphemeral bool `json:"ephemeral"`
}

Attachment documented at https://discord.com/developers/docs/resources/channel#attachment-object

type Buttons

type Buttons struct {
	//Label of Button (1-32 characters)
	Label string `json:"label"`
	//Url opened when clicking button (1-512 characters)
	Url string `json:"url"`
}

Buttons documented at https://discord.com/developers/docs/topics/gateway#activity-object-activity-buttons

type Channel

type Channel struct {
	//ID of Channel
	ID Snowflake `json:"id,string"`
	//Type of Channel
	Type ChannelType `json:"type"`
	//GuildID of Guild; may be missing for some channel objects received over gateway guild dispatches)
	GuildID Snowflake `json:"guild_id,string"`
	//Position of sorting
	Position int `json:"position"`
	//PermissionOverwrites for GuildMembers and Roles; these are explicit
	PermissionOverwrites []Overwrite `json:"permission_overwrites"`
	//Name of Channel (1-100 characters)
	Name string `json:"name"`
	//Topic of Channel (0-1024 characters)
	Topic string `json:"topic"`
	//IsNSFW Channel
	IsNSFW bool `json:"nsfw"`
	//LastMessageID for Channel (may not point to actual message)
	LastMessageID Snowflake `json:"last_message_id,string"`
	//Bitrate of Channel if VC
	Bitrate int `json:"bitrate"`
	//MemberLimit of Channel if VC
	MemberLimit int `json:"user_limit"`
	//RateLimitPerMember that a GuildMember has to wait before sending another message (0-21600); members with MANAGE_MESSAGES or MANAGE_CHANNEL are unaffected; applies to both message and create creation
	RateLimitPerMember int `json:"rate_limit_per_user"`
	//Recipients of a DM
	Recipients []User `json:"recipients"`
	//IconHash for grabbing Icon from CDN
	IconHash ImageHash `json:"icon"`
	//OwnerID of group DM or Thread
	OwnerID Snowflake `json:"owner_id,string"`
	//ApplicationID if group DM is bot-created
	ApplicationID Snowflake `json:"application_id,string"`
	//ParentID for a Guild Channel: category, Thread: Channel where created
	ParentID Snowflake `json:"parent_id,string"`
	//LastPinTimestamp maybe nil when no Messages have been pinned
	LastPinTimestamp time.Time `json:"last_pin_timestamp"`
	//VoiceRegion, empty if automatic
	VoiceRegion VoiceRegion `json:"rtc_region"`
	//VideoQualityMode of Channel, 1 when not present
	VoiceQualityMode VoiceQualityMode `json:"voice_quality_mode"`
	//MessageCount, this is Approximate, stops after 50
	MessageCount int `json:"message_count"`
	//MemberCount, this is Approximate, stops after 50
	MemberCount int `json:"member_count"`
	//ThreadMetadata not needed by other channels
	ThreadMetadata ThreadMetadata `json:"thread_metadata"`
	//Member aka current user if they have joined thread; only available for certain API Endpoints
	Member ThreadMember `json:"member"`
	//DefaultAutoArchiveDuration that clients use for newly made threads in minutes after activity; can be set to 60, 1440, 4320, 10080
	DefaultAutoArchiveDuration int `json:"default_auto_archive_duration"`
	//Permissions of Bot user including overwrites; only included when part of RESOLVED data received from SlashCommandInteraction
	Permissions string `json:"permissions"`
}

Channel struct from https://discord.com/developers/docs/resources/channel#channel-object

type ChannelMention

type ChannelMention struct {
	//ID of Channel
	ID Snowflake `json:"id,string"`
	//GuildID containing Channel
	GuildID Snowflake `json:"guild_id,string"`
	//Type of Channel
	Type ChannelType `json:"type"`
	//Name of Channel
	Name string `json:"name"`
}

ChannelMention documented at https://discord.com/developers/docs/resources/channel#channel-mention-object

type ChannelType

type ChannelType uint8

ChannelType from https://discord.com/developers/docs/resources/channel#channel-object-channel-types

const (
	//ChannelTypeGuildText is a text Channel within a Guild
	ChannelTypeGuildText ChannelType = iota
	//ChannelTypeDM is a direct message between User(s)
	ChannelTypeDM
	//ChannelTypeGuildVoice is a voice Channel within a Guild
	ChannelTypeGuildVoice
	//ChannelTypeGroupDM is a direct message between multiple User(s)
	ChannelTypeGroupDM
	//ChannelTypeGuildCategory is an OrganizationalCategory (max 50 Channel(s)) documented at https://support.discord.com/hc/en-us/articles/115001580171-Channel-Categories-101
	ChannelTypeGuildCategory
	//ChannelTypeGuildNews is a followable Channel that duplications messages into another Guild
	ChannelTypeGuildNews
	//ChannelTypeGuildStore is a Channel for game sellers
	ChannelTypeGuildStore
	//ChannelTypeGuildNewsThread is a Thread within ChannelTypeGuildNews
	ChannelTypeGuildNewsThread ChannelType = iota + 3
	//ChannelTypeGuildPublicThread is a Thread within ChannelTypeGuildText
	ChannelTypeGuildPublicThread
	//ChannelTypeGuildPrivateThread is a private Thread shown to those with Permission(s)
	ChannelTypeGuildPrivateThread
	//ChannelTypeGuildStageVoice is a Voice Channel for a GuildMember to many GuildMember(s) with options for choosing hosts or raising hands
	ChannelTypeGuildStageVoice
	//ChannelTypeINVALID is a purposefully invalid and not used ChannelType
	ChannelTypeINVALID ChannelType = math.MaxUint8
)

todo: potentially change ChannelType to not follow discord, as default value is 0 and discord defines GuildText as 0

func (ChannelType) IsValid

func (channelType ChannelType) IsValid() bool

IsValid ChannelType

type ClientStatus

type ClientStatus struct {
	//IsDesktop application session
	Desktop string `json:"desktop"`
	//IsMobile application session
	Mobile string `json:"mobile"`
	//IsWeb or Bot application session
	Web string `json:"web"`
}

ClientStatus struct documented at https://discord.com/developers/docs/topics/gateway#client-status-object

type Embed

type Embed struct {
	//Title of Embed
	Title string `json:"title"`
	//Type of Embed, always EmbedTypeRich for a webhook Embed
	Type EmbedType `json:"type"`
	//Description of Embed
	Description string `json:"description"`
	//URL of Embed
	URL string `json:"URL"`
	//Timestamp of Embed
	Timestamp time.Time `json:"timestamp"`
	//ColorCode of Embed
	ColorCode int `json:"color"`
	//Footer of Embed
	Footer EmbedFooter `json:"footer"`
	//Image of Embed
	Image EmbedImage `json:"image"`
	//Thumbnail of Embed
	Thumbnail EmbedThumbnail `json:"thumbnail"`
	//Video of Embed
	Video EmbedVideo `json:"video"`
	//Provider of Embed
	Provider EmbedProvider `json:"provider"`
	//Author of Embed
	Author EmbedAuthor `json:"author"`
	//Fields of Embed
	Fields []EmbedField `json:"fields"`
}

Embed documented https://discord.com/developers/docs/resources/channel#embed-object

func (Embed) IsValid

func (e Embed) IsValid() error

IsValid Embed following https://discord.com/developers/docs/resources/channel#embed-object-embed-limits, nil if valid, don't know if discord considers a rune a character or an utf-8 character, assuming utf-8

type EmbedAuthor

type EmbedAuthor struct {
	//Name of EmbedAuthor
	Name string `json:"name"`
	//URL for EmbedAuthor
	URL string `json:"url"`
	//IconURL of EmbedAuthor
	IconURL string `json:"icon_url"`
	//ProxyIconUrl for EmbedAuthor
	ProxyIconURL string `json:"proxy_icon_url"`
}

EmbedAuthor documented at https://discord.com/developers/docs/resources/channel#embed-object-embed-author-structure

type EmbedField

type EmbedField struct {
	//Name of EmbedField
	Name string `json:"name"`
	//Value of EmbedField
	Value string `json:"value"`
	//IsInline displayed
	IsInline bool `json:"inline"`
}

EmbedField documented at https://discord.com/developers/docs/resources/channel#embed-object-embed-field-structure

type EmbedFooter

type EmbedFooter struct {
	//Text of EmbedFooter
	Text string `json:"text"`
	//IconURL of EmbedFooter
	IconURL string `json:"icon_url"`
	//ProxyIconUrl for EmbedFooter
	ProxyIconURL string `json:"proxy_icon_url"`
}

EmbedFooter documented at https://discord.com/developers/docs/resources/channel#embed-object-embed-footer-structure

type EmbedImage

type EmbedImage struct {
	//URL for EmbedImage
	URL string `json:"url"`
	//ProxyURL for EmbedImage
	ProxyURL string `json:"proxy_url"`
	//Height of EmbedImage
	Height int `json:"height"`
	//Width of EmbedImage
	Width int `json:"width"`
}

EmbedImage documented at https://discord.com/developers/docs/resources/channel#embed-object-embed-image-structure

type EmbedProvider

type EmbedProvider struct {
	//Name of EmbedProvider
	Name string `json:"name"`
	//URL for EmbedProvider
	URL string `json:"url"`
}

EmbedProvider documented at https://discord.com/developers/docs/resources/channel#embed-object-embed-provider-structure

type EmbedThumbnail

type EmbedThumbnail struct {
	//URL for EmbedThumbnail
	URL string `json:"url"`
	//ProxyURL for EmbedThumbnail
	ProxyURL string `json:"proxy_url"`
	//Height of EmbedThumbnail
	Height int `json:"height"`
	//Width of EmbedThumbnail
	Width int `json:"width"`
}

EmbedThumbnail documented at https://discord.com/developers/docs/resources/channel#embed-object-embed-thumbnail-structure

type EmbedType

type EmbedType string

EmbedType is documented at https://discord.com/developers/docs/resources/channel#embed-object-embed-types

const (
	EmbedTypeNil     EmbedType = "null"
	EmbedTypeRich    EmbedType = "rich"
	EmbedTypeImage   EmbedType = "image"
	EmbedTypeVideo   EmbedType = "video"
	EmbedTypeGifv    EmbedType = "gifv"
	EmbedTypeArticle EmbedType = "article"
	EmbedTypeLink    EmbedType = "link"
)

func (EmbedType) IsValid

func (e EmbedType) IsValid() bool

IsValid EmbedType

type EmbedVideo

type EmbedVideo struct {
	//URL for EmbedVideo
	URL string `json:"url"`
	//ProxyURL for EmbedVideo
	ProxyURL string `json:"proxy_url"`
	//Height of EmbedVideo
	Height int `json:"height"`
	//Width of EmbedVideo
	Width int `json:"width"`
}

EmbedVideo documented at https://discord.com/developers/docs/resources/channel#embed-object-embed-video-structure

type Emoji

type Emoji struct {
	//ID of Emoji
	ID Snowflake `json:"id,string"`
	//Name of Emoji; empty in reaction Emoji
	Name string `json:"name"`
	//Roles allowed to use this Emoji
	Roles []Role `json:"roles"`
	//Creator of this Emoji
	Creator User `json:"user"`
	//RequiresColons wrapped around Name to use
	RequiresColons bool `json:"require_colons"`
	//IsManaged Emoji?
	IsManaged bool `json:"managed"`
	//IsAnimated Emoji?
	IsAnimated bool `json:"animated"`
	//IsAvailable to use; may be false if Guild Boosts are removed
	IsAvailable bool `json:"available"`
}

Emoji struct from https://discord.com/developers/docs/resources/emoji#emoji-object

type GEvent

type GEvent struct {
	//Opcode for payload;
	Opcode         GatewayOpcode   `json:"op"`
	Data           json.RawMessage `json:"d,omitempty"`
	SequenceNumber int             `json:"s,omitempty"`
	Name           string          `json:"t,omitempty"`
}

GEvent is an Opcode event from the Gateway, I really wish discord didn't send data like this, makes it essentially impossible to parse without multiple passes maybe look into seeing if ETF is any better

type GatewayErrorEventCode

type GatewayErrorEventCode int

GatewayErrorEventCode documented at https://discord.com/developers/docs/topics/opcodes-and-status-codes#gateway-gateway-close-event-codes

const (
	GatewayErrorEventCodeUnknownError         GatewayErrorEventCode = 4000
	GatewayErrorEventCodeUnknownOpcode        GatewayErrorEventCode = 4001
	GatewayErrorEventCodeDecodeError          GatewayErrorEventCode = 4002
	GatewayErrorEventCodeNotAuthenticated     GatewayErrorEventCode = 4003
	GatewayErrorEventCodeAuthenticationFailed GatewayErrorEventCode = 4004
	GatewayErrorEventCodeAlreadyAuthenticated GatewayErrorEventCode = 4005
	GatewayErrorEventCodeInvalidSequence      GatewayErrorEventCode = 4007
	GatewayErrorEventCodeRateLimited          GatewayErrorEventCode = 4008
	GatewayErrorEventCodeSessionTimedOut      GatewayErrorEventCode = 4009
	GatewayErrorEventCodeInvalidShard         GatewayErrorEventCode = 4010
	GatewayErrorEventCodeSharingRequired      GatewayErrorEventCode = 4011
	GatewayErrorEventCodeInvalidAPIVersion    GatewayErrorEventCode = 4012
	GatewayErrorEventCodeInvalidIntents       GatewayErrorEventCode = 4013
	GatewayErrorEventCodeDisallowedIntents    GatewayErrorEventCode = 4014
)

type GatewayEvent

type GatewayEvent interface {
	//Type of GatewayEvent
	Type() GatewayEventType
	Opcode() GatewayOpcode
}

func GetGatewayEventByName

func GetGatewayEventByName(name string) (GatewayEvent, error)

GetGatewayEventByName returns an interface which is a pointer to an empty struct of the corresponding GatewayEventType

type GatewayEventChannelCreate

type GatewayEventChannelCreate struct {
	Channel
}

func (GatewayEventChannelCreate) Opcode

func (GatewayEventChannelCreate) Type

type GatewayEventChannelDelete

type GatewayEventChannelDelete struct {
	Channel
}

func (GatewayEventChannelDelete) Opcode

func (GatewayEventChannelDelete) Type

type GatewayEventChannelPinsUpdate

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

GatewayEventChannelPinsUpdate documented at https://discord.com/developers/docs/topics/gateway#channel-pins-update This is *NOT* sent when a pinned message is deleted

func (GatewayEventChannelPinsUpdate) Opcode

func (GatewayEventChannelPinsUpdate) Type

type GatewayEventChannelUpdate

type GatewayEventChannelUpdate struct {
	Channel
}

GatewayEventChannelUpdate documented at https://discord.com/developers/docs/topics/gateway#channel-update; todo: state for "last_message_id" is only tracked when listening for MessageCreate events

func (GatewayEventChannelUpdate) Opcode

func (GatewayEventChannelUpdate) Type

type GatewayEventClientShutdown

type GatewayEventClientShutdown struct {
	//err that caused shutdown
	Err error
}

GatewayEventClientShutdown is the event thrown when the Client Library is shutdown

func (GatewayEventClientShutdown) Error

Error that caused the shutdown, nil if no error and standard shutdown

func (GatewayEventClientShutdown) Opcode

func (GatewayEventClientShutdown) Type

type GatewayEventGuildBanAdd

type GatewayEventGuildBanAdd struct {
	//GuildID User is banned from
	GuildID Snowflake `json:"guild_id"`
	//User that is banned
	User User `json:"user"`
}

GatewayEventGuildBanAdd documented at https://discord.com/developers/docs/topics/gateway#guild-ban-add

func (GatewayEventGuildBanAdd) Opcode

func (GatewayEventGuildBanAdd) Type

type GatewayEventGuildBanRemove

type GatewayEventGuildBanRemove struct {
	//GuildID User is unbanned from
	GuildID Snowflake `json:"guild_id"`
	//User that is unbanned
	User User `json:"user"`
}

GatewayEventGuildBanRemove documented at https://discord.com/developers/docs/topics/gateway#guild-ban-remove

func (GatewayEventGuildBanRemove) Opcode

func (GatewayEventGuildBanRemove) Type

type GatewayEventGuildCreate

type GatewayEventGuildCreate struct {
	Guild
}

GatewayEventGuildCreate documented at https://discord.com/developers/docs/topics/gateway#guilds sent in scenarios: initial connection, after guild is available, Bot joins new Guild note: needs GatewayIntentGuildPresences Members and Presences in Guild(s) over 75k members contain only the Bot and ChannelTypeGuildVoice User(s)

func (GatewayEventGuildCreate) Opcode

func (GatewayEventGuildCreate) Type

type GatewayEventGuildDelete

type GatewayEventGuildDelete struct {
	UnavailableGuild
}

GatewayEventGuildDelete documented at https://discord.com/developers/docs/topics/gateway#guild-delete if unavailable field is not set, user was removed from guild

func (GatewayEventGuildDelete) Opcode

func (GatewayEventGuildDelete) Type

type GatewayEventGuildEmojisUpdate

type GatewayEventGuildEmojisUpdate struct {
	//GuildID for Emoji(s) update
	GuildID Snowflake `json:"guild_id"`
	//Emojis of Guild //todo: check if this is actually an array of the changed or just all
	Emojis []Emoji `json:"emojis"`
}

GatewayEventGuildEmojisUpdate documented at https://discord.com/developers/docs/topics/gateway#guild-emojis-update-guild-emojis-update-event-fields

func (GatewayEventGuildEmojisUpdate) Opcode

func (GatewayEventGuildEmojisUpdate) Type

type GatewayEventGuildIntegrationDelete

type GatewayEventGuildIntegrationDelete struct {
	//ID of the integration
	ID Snowflake `json:"id"`
	//GuildID of the integration
	GuildID Snowflake `json:"guild_id"`
	//ApplicationID of bot/OAuth2 application for this discord integration
	ApplicationID Snowflake `json:"application_id"`
}

GatewayEventGuildIntegrationDelete documented at https://discord.com/developers/docs/topics/gateway#integration-delete

func (GatewayEventGuildIntegrationDelete) Opcode

func (GatewayEventGuildIntegrationDelete) Type

type GatewayEventGuildIntegrationUpdate

type GatewayEventGuildIntegrationUpdate struct {
	//GuildID of Guild that integration is updated in
	GuildID Snowflake `json:"guild_id"`
}

GatewayEventGuildIntegrationUpdate documented at https://discord.com/developers/docs/topics/gateway#integration-update

func (GatewayEventGuildIntegrationUpdate) Opcode

func (GatewayEventGuildIntegrationUpdate) Type

type GatewayEventGuildIntegrationsUpdate

type GatewayEventGuildIntegrationsUpdate struct {
	//GuildID for Integration update
	GuildID Snowflake `json:"guild_id"`
}

GatewayEventGuildIntegrationsUpdate documented at https://discord.com/developers/docs/topics/gateway#guild-integrations-update

func (GatewayEventGuildIntegrationsUpdate) Opcode

func (GatewayEventGuildIntegrationsUpdate) Type

type GatewayEventGuildMemberAdd

type GatewayEventGuildMemberAdd struct {
	//GuildID of that GuildMember was added to
	GuildID Snowflake `json:"guild_id"`
	GuildMember
}

GatewayEventGuildMemberAdd documented at https://discord.com/developers/docs/topics/gateway#guild-member-add this requires GatewayIntentGuildMembers

func (GatewayEventGuildMemberAdd) Opcode

func (GatewayEventGuildMemberAdd) Type

type GatewayEventGuildMemberRemove

type GatewayEventGuildMemberRemove struct {
	//GuildID of the User removed
	GuildID Snowflake `json:"guild_id"`
	//User removed from Guild
	User User `json:"user"`
}

GatewayEventGuildMemberRemove documented at https://discord.com/developers/docs/topics/gateway#guild-member-remove requires GatewayIntentGuildMembers

func (GatewayEventGuildMemberRemove) Opcode

func (GatewayEventGuildMemberRemove) Type

type GatewayEventGuildMemberUpdate

type GatewayEventGuildMemberUpdate struct {
	//GuildID of the User updated
	GuildID Snowflake `json:"guild_id"`
	//Roles of User
	Roles []Role `json:"roles"`
	//User updated
	User User `json:"user"`
	//Nickname of User
	Nickname string `json:"nick"`
	//AvatarHash of User
	AvatarHash ImageHash `json:"avatar_hash"`
	//JoinedAt time to Guild
	JoinedAt time.Time `json:"joined_at"`
	//PremiumSince Time in Guild
	PremiumSince time.Time `json:"premium_since"`
	//IsDeafened in Voice Channels
	IsDeafened bool `json:"deaf"`
	//IsMuted in Voice Channels
	IsMuted bool `json:"is_muted"`
	//IsPending membership screening
	IsPending bool `json:"is_pending"`
	//CommunicationDisabledUntil time.Time that the GuildMember will be able to communication is enabled again
	CommunicationDisabledUntil time.Time `json:"communication_disabled_until"`
}

GatewayEventGuildMemberUpdate documented at https://discord.com/developers/docs/topics/gateway#guild-member-update requires GatewayIntentGuildMembers

func (GatewayEventGuildMemberUpdate) Opcode

func (GatewayEventGuildMemberUpdate) Type

type GatewayEventGuildMembersChunk

type GatewayEventGuildMembersChunk struct {
	//GuildID of the User updated
	GuildID Snowflake `json:"guild_id"`
	//Members of Chunk
	Members []GuildMember `json:"members"`
	//Index of Chunk
	Index int `json:"index"`
	//Count of Chunks expected
	Count int `json:"count"`
	//NotFoundIDs is the invalid ID sent to GuildRequestMembers
	//todo: check if this is a string
	NotFoundIDs []string `json:"not_found"`
	//Presences if true passed to GuildRequestMembers
	Presences []PresenceUpdate `json:"presences"`
	//Nonce used in GuildRequestMembers
	Nonce string `json:"nonce"`
}

GatewayEventGuildMembersChunk documented at https://discord.com/developers/docs/topics/gateway#guild-members-chunk send in response to GuildRequestMembers

func (GatewayEventGuildMembersChunk) Opcode

func (GatewayEventGuildMembersChunk) Type

type GatewayEventGuildRoleCreate

type GatewayEventGuildRoleCreate struct {
	//GuildID of the Role
	GuildID Snowflake `json:"guild_id"`
	//Role created
	Role Role `json:"role"`
}

GatewayEventGuildRoleCreate documented at https://discord.com/developers/docs/topics/gateway#guild-role-create

func (GatewayEventGuildRoleCreate) Opcode

func (GatewayEventGuildRoleCreate) Type

type GatewayEventGuildRoleDelete

type GatewayEventGuildRoleDelete struct {
	//GuildID of the Role
	GuildID Snowflake `json:"guild_id"`
	//Role created
	RoleID Snowflake `json:"role_id"`
}

GatewayEventGuildRoleDelete documented at https://discord.com/developers/docs/topics/gateway#guild-role-delete

func (GatewayEventGuildRoleDelete) Opcode

func (GatewayEventGuildRoleDelete) Type

type GatewayEventGuildRoleUpdate

type GatewayEventGuildRoleUpdate struct {
	//GuildID of the Role
	GuildID Snowflake `json:"guild_id"`
	//Role created
	Role Role `json:"role"`
}

GatewayEventGuildRoleUpdate documented at https://discord.com/developers/docs/topics/gateway#guild-role-update

func (GatewayEventGuildRoleUpdate) Opcode

func (GatewayEventGuildRoleUpdate) Type

type GatewayEventGuildScheduledEventCreate

type GatewayEventGuildScheduledEventCreate struct {
	GuildScheduledEvent
}

GatewayEventGuildScheduledEventCreate documented at https://discord.com/developers/docs/topics/gateway#guild-scheduled-event-create

func (GatewayEventGuildScheduledEventCreate) Opcode

func (GatewayEventGuildScheduledEventCreate) Type

type GatewayEventGuildScheduledEventDelete

type GatewayEventGuildScheduledEventDelete struct {
	GuildScheduledEvent
}

GatewayEventGuildScheduledEventDelete documented at https://discord.com/developers/docs/topics/gateway#guild-scheduled-event-delete

func (GatewayEventGuildScheduledEventDelete) Opcode

func (GatewayEventGuildScheduledEventDelete) Type

type GatewayEventGuildScheduledEventUpdate

type GatewayEventGuildScheduledEventUpdate struct {
	GuildScheduledEvent
}

GatewayEventGuildScheduledEventUpdate documented at https://discord.com/developers/docs/topics/gateway#guild-scheduled-event-update

func (GatewayEventGuildScheduledEventUpdate) Opcode

func (GatewayEventGuildScheduledEventUpdate) Type

type GatewayEventGuildScheduledEventUserAdd

type GatewayEventGuildScheduledEventUserAdd struct {
	//GuildScheduledEventID is the ID of the GuildScheduledEvent
	GuildScheduledEventID Snowflake `json:"guild_scheduled_event_id"`
	//UserID of the User added to the GuildScheduledEvent
	UserID Snowflake `json:"user_id"`
	//GuildID where GuildScheduledEvent is taking place
	GuildID Snowflake `json:"guild_id"`
}

GatewayEventGuildScheduledEventUserAdd documented at https://discord.com/developers/docs/topics/gateway#guild-scheduled-event-user-add

func (GatewayEventGuildScheduledEventUserAdd) Opcode

func (GatewayEventGuildScheduledEventUserAdd) Type

type GatewayEventGuildScheduledEventUserRemove

type GatewayEventGuildScheduledEventUserRemove struct {
	//GuildScheduledEventID is the ID of the GuildScheduledEvent
	GuildScheduledEventID Snowflake `json:"guild_scheduled_event_id"`
	//UserID of the User removed from the GuildScheduledEvent
	UserID Snowflake `json:"user_id"`
	//GuildID where GuildScheduledEvent is taking place
	GuildID Snowflake `json:"guild_id"`
}

GatewayEventGuildScheduledEventUserRemove documented at https://discord.com/developers/docs/topics/gateway#guild-scheduled-event-user-remove

func (GatewayEventGuildScheduledEventUserRemove) Opcode

func (GatewayEventGuildScheduledEventUserRemove) Type

type GatewayEventGuildStickersUpdate

type GatewayEventGuildStickersUpdate struct {
	//GuildID for Sticker(s) update
	GuildID Snowflake `json:"guild_id"`
	//Stickers of Guild //todo: check if this is actually an array of the changed or just all
	Stickers []Sticker `json:"stickers"`
}

GatewayEventGuildStickersUpdate documented at https://discord.com/developers/docs/topics/gateway#guild-stickers-update

func (GatewayEventGuildStickersUpdate) Opcode

func (GatewayEventGuildStickersUpdate) Type

type GatewayEventGuildUpdate

type GatewayEventGuildUpdate struct {
	Guild
}

GatewayEventGuildUpdate documented at https://discord.com/developers/docs/topics/gateway#guild-update

func (GatewayEventGuildUpdate) Opcode

func (GatewayEventGuildUpdate) Type

type GatewayEventHeartBeatRequest

type GatewayEventHeartBeatRequest struct{}

GatewayEventHeartBeatRequest is an internal event thrown when library receives a request from Websocket to heartbeat immediately

func (GatewayEventHeartBeatRequest) Opcode

func (GatewayEventHeartBeatRequest) Type

type GatewayEventHeartbeatACK

type GatewayEventHeartbeatACK struct{}

GatewayEventHeartbeatACK documented at https://discord.com/developers/docs/topics/gateway#heartbeating-example-gateway-heartbeat-ack

func (GatewayEventHeartbeatACK) Opcode

func (GatewayEventHeartbeatACK) Type

type GatewayEventHello

type GatewayEventHello struct {
	Interval int `json:"heartbeat_interval"`
}

GatewayEventHello documented at https://discord.com/developers/docs/topics/gateway#hello

func (GatewayEventHello) Opcode

func (gatewayHelloEvent GatewayEventHello) Opcode() GatewayOpcode

func (GatewayEventHello) Type

func (gatewayHelloEvent GatewayEventHello) Type() GatewayEventType

type GatewayEventIntegrationCreate

type GatewayEventIntegrationCreate struct {
	//GuildID is the ID of the Guild the Integration is created in
	GuildID Snowflake `json:"guild_id"`
}

GatewayEventIntegrationCreate documented at https://discord.com/developers/docs/topics/gateway#integration-create

func (GatewayEventIntegrationCreate) Opcode

func (GatewayEventIntegrationCreate) Type

type GatewayEventInvalidSession

type GatewayEventInvalidSession struct{}

GatewayEventInvalidSession this struct is probably never used, because discord does not send their data in a sensible way with this specific event, https://discord.com/developers/docs/topics/gateway#invalid-session-example-gateway-invalid-session

func (GatewayEventInvalidSession) Opcode

func (GatewayEventInvalidSession) Type

type GatewayEventInviteCreate

type GatewayEventInviteCreate struct {
	//ChannelID is the Channel the Invite leads to
	ChannelID Snowflake `json:"channel_id"`
	//InviteCode is the unique Invite code
	InviteCode string `json:"code"`
	//CreatedAt is when the Invite was created
	CreatedAt time.Time `json:"created_at"`
	//GuildID is the Guild ID for the Invite
	GuildID Snowflake `json:"guild_id"`
	//Inviter is the User that created the Invite
	Inviter User `json:"inviter"`
	//MaxAge of Invite
	MaxAge int `json:"max_age"`
	//MaxUses of Invite
	MaxUses int `json:"max_uses"`
	//TargetType is the target type for a ChannelTypeGuildVoice Invite
	TargetType InviteTargetType `json:"target_type"`
	//TargetUser is the User whose Stream to display for a ChannelTypeGuildVoice Invite
	TargetUser User `json:"target_user"`
	//TargetApplication is the EmbeddedApplication to open for a ChannelTypeGuildVoice embedded application Invite
	TargetApplication Application `json:"target_application"`
	//IsTemporary Invite that will kick Users if they leave and not assigned a Role
	IsTemporary bool `json:"temporary"`
	//Uses of Invite
	Uses int `json:"uses"`
}

GatewayEventInviteCreate is documented at https://discord.com/developers/docs/topics/gateway#invite-create

func (GatewayEventInviteCreate) Opcode

func (GatewayEventInviteCreate) Type

type GatewayEventInviteDelete

type GatewayEventInviteDelete struct {
	//ChannelID Invite is removed from
	ChannelID Snowflake `json:"channel_id"`
	//GuildID Invite is deleted from
	GuildID Snowflake `json:"guild_id"`
	//InviteCode for Invite
	InviteCode string `json:"code"`
}

GatewayEventInviteDelete is documented at https://discord.com/developers/docs/topics/gateway#invite-delete

func (GatewayEventInviteDelete) Opcode

func (GatewayEventInviteDelete) Type

type GatewayEventMessageCreate

type GatewayEventMessageCreate struct {
	Message
}

GatewayEventMessageCreate is documented at https://discord.com/developers/docs/topics/gateway#message-create

func (GatewayEventMessageCreate) Opcode

func (GatewayEventMessageCreate) Type

type GatewayEventMessageDelete

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

func (GatewayEventMessageDelete) Opcode

func (GatewayEventMessageDelete) Type

type GatewayEventMessageDeleteBulk

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

func (GatewayEventMessageDeleteBulk) Opcode

func (GatewayEventMessageDeleteBulk) Type

type GatewayEventMessageReactionAdd

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

func (GatewayEventMessageReactionAdd) Opcode

func (GatewayEventMessageReactionAdd) Type

type GatewayEventMessageReactionRemove

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

func (GatewayEventMessageReactionRemove) Opcode

func (GatewayEventMessageReactionRemove) Type

type GatewayEventMessageReactionRemoveAll

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

func (GatewayEventMessageReactionRemoveAll) Opcode

func (GatewayEventMessageReactionRemoveAll) Type

type GatewayEventMessageReactionRemoveEmoji

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

func (GatewayEventMessageReactionRemoveEmoji) Opcode

func (GatewayEventMessageReactionRemoveEmoji) Type

type GatewayEventMessageUpdate

type GatewayEventMessageUpdate struct {
	Message
}

func (GatewayEventMessageUpdate) Opcode

func (GatewayEventMessageUpdate) Type

type GatewayEventPresenceUpdate

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

func (GatewayEventPresenceUpdate) Opcode

func (GatewayEventPresenceUpdate) Type

type GatewayEventReady

type GatewayEventReady struct {
	//Version of Gateway
	Version int `json:"v"`
	//User struct about Bot
	User User `json:"user"`
	//UnavailableGuilds Bot is in
	UnavailableGuilds []UnavailableGuild `json:"unavailable_guilds"`
	//SessionID for resuming connections
	SessionID string `json:"session_id"`
	//ShardInformation associated with SessionID, if sent with Identify
	ShardInformation ShardInformation `json:"shard"`
	//Application of Bot (containing Application.ID and Application.Flags)
	Application Application `json:"application"`
}

GatewayEventReady documented at https://discord.com/developers/docs/topics/gateway#ready

func (GatewayEventReady) Opcode

func (gatewayEventReady GatewayEventReady) Opcode() GatewayOpcode

Opcode sent by gateway that contains this event

func (GatewayEventReady) Type

func (gatewayEventReady GatewayEventReady) Type() GatewayEventType

Type of GatewayEventReady

type GatewayEventReconnect

type GatewayEventReconnect struct{}

GatewayEventReconnect is documented at https://discord.com/developers/docs/topics/gateway#reconnect

func (GatewayEventReconnect) Opcode

func (GatewayEventReconnect) Type

type GatewayEventResumed

type GatewayEventResumed struct {
	//Token for Session
	Token string `json:"token"`
	//SessionID for Session
	SessionID string `json:"session_id"`
	//Sequence number last received from Gateway
	Sequence int `json:"seq"`
}

GatewayEventResumed documented at https://discord.com/developers/docs/topics/gateway#resumed

func (GatewayEventResumed) Opcode

func (GatewayEventResumed) Type

Type of GatewayEventResumed

type GatewayEventStageInstanceCreate

type GatewayEventStageInstanceCreate struct {
	StageInstance
}

func (GatewayEventStageInstanceCreate) Opcode

func (GatewayEventStageInstanceCreate) Type

type GatewayEventStageInstanceDelete

type GatewayEventStageInstanceDelete struct {
	StageInstance
}

func (GatewayEventStageInstanceDelete) Opcode

func (GatewayEventStageInstanceDelete) Type

type GatewayEventStageInstanceUpdate

type GatewayEventStageInstanceUpdate struct {
	StageInstance
}

func (GatewayEventStageInstanceUpdate) Opcode

func (GatewayEventStageInstanceUpdate) Type

type GatewayEventThreadCreate

type GatewayEventThreadCreate struct {
	Channel
}

GatewayEventThreadCreate documented at https://discord.com/developers/docs/topics/gateway#thread-create todo: separate event for existing private thread, which has a thread member

func (GatewayEventThreadCreate) Opcode

func (GatewayEventThreadCreate) Type

type GatewayEventThreadDelete

type GatewayEventThreadDelete struct {
	Channel
}

GatewayEventThreadDelete documented at https://discord.com/developers/docs/topics/gateway#thread-delete inner Channel only contains ID, GuildID, ParentID, and Type

func (GatewayEventThreadDelete) Opcode

func (GatewayEventThreadDelete) Type

type GatewayEventThreadListSync

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

GatewayEventThreadListSync documented at https://discord.com/developers/docs/topics/gateway#thread-list-sync

func (GatewayEventThreadListSync) Opcode

func (GatewayEventThreadListSync) Type

type GatewayEventThreadMemberUpdate

type GatewayEventThreadMemberUpdate struct {
	ThreadMember
}

GatewayEventThreadMemberUpdate documented at https://discord.com/developers/docs/topics/gateway#thread-member-update

func (GatewayEventThreadMemberUpdate) Opcode

func (GatewayEventThreadMemberUpdate) Type

type GatewayEventThreadMembersUpdate

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

GatewayEventThreadMembersUpdate documented at https://discord.com/developers/docs/topics/gateway#thread-members-update

func (GatewayEventThreadMembersUpdate) Opcode

func (GatewayEventThreadMembersUpdate) Type

type GatewayEventThreadUpdate

type GatewayEventThreadUpdate struct {
	Channel
}

GatewayEventThreadUpdate documented at https://discord.com/developers/docs/topics/gateway#thread-update not sent when Channel.LastMessageID is changed, only sent in MessageCreate events todo: we need to update the state in the ingestor for MessageCreate events for Channel.LastMessageID

func (GatewayEventThreadUpdate) Opcode

func (GatewayEventThreadUpdate) Type

type GatewayEventType

type GatewayEventType string

GatewayEventType documented at https://discord.com/developers/docs/topics/gateway#commands-and-events-gateway-events

const (
	//GatewayEventTypeHello defines heartbeat interval; documented at https://discord.com/developers/docs/topics/gateway#hello
	GatewayEventTypeHello GatewayEventType = "HELLO"
	//GatewayEventTypeHeartbeatRequest is a request for an immediate heartbeat to be sent to the gateway
	GatewayEventTypeHeartbeatRequest GatewayEventType = "INGESTOR_INTERNAL_HEARTBEAT_REQUEST"
	//GatewayEventTypeClientShutdown is a shutdown by the DiscordClient Library
	GatewayEventTypeClientShutdown GatewayEventType = "INGESTOR_INTERNAL_CLIENT_SHUTDOWN"
	//GatewayEventTypeHeartbeatACK is an acknowledgement of a successful heartbeat
	GatewayEventTypeHeartbeatACK GatewayEventType = "INGESTOR_INTERNAL_HEARTBEAT_ACK"
	//GatewayEventTypeReady contains initial state information; documented at https://discord.com/developers/docs/topics/gateway#ready
	GatewayEventTypeReady GatewayEventType = "READY"
	//GatewayEventTypeResumed is the response to a Resume Gateway command
	GatewayEventTypeResumed GatewayEventType = "RESUMED"
	//GatewayEventTypeReconnect is Gateway instructed Client to reconnect and send a Resume
	GatewayEventTypeReconnect GatewayEventType = "RECONNECT"
	//GatewayEventTypeInvalidSession is a failure response to a Gateway Identity or a Resume
	GatewayEventTypeInvalidSession GatewayEventType = "INVALID_SESSION"
	//GatewayEventTypeChannelCreate is a creation of a Channel
	GatewayEventTypeChannelCreate GatewayEventType = "CHANNEL_CREATE"
	//GatewayEventTypeChannelUpdate is an update of a Channel
	GatewayEventTypeChannelUpdate GatewayEventType = "CHANNEL_UPDATE"
	//GatewayEventTypeChannelDelete is a deletion of a Channel
	GatewayEventTypeChannelDelete GatewayEventType = "CHANNEL_DELETE"
	//GatewayEventTypeChannelPinsUpdate is the update of a Channel's pins
	GatewayEventTypeChannelPinsUpdate GatewayEventType = "CHANNEL_PINS_UPDATE"
	//GatewayEventTypeThreadCreate is the creation of Thread
	GatewayEventTypeThreadCreate GatewayEventType = "THREAD_CREATE"
	//GatewayEventTypeThreadUpdate is the update of a Thread
	GatewayEventTypeThreadUpdate GatewayEventType = "THREAD_UPDATE"
	//GatewayEventTypeThreadDelete is the deletion of a Thread
	GatewayEventTypeThreadDelete GatewayEventType = "THREAD_DELETE"
	//GatewayEventTypeThreadListSync is sent when gaining access to a Channel, contains all active Thread(s) in that Channel
	GatewayEventTypeThreadListSync GatewayEventType = "THREAD_LIST_SYNC"
	//GatewayEventTypeThreadMemberUpdate ThreadMember for bot was updated
	GatewayEventTypeThreadMemberUpdate GatewayEventType = "THREAD_MEMBER_UPDATE"
	//GatewayEventTypeThreadMembersUpdate multiple ThreadMember(s) were added or removed from a thread
	GatewayEventTypeThreadMembersUpdate GatewayEventType = "THREAD_MEMBERS_UPDATE"
	//GatewayEventTypeGuildCreate lazy-load for unavailable Guild, Guild became available, or User joined a new Guild
	GatewayEventTypeGuildCreate GatewayEventType = "GUILD_CREATE"
	//GatewayEventTypeGuildUpdate is the update of a Guild
	GatewayEventTypeGuildUpdate GatewayEventType = "GUILD_UPDATE"
	//GatewayEventTypeGuildDelete is when a Guild became unavailable, or Bot left/was removed from Guild
	GatewayEventTypeGuildDelete GatewayEventType = "GUILD_DELETE"
	//GatewayEventTypeGuildBanAdd is when a User is banned from a Guild
	GatewayEventTypeGuildBanAdd GatewayEventType = "GUILD_BAN_ADD"
	//GatewayEventTypeGuildBanRemove is when a User was unbanned from a Guild
	GatewayEventTypeGuildBanRemove GatewayEventType = "GUILD_BAN_REMOVE"
	//GatewayEventTypeGuildEmojisUpdate is a change in Emoji(s) in a Guild
	GatewayEventTypeGuildEmojisUpdate GatewayEventType = "GUILD_EMOJIS_UPDATE"
	//GatewayEventTypeGuildStickersUpdate is a change in Sticker(s) in a Guild
	GatewayEventTypeGuildStickersUpdate GatewayEventType = "GUILD_STICKERS_UPDATE"
	//GatewayEventTypeGuildIntegrationsUpdate is a change in an Integration(s) in a guild
	GatewayEventTypeGuildIntegrationsUpdate GatewayEventType = "GUILD_INTEGRATIONS_UPDATE"
	//GatewayEventTypeGuildMemberAdd is when a new User joins a Guild
	GatewayEventTypeGuildMemberAdd GatewayEventType = "GUILD_MEMBER_ADD"
	//GatewayEventTypeGuildMemberRemove is when a User leaves or is removed from a Guild
	GatewayEventTypeGuildMemberRemove GatewayEventType = "GUILD_MEMBER_REMOVE"
	//GatewayEventTypeGuildMemberUpdate is when a GuildMember was updated
	GatewayEventTypeGuildMemberUpdate GatewayEventType = "GUILD_MEMBER_UPDATE"
	//GatewayEventTypeGuildMembersChunk is a response to a RequestGuildMembers (https://discord.com/developers/docs/topics/gateway#request-guild-members)
	GatewayEventTypeGuildMembersChunk GatewayEventType = "GUILD_MEMBERS_CHUNK"
	//GatewayEventTypeGuildRoleCreate is when a Role is created in a Guild
	GatewayEventTypeGuildRoleCreate GatewayEventType = "GUILD_ROLE_CREATE"
	//GatewayEventTypeGuildRoleUpdate is when a Role is updated in a Guild
	GatewayEventTypeGuildRoleUpdate GatewayEventType = "GUILD_ROLE_UPDATE"
	//GatewayEventTypeGuildRoleDelete is when a Role is deleted in a Guild
	GatewayEventTypeGuildRoleDelete GatewayEventType = "GUILD_ROLE_DELETE"
	//GatewayEventTypeGuildScheduledEventCreate is when a GuildScheduledEvent is created
	GatewayEventTypeGuildScheduledEventCreate GatewayEventType = "GUILD_SCHEDULED_EVENT_CREATE"
	//GatewayEventTypeGuildScheduledEventUpdate is when a GuildScheduledEvent is updated
	GatewayEventTypeGuildScheduledEventUpdate GatewayEventType = "GUILD_SCHEDULED_EVENT_UPDATE"
	//GatewayEventTypeGuildScheduledEventDelete is when a GuildScheduledEvent is deleted
	GatewayEventTypeGuildScheduledEventDelete GatewayEventType = "GUILD_SCHEDULED_EVENT_DELETE"
	//GatewayEventTypeGuildScheduledEventUserAdd is when a GuildScheduledEvent has a User added
	GatewayEventTypeGuildScheduledEventUserAdd GatewayEventType = "GUILD_SCHEDULED_EVENT_USER_ADD"
	//GatewayEventTypeGuildScheduledEventUserRemove is when a GuildScheduledEvent has a User removed
	GatewayEventTypeGuildScheduledEventUserRemove GatewayEventType = "GUILD_SCHEDULED_EVENT_USER_REMOVE"
	//GatewayEventTypeGuildIntegrationCreate is when a Guild Integration was created
	GatewayEventTypeGuildIntegrationCreate GatewayEventType = "GUILD_INTEGRATION_CREATE"
	//GatewayEventTypeGuildIntegrationUpdate is when a Guild Integration was updated
	GatewayEventTypeGuildIntegrationUpdate GatewayEventType = "GUILD_INTEGRATION_UPDATE"
	//GatewayEventTypeGuildIntegrationDelete is when a Guild Integration was deleted
	GatewayEventTypeGuildIntegrationDelete GatewayEventType = "GUILD_INTEGRATION_DELETE"
	//GatewayEventTypeGuildInteractionCreate is when a User uses an Interaction (like application commands, https://discord.com/developers/docs/interactions/application-commands)
	GatewayEventTypeGuildInteractionCreate GatewayEventType = "GUILD_INTEGRATION_CREATE"
	//GatewayEventTypeInviteCreate is when an Invite to a channel was created
	GatewayEventTypeInviteCreate GatewayEventType = "INVITE_CREATE"
	//GatewayEventTypeInviteDelete is when an Invite to a channel was deleted
	GatewayEventTypeInviteDelete GatewayEventType = "INVITE_DELETE"
	//GatewayEventTypeMessageCreate documented at https://discord.com/developers/docs/topics/gateway#message-create
	GatewayEventTypeMessageCreate GatewayEventType = "MESSAGE_CREATE"
	//GatewayEventTypeMessageUpdate is when a Message was edited
	GatewayEventTypeMessageUpdate GatewayEventType = "MESSAGE_UPDATE"
	//GatewayEventTypeMessageDelete is when a Message was deleted
	GatewayEventTypeMessageDelete GatewayEventType = "MESSAGE_DELETE"
	//GatewayEventTypeMessageDeleteBulk is when multiple Messages were deleted
	GatewayEventTypeMessageDeleteBulk GatewayEventType = "MESSAGE_DELETE_BULK"
	//GatewayEventTypeMessageReactionAdd is when a User reacts to a Message
	GatewayEventTypeMessageReactionAdd GatewayEventType = "MESSAGE_REACTION_ADD"
	//GatewayEventTypeMessageReactionRemove is when a User removed a reaction from a Message
	GatewayEventTypeMessageReactionRemove GatewayEventType = "MESSAGE_REACTION_REMOVE"
	//GatewayEventTypeMessageReactionRemoveAll is when all reactions were removed from a Message
	GatewayEventTypeMessageReactionRemoveAll GatewayEventType = "MESSAGE_REACTION_REMOVE_ALL"
	//GatewayEventTypeMessageReactionRemoveEmoji is when all reactions for a specific Emoji was removed from a Message
	GatewayEventTypeMessageReactionRemoveEmoji GatewayEventType = "MESSAGE_REACTION_REMOVE_EMOJI"
	//GatewayEventTypePresenceUpdate is when a Presence for a User was updated
	GatewayEventTypePresenceUpdate GatewayEventType = "PRESENCE_UPDATE"
	//GatewayEventTypeStageInstanceCreate is when a ChannelTypeGuildStageVoice was created in a Guild
	GatewayEventTypeStageInstanceCreate GatewayEventType = "STAGE_INSTANCE_CREATE"
	//GatewayEventTypeStageInstanceDelete is when a ChannelTypeGuildStageVoice was deleted in a Guild
	GatewayEventTypeStageInstanceDelete GatewayEventType = "STAGE_INSTANCE_DELETE"
	//GatewayEventTypeStageInstanceUpdate is when a ChannelTypeGuildStageVoice was updated in a Guild
	GatewayEventTypeStageInstanceUpdate GatewayEventType = "STAGE_INSTANCE_UPDATE"
	//GatewayEventTypeTypingStart is when a User has started typing in a Channel
	GatewayEventTypeTypingStart GatewayEventType = "TYPING_START"
	//GatewayEventTypeUserUpdate is when a User's properties have been updated
	GatewayEventTypeUserUpdate GatewayEventType = "USER_UPDATE"
	//GatewayEventTypeVoiceStateUpdate is when a User has joined, left, or moved Voice Channel(s); VoiceState
	GatewayEventTypeVoiceStateUpdate GatewayEventType = "VOICE_STATE_UPDATE"
	//GatewayEventTypeVoiceServerUpdate is when a Guild's ChannelTypeGuildVoice has changed Endpoints
	GatewayEventTypeVoiceServerUpdate GatewayEventType = "VOICE_SERVER_UPDATE"
	//GatewayEventTypeWebhooksUpdate is when a Guild's Channel's Webhook was created, updated, or deleted
	GatewayEventTypeWebhooksUpdate GatewayEventType = "WEBHOOKS_UPDATE"
)

type GatewayEventTypingStart

type GatewayEventTypingStart struct {
	ChannelID Snowflake   `json:"channel_id"`
	GuildID   Snowflake   `json:"guild_id"`
	UserID    Snowflake   `json:"user_id"`
	Timestamp time.Time   `json:"timestamp"`
	Member    GuildMember `json:"member"`
}

func (GatewayEventTypingStart) Opcode

func (GatewayEventTypingStart) Type

type GatewayEventUserUpdate

type GatewayEventUserUpdate struct {
	User
}

func (GatewayEventUserUpdate) Opcode

func (GatewayEventUserUpdate) Type

type GatewayEventVoiceServerUpdate

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

func (GatewayEventVoiceServerUpdate) Opcode

func (GatewayEventVoiceServerUpdate) Type

type GatewayEventVoiceStateUpdate

type GatewayEventVoiceStateUpdate struct {
	VoiceState
}

func (GatewayEventVoiceStateUpdate) Opcode

func (GatewayEventVoiceStateUpdate) Type

type GatewayEventWebhooksUpdate

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

func (GatewayEventWebhooksUpdate) Opcode

func (GatewayEventWebhooksUpdate) Type

type GatewayIdentify

type GatewayIdentify struct {
	Opcode GatewayOpcode       `json:"op"`
	Data   GatewayIdentifyData `json:"d"`
}

type GatewayIdentifyData

type GatewayIdentifyData struct {
	Token      string                    `json:"token"`
	Intents    GatewayIntent             `json:"intents"`
	Properties GatewayIdentifyProperties `json:"properties"`
}

type GatewayIdentifyProperties

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

type GatewayIntent

type GatewayIntent uint16

GatewayIntent from https://discord.com/developers/docs/topics/gateway#gateway-intents

const (
	//GatewayIntentNil is when no GatewayIntent is set
	GatewayIntentNil GatewayIntent = 0
	//GatewayIntentGuilds contains events:
	//- GuildCreate
	//- GuildUpdate
	//- GuildDelete
	//- GuildRoleCreate
	//- GuildRoleUpdate
	//- GuildRoleDelete
	//- ChannelCreate
	//- ChannelUpdate
	//- ChannelDelete
	//- ChannelPinsUpdate
	//- ThreadCreate
	//- ThreadUpdate
	//- ThreadDelete
	//- ThreadListSync
	//- ThreadMemberUpdate
	//- ThreadMembersUpdate; data is different depending on intents used
	//- StageInstanceCreate
	//- StageInstanceUpdate
	//- StageInstanceDelete
	GatewayIntentGuilds GatewayIntent = 1 << (iota - 1)
	//GatewayIntentGuildMembers contains events:
	//- GuildMemberAdd
	//- GuildMemberUpdate
	//- GuildMemberRemove
	//- ThreadMembersUpdate *
	GatewayIntentGuildMembers
	//GatewayIntentGuildBans contains events:
	//- GuildBanAdd
	//- GuildBanRemove
	GatewayIntentGuildBans
	//GatewayIntentGuildEmojisAndStickers contains events:
	//- GuildEmojisUpdate
	//- GuildStickersUpdate
	GatewayIntentGuildEmojisAndStickers
	//GatewayIntentGuildIntegrations contains events:
	//- GuildIntegrationsUpdate
	//- IntegrationCreate
	//- IntegrationUpdate
	//- IntegrationDelete
	GatewayIntentGuildIntegrations
	//GatewayIntentGuildWebhooks contains events:
	//- WebhooksUpdate
	GatewayIntentGuildWebhooks
	//GatewayIntentGuildInvites contains events:
	//- InviteCreate
	//- InviteDelete
	GatewayIntentGuildInvites
	//GatewayIntentGuildVoiceStates contains events:
	//- VoiceStateUpdate
	GatewayIntentGuildVoiceStates
	//GatewayIntentGuildPresences contains events:
	//- PresenceUpdate
	GatewayIntentGuildPresences
	//GatewayIntentGuildMessages contains events:
	//- MessageCreate
	//- MessageUpdate
	//- MessageDelete
	//- MessageDeleteBulk
	GatewayIntentGuildMessages
	//GatewayIntentGuildMessageReactions contains events:
	//- MessageReactionAdd
	//- MessageReactionRemove
	//- MessageReactionRemoveAll
	//- MessageReactionRemoveEmoji
	GatewayIntentGuildMessageReactions
	//GatewayIntentGuildMessageTyping contains events:
	//- TypingStart
	GatewayIntentGuildMessageTyping
	//GatewayIntentDirectMessages contains events:
	//- MessageCreate
	//- MessageUpdate
	//- MessageDelete
	//- ChannelPinsUpdate
	GatewayIntentDirectMessages
	//GatewayIntentDirectMessageReactions contains events:
	//- MessageReactionAdd
	//- MessageReactionRemove
	//- MessageReactionRemoveAll
	//- MessageReactionRemoveEmoji
	GatewayIntentDirectMessageReactions
	//GatewayIntentDirectMessageTyping contains events:
	//- TypingStart
	GatewayIntentDirectMessageTyping
	//GatewayIntentAll is a combination of all known GatewayIntents
	GatewayIntentAll GatewayIntent = (1 << (iota - 1)) - 1
)

func (GatewayIntent) Contains

func (gatewayIntent GatewayIntent) Contains(intent GatewayIntent) bool

Contains another GatewayIntent

func (GatewayIntent) IsValid

func (gatewayIntent GatewayIntent) IsValid() bool

IsValid GatewayIntent

type GatewayOpcode

type GatewayOpcode int

GatewayOpcode of payload sent by Gateway; documented at https://discord.com/developers/docs/topics/opcodes-and-status-codes#gateway-gateway-opcodes

const (
	//GatewayOpcodeNil is an intentionally invalid Opcode
	GatewayOpcodeNil GatewayOpcode = -1
	//GatewayOpcodeDispatch is received by a Client for a dispatched GatewayEvent
	GatewayOpcodeDispatch GatewayOpcode = iota - 1
	//GatewayOpcodeHeartbeat is sent or received by a Client to keep a connection alive
	GatewayOpcodeHeartbeat
	//GatewayOpcodeIdentify is sent by a Client to start a new Session during an initial handshake
	GatewayOpcodeIdentify
	//GatewayOpcodePresenceUpdate is sent by a Client to update their Presence
	GatewayOpcodePresenceUpdate
	//GatewayOpcodeVoiceStateUpdate is sent by a Client to move between ChannelTypeGuildVoice
	GatewayOpcodeVoiceStateUpdate
	//GatewayOpcodeResume is sent by a Client to resume a previous Session
	GatewayOpcodeResume GatewayOpcode = iota
	//GatewayOpcodeReconnect is received by a Client to inform them to disconnect and GatewayOpcodeResume
	GatewayOpcodeReconnect
	//GatewayOpcodeRequestGuildMembers is sent by a Client to request information about offline GuildMember(s) in a Guild.IsLarge
	GatewayOpcodeRequestGuildMembers
	//GatewayOpcodeRequestInvalidSession is received by a Client that a Session has been invalidated, Client should reconnect and GatewayOpcodeIdentify or GatewayOpcodeResume
	GatewayOpcodeRequestInvalidSession
	//GatewayOpcodeHello is received by a Client after connecting, containing the heartbeat_interval to use; also used by Client when sending a heartbeat
	GatewayOpcodeHello
	//GatewayOpcodeHeartbeatACK is received by a Client acknowledging a successful GatewayOpcodeHeartbeat
	GatewayOpcodeHeartbeatACK
)

type Guild

type Guild struct {
	//ID of Guild
	ID Snowflake `json:"id,string"`
	//Name (2-100 characters, excluding trailing and leading whitespace)
	Name string `json:"name"`
	//Icon hash for Icon
	IconHash ImageHash `json:"icon"`
	//IconHashInTemplate, returned when in the template object; todo: function for Fully qualified url
	IconHashInTemplate ImageHash `json:"icon_hash"`
	//SplashHash; todo: function for Fully qualified url
	SplashHash ImageHash `json:"splash"`
	//DiscoverySplashHash; only present for Guilds with the "DISCOVERABLE" feature; todo: function for Fully qualified url
	DiscoverySplashHash ImageHash `json:"discovery_splash"`
	//IsBotOwner is true if Bot is Guild owner, only sent when using the GET Current User Guilds endpoint and are relative to the requested user
	IsBotOwner bool `json:"owner"`
	//OwnerID of guild
	OwnerID Snowflake `json:"owner_id,string"`
	//Permissions of current user in Guild; total permissions for the Bot in the Guild (excludes overwrites)
	Permissions string `json:"permissions"`
	//RegionID; voice region ID for the Guild (deprecated)
	VoiceRegionID string `json:"region"`
	//AFKChannelID for Guild
	AFKChannelID Snowflake `json:"afk_channel_id,string"`
	//AFKTimeout in seconds
	AFKTimeout int `json:"afk_timeout"`
	//WidgetEnabled for Guild
	WidgetEnabled bool `json:"widget_enabled"`
	//WidgetChannelID that the widget will generate an Invite to, 0 if no invite
	WidgetChannelID Snowflake `json:"widget_channel_id,string"`
	//VerificationLevel required for the Guild
	VerificationLevel VerificationLevel `json:"verification_level"`
	//DefaultMessageNotificationsLevel for Guild
	DefaultMessageNotificationsLevel MessageNotificationsLevel `json:"default_message_notifications"`
	//ExplicitContentFilterLevel for Guild
	ExplicitContentFilterLevel ExplicitContentFilterLevel `json:"explicit_content_filter"`
	//Roles for Guild
	Roles []Role `json:"roles"`
	//Emojis is a list of custom Emojis
	Emojis []Emoji `json:"emojis"`
	//EnabledFeatures is a list of enabled GuildFeature(s)
	EnabledFeatures []GuildFeature `json:"features"`
	//MFALevel that is required for Guild
	MFALevel MFALevel `json:"mfa_level"`
	//ApplicationID of guild creator if bot-created
	ApplicationID Snowflake `json:"application_id,string"`
	//SystemChannelID is ID of Channel where Guild notices such as welcome message and boost events are posted
	SystemChannelID Snowflake `json:"system_channel_id,string"`
	//SystemChannelFlags for SystemChannel
	SystemChannelFlags SystemChannelFlag `json:"system_channel_flags"`
	//RulesChannelID where community Guilds can display rules and/or guidelines
	RulesChannelID Snowflake `json:"rules_channel_id,string"`
	//BotJoinedAt a timestamp when bot joined this Guild; only sent in GUILD_CREATE Event
	BotJoinedAt time.Time `json:"joined_at"`
	//IsLarge if Guild is large; only sent in GUILD_CREATE Event
	IsLarge bool `json:"large"`
	//IsUnavailable due to outage; only sent in GUILD_CREATE Event
	IsUnavailable bool `json:"unavailable"`
	//MemberCount in Guild; only sent in GUILD_CREATE Event
	MemberCount int `json:"member_count"`
	//VoiceStates is a list of VoiceState; only sent in GUILD_CREATE Event; VoiceState(s) lack Guild ID
	VoiceStates []VoiceState `json:"voice_states"`
	//Members in Guild; only sent in GUILD_CREATE Event
	Members []GuildMember `json:"members"`
	//Channels in Guild; only sent in GUILD_CREATE Event
	Channels []Channel `json:"channels"`
	//Threads that Bot has permission to view; only sent in GUILD_CREATE Event
	Threads []Channel `json:"threads"`
	//Presences in Guild; only sent in GUILD_CREATE Event; only includes non-offline GuildMember(s) if IsLarge
	Presences []PresenceUpdate `json:"presences"`
	//MaxPresences in Guild; almost always 0 unless Guild is massive
	MaxPresences int `json:"max_presences"`
	//MaxMembers in Guild
	MaxMembers int `json:"max_members"`
	//VanityUrlCode for Guild
	VanityUrlCode string `json:"vanity_url_code"`
	//Description of a Community Guild
	Description string `json:"description"`
	//BannerHash for Guild
	BannerHash ImageHash `json:"banner"`
	//PremiumTier aka boost level
	PremiumTier PremiumTier `json:"premium_tier"`
	//PremiumSubscriptionCount is number of boosts Guild has
	PremiumSubscriptionCount int `json:"premium_subscription_count"`
	//PreferredLocale of Guild; used for Guild Discovery and Discord notices; defaults to en-US
	PreferredLocale string `json:"preferred_locale"`
	//PublicUpdatesChannelID where Guilds get Discord notices
	PublicUpdatesChannelID Snowflake `json:"public_updates_channel_id"`
	//MaxVideoChannelUsers in a Channel
	MaxVideoChannelUsers int `json:"max_video_channel_users"`
	//ApproximateMemberCount; returned from GET /guilds/<id> endpoint when with_counts is true
	ApproximateMemberCount int `json:"approximate_member_count"`
	//WelcomeScreen of a Community Guild, shown to new members, returned in an Invite
	WelcomeScreen WelcomeScreen `json:"welcome_screen"`
	//NSFWLevel of Guild
	NSFWLevel NSFWLevel `json:"nsfw_level"`
	//StageInstances in Guild; only sent in GUILD_CREATE Event
	StageInstances []StageInstance `json:"stage_instances"`
	//Stickers in Guild
	Stickers []Sticker `json:"stickers"`
	//ScheduledEvents in Guild
	ScheduledEvents []GuildScheduledEvent `json:"guild_scheduled_events"`
}

Guild struct from https://discord.com/developers/docs/resources/guild#guild-object

type GuildMember

type GuildMember struct {
	User                        User           `json:"user"`
	Nickname                    string         `json:"nick"`
	Avatar                      ImageHash      `json:"avatar,string"`
	RoleIds                     []Snowflake    `json:"roles"`
	JoinedAt                    time.Time      `json:"joined_at"`
	PremiumSince                time.Time      `json:"premium_since"`
	IsDeafened                  bool           `json:"deaf"`
	IsMuted                     bool           `json:"mute"`
	IsPending                   bool           `json:"pending"`
	Permissions                 PermissionFlag `json:"permissions,string"`
	CommunicationsDisabledUntil time.Time      `json:"communications_disabled_until"`
}

GuildMember from https://discord.com/developers/docs/resources/guild#guild-member-object todo: finish commenting

type GuildScheduledEvent

type GuildScheduledEvent struct {
	//ID of GuildScheduledEvent
	ID Snowflake `json:"id"`
	//GuildID is the ID of the Guild where Event takes place
	GuildID Snowflake `json:"guild_id"`
	//ChannelID where event will be held
	ChannelID Snowflake `json:"channel_id"`
	//CreatorID is User who created ScheduledEvent
	CreatorID Snowflake `json:"creator_id"`
	//Name of GuildScheduledEvent (1-100 characters)
	Name string `json:"name"`
	//Description of the GuildScheduledEvent (1-1000 characters)
	Description string `json:"description"`
	//ScheduledStartTime of GuildScheduledEvent
	ScheduledStartTime time.Time `json:"scheduled_start_time"`
	//ScheduledEndTime of GuildScheduledEvent
	ScheduledEndTime time.Time `json:"scheduled_end_time"`
	//PrivacyLevel of GuildScheduledEvent
	PrivacyLevel GuildScheduledEventPrivacyLevel `json:"privacy_level"`
	//Status of GuildScheduledEvent
	Status GuildScheduledEventStatus `json:"status"`
	//EntityType of GuildScheduledEvent
	EntityType GuildScheduledEventEntityType `json:"entity_type"`
	//EntityID of GuildScheduledEvent
	EntityID Snowflake `json:"entity_id"`
	//EntityMetadata is additional metadata for the GuildScheduledEvent
	EntityMetadata GuildScheduledEventEntityMetadata `json:"entity_metadata"`
	//Creator of GuildScheduledEvent
	Creator User `json:"creator"`
	//UserCount of subscribed User(s) to GuildScheduledEvent
	UserCount int `json:"user_count"`
}

GuildScheduledEvent documented at https://discord.com/developers/docs/resources/guild-scheduled-event#guild-scheduled-event-object

type GuildScheduledEventEntityMetadata

type GuildScheduledEventEntityMetadata struct {
	//Location of Event (1-100 characters)
	Location string `json:"location"`
}

GuildScheduledEventEntityMetadata is documented at https://discord.com/developers/docs/resources/guild-scheduled-event#guild-scheduled-event-object-guild-scheduled-event-entity-metadata

type GuildScheduledEventEntityType

type GuildScheduledEventEntityType int

GuildScheduledEventEntityType documented at https://discord.com/developers/docs/resources/guild-scheduled-event#guild-scheduled-event-object-guild-scheduled-event-entity-types

const (
	//GuildScheduledEventEntityTypeNone is an invalid GuildScheduledEventEntityType from Discord
	GuildScheduledEventEntityTypeNone GuildScheduledEventEntityType = iota
	//GuildScheduledEventEntityTypeStageInstance is an GuildScheduledEvent at a ChannelTypeGuildStageVoice
	GuildScheduledEventEntityTypeStageInstance
	//GuildScheduledEventEntityTypeVoice is a GuildScheduledEvent at a ChannelTypeGuildVoice
	GuildScheduledEventEntityTypeVoice
	//GuildScheduledEventEntityTypeExternal is a GuildScheduledEvent at a platform otherwise listed
	GuildScheduledEventEntityTypeExternal
)

func (GuildScheduledEventEntityType) IsValid

func (guildScheduledEventEntityType GuildScheduledEventEntityType) IsValid() bool

type GuildScheduledEventPrivacyLevel

type GuildScheduledEventPrivacyLevel uint8

GuildScheduledEventPrivacyLevel documented at https://discord.com/developers/docs/resources/guild-scheduled-event#guild-scheduled-event-object-guild-scheduled-event-privacy-level

const (
	//GuildScheduledEventPrivacyLevelGuildOnly is only accessible to GuildMember's
	GuildScheduledEventPrivacyLevelGuildOnly GuildScheduledEventPrivacyLevel = 2
)

func (GuildScheduledEventPrivacyLevel) IsValid

func (guildScheduledEventPrivacyLevel GuildScheduledEventPrivacyLevel) IsValid() bool

IsValid GuildScheduledEventPrivacyLevel

type GuildScheduledEventStatus

type GuildScheduledEventStatus uint8

GuildScheduledEventStatus documented at https://discord.com/developers/docs/resources/guild-scheduled-event#guild-scheduled-event-object-guild-scheduled-event-status

const (
	//GuildScheduledEventStatusNone is a zero value GuildScheduledEventStatus from Discord
	GuildScheduledEventStatusNone GuildScheduledEventStatus = iota
	//GuildScheduledEventStatusScheduled transitions to GuildScheduledEventStatusActive
	GuildScheduledEventStatusScheduled
	//GuildScheduledEventStatusActive transitions to GuildScheduledEventStatusCompleted
	GuildScheduledEventStatusActive
	//GuildScheduledEventStatusCompleted transitions to GuildScheduledEventStatusCanceled
	GuildScheduledEventStatusCompleted
	//GuildScheduledEventStatusCanceled is a canceled GuildScheduledEvent
	GuildScheduledEventStatusCanceled
)

func (GuildScheduledEventStatus) IsValid

func (guildScheduledEventStatus GuildScheduledEventStatus) IsValid() bool

IsValid GuildScheduledEventStatus

type Invite

type Invite struct {
	//Code for Invite
	Code string `json:"code"`
	//Guild Invite is for
	Guild Guild `json:"guild"`
	//Channel Invite is for
	Channel Channel `json:"channel"`
	//Inviter is the User that created the Invite
	Inviter User `json:"inviter"`
	//TargetType is the target type for a ChannelTypeGuildVoice Invite
	TargetType InviteTargetType `json:"target_type"`
	//TargetUser is the User whose Stream to display for a ChannelTypeGuildVoice Invite
	TargetUser User `json:"target_user"`
	//TargetApplication is the EmbeddedApplication to open for a ChannelTypeGuildVoice embedded application Invite
	TargetApplication Application `json:"target_application"`
	//ApproximatePresenceCount of online members
	ApproximatePresenceCount int `json:"approximate_presence_count"`
	//ApproximateMemberCount of total members
	ApproximateMemberCount int `json:"approximate_member_count"`
	//ExpiresAt date
	ExpiresAt time.Time `json:"expires_at"`
	//StageInstance data if there is a public StageInstance in the ChannelTypeGuildStageVoice this Invite is for
	StageInstance InviteStageInstance `json:"stage_instance"`
	//GuildScheduledEvent data if this is to a GuildScheduledEvent
	GuildScheduledEvent GuildScheduledEvent `json:"guild_scheduled_event"`
}

Invite documented at https://discord.com/developers/docs/resources/invite#invite-object

type InviteMetadata

type InviteMetadata struct {
	//Uses of Invite
	Uses int `json:"uses"`
	//MaxUses of Invite
	MaxUses int `json:"max_uses"`
	//MaxAge of Invite
	MaxAge int `json:"max_age"`
	//IsTemporary Invite that only grants temporary membership
	IsTemporary bool `json:"is_temporary"`
	//CreatedAt is when the Invite was created
	CreatedAt time.Time `json:"created_at"`
}

InviteMetadata documented at https://discord.com/developers/docs/resources/invite#invite-metadata-object

type InviteStageInstance

type InviteStageInstance struct {
	//Members speaking in the StageInstance
	Members []GuildMember `json:"members"`
	//ParticipantCount in the StageInstance
	ParticipantCount int `json:"participant_count"`
	//SpeakerCount in StageInstance
	SpeakerCount int `json:"speaker_count"`
	//Topic of StageInstance (1-120 characters)
	Topic string `json:"topic"`
}

InviteStageInstance documented at https://discord.com/developers/docs/resources/invite#invite-stage-instance-object-invite-stage-instance-structure

type InviteTargetType

type InviteTargetType int

InviteTargetType documented at https://discord.com/developers/docs/resources/invite#invite-object-invite-target-types

const (
	//InviteTargetTypeNil is an intentionally nil InviteTargetType to show it is not set
	InviteTargetTypeNil InviteTargetType = 0
	//InviteTargetTypeStream is an Invite to a Stream
	InviteTargetTypeStream InviteTargetType = 1
	//InviteTargetTypeEmbeddedApplication is an Invite to a EmbeddedApplication
	InviteTargetTypeEmbeddedApplication InviteTargetType = 2
)

func (InviteTargetType) IsValid

func (i InviteTargetType) IsValid() bool

IsValid InviteTargetType

type Message

type Message struct {
	ID                Snowflake        `json:"id"`
	ChannelID         Snowflake        `json:"channel_id"`
	GuildID           Snowflake        `json:"guild_id"`
	Author            User             `json:"author"`
	Member            GuildMember      `json:"member"`
	Content           string           `json:"content"`
	Timestamp         time.Time        `json:"timestamp"`
	EditedTimestamp   time.Time        `json:"edited_timestamp"`
	IsTextToSpeech    bool             `json:"tts"`
	IsMentionEveryone bool             `json:"mention_everyone"`
	Mentions          []User           `json:"mentions"`
	MentionRoles      []Role           `json:"mention_roles"`
	MentionChannels   []ChannelMention `json:"mention_channels"`
	Attachments       []Attachment     `json:"attachments"`
	Embeds            []Embed          `json:"embeds"`
	Reactions         []Reaction       `json:"reactions"`
	Nonce             string           `json:"nonce"`
	IsPinned          bool             `json:"pinned"`
	WebhookID         Snowflake        `json:"webhook_id"`
	Type              int              `json:"type"`
	Activity          MessageActivity  `json:"activity"`
	Application       Application      `json:"application"`
	ApplicationID     Snowflake        `json:"application_id"`
	MessageReference  MessageReference `json:"message_reference"`
	Flags             MessageFlag      `json:"flags"`
}

Message documented at https://discord.com/developers/docs/resources/channel#message-object

type MessageActivityType

type MessageActivityType int

MessageActivityType documented at https://discord.com/developers/docs/resources/channel#message-object-message-activity-types

const (
	//MessageActivityTypeNil is an intentionally Nil MessageActivityType
	MessageActivityTypeNil MessageActivityType = 0
	//MessageActivityTypeJoin is when an MessageActivity is a Join
	MessageActivityTypeJoin MessageActivityType = 1
	//MessageActivityTypeSpectate is when a MessageActivity is to Spectate
	MessageActivityTypeSpectate MessageActivityType = 2
	//MessageActivityTypeListen is when a MessageActivity is to Listen
	MessageActivityTypeListen MessageActivityType = 3
	//MessageActivityTypeJoinRequest is when a MessageActivity is a JoinRequest
	MessageActivityTypeJoinRequest MessageActivityType = 5
)

func (MessageActivityType) IsValid

func (m MessageActivityType) IsValid() bool

IsValid MessageActivityType

type MessageFlag

type MessageFlag uint16

MessageFlag documented at https://discord.com/developers/docs/resources/channel#message-object-message-flags

const (
	//MessageFlagNil is an intentionally 0 MessageFlag
	MessageFlagNil MessageFlag = 0
	//MessageFlagCrossPosted is when a Message has been published to subscribed Channel's
	MessageFlagCrossPosted MessageFlag = 1 << 0
	//MessageFlagIsCrossPost is when a Message originated from a subscribed Channel
	MessageFlagIsCrossPost MessageFlag = 1 << 1
	//MessageFlagSuppressEmbeds is when a Message should not include any Embed's when serializing this Message
	MessageFlagSuppressEmbeds MessageFlag = 1 << 2

	MessageFlagSourceMessageDeleted             MessageFlag = 1 << 3
	MessageFlagUrgent                           MessageFlag = 1 << 4
	MessageFlagHasThread                        MessageFlag = 1 << 5
	MessageFlagEphemeral                        MessageFlag = 1 << 6
	MessageFlagLoading                          MessageFlag = 1 << 7
	MessageFlagFailedToMentionSomeRolesInThread MessageFlag = 1 << 8
)

type MessageReference

type MessageReference struct {
	//MessageID of original Message
	MessageID Snowflake `json:"message_id"`
	//ChannelID where original Message is from
	ChannelID Snowflake `json:"channel_id"`
	//GuildID where original Message is from
	GuildID Snowflake `json:"guild_id"`
	//FailIfNotExists or send as normal non-reply
	FailIfNotExists bool `json:"fail_if_not_exists"`
}

MessageReference documented at https://discord.com/developers/docs/resources/channel#message-reference-object-message-reference-structure

type MessageType

type MessageType uint8

MessageType documented at https://discord.com/developers/docs/resources/channel#message-object-message-types

const (
	//MessageTypeDefault is the Default MessageType
	MessageTypeDefault MessageType = iota
	//MessageTypeRecipientAdd is the MessageType when a User is added to a Channel
	MessageTypeRecipientAdd
	//MessageTypeRecipientRemove is the MessageType when a User is removed from a Channel
	MessageTypeRecipientRemove
	//MessageTypeCall is when a MessageType is a Call
	MessageTypeCall
	//MessageTypeChannelNameChange is when a Channel Name is changed
	MessageTypeChannelNameChange
	//MessageTypeChannelIconChange is when a Channel Icon is changed
	MessageTypeChannelIconChange
	//MessageTypeChannelPinnedMessage is when a Channel message is changed
	MessageTypeChannelPinnedMessage
	//MessageTypeGuildMemberJoin is when a User is added to a channel
	MessageTypeGuildMemberJoin
	//MessageTypeUserPremiumGuildSubscription is when a GuildMember boosts a Guild
	MessageTypeUserPremiumGuildSubscription
	//MessageTypeUserPremiumGuildSubscriptionTier1 is when a Guild reaches PremiumTier1
	MessageTypeUserPremiumGuildSubscriptionTier1
	//MessageTypeUserPremiumGuildSubscriptionTier2 is when a Guild reaches PremiumTier2
	MessageTypeUserPremiumGuildSubscriptionTier2
	//MessageTypeUserPremiumGuildSubscriptionTier3 is when a Guild reaches PremiumTier3
	MessageTypeUserPremiumGuildSubscriptionTier3
	//MessageTypeChannelFollowAdd is when a User adds another ChannelTypeGuildNews to a Channel
	MessageTypeChannelFollowAdd
	//MessageTypeGuildDiscoveryGracePeriodInitialWarning is when a Guild is about to lose its spot in Guild Discovery
	MessageTypeGuildDiscoveryGracePeriodInitialWarning
	//MessageTypeGuildDiscoveryGracePeriodFinalWarning is when a Guild is imminent about to lose its spot in Guild Discovery
	MessageTypeGuildDiscoveryGracePeriodFinalWarning
	//MessageTypeThreadCreated is when a Thread has been created
	MessageTypeThreadCreated
	//MessageTypeReply is when a Message is a reply to another Message
	MessageTypeReply
	//MessageTypeChatInputCommand is when a message is a slash command? maybe? todo: what is this message type?
	MessageTypeChatInputCommand
	//MessageTypeThreadStarterMessage is the message that starts a Thread
	MessageTypeThreadStarterMessage
	//MessageTypeGuildInviteReminder is the message that a Guild should add an Invite
	MessageTypeGuildInviteReminder
	//MessageTypeContextMenuCommand is part of a slash command?
	MessageTypeContextMenuCommand
	//MessageTypeInvalid is an intentionally invalid MessageType
	MessageTypeInvalid MessageType = math.MaxUint8
)

func (MessageType) IsValid

func (messageType MessageType) IsValid() bool

IsValid MessageType

type Overwrite

type Overwrite struct {
	//ID of Role or User to Overwrite
	ID Snowflake `json:"id"`
	//Type of ID
	Type OverwriteIDType `json:"type"`
	//Allow is PermissionFlag for Overwrite to Allow a Permission
	Allow PermissionFlag `json:"allow,string"`
	//Deny is the PermissionFlag for Overwrite to Deny a Permission
	Deny PermissionFlag `json:"deny,string"`
}

Overwrite struct from https://discord.com/developers/docs/resources/channel#overwrite-object

type OverwriteIDType

type OverwriteIDType uint8

OverwriteIDType documented at https://discord.com/developers/docs/resources/channel#overwrite-object-overwrite-structure

const (
	//OverwriteIDTypeRole is a Role ID
	OverwriteIDTypeRole OverwriteIDType = iota
	//OverwriteIDTypeUser is a User ID
	OverwriteIDTypeUser
)

func (OverwriteIDType) IsValid

func (overwriteIDType OverwriteIDType) IsValid() bool

IsValid OverwriteIDType

type PermissionFlag

type PermissionFlag uint64

PermissionFlag documented at https://discord.com/developers/docs/topics/permissions#permissions Check PermissionFlag.IsValid() then PermissionFlag.HasPermission()

const (
	//PermissionFlagNil is the default PermissionFlag value
	PermissionFlagNil PermissionFlag = 0
	//PermissionFlagCreateInstantInvite allows instant invite creation in ChannelTypeGuildText, ChannelTypeGuildVoice, & ChannelTypeGuildStageVoice
	PermissionFlagCreateInstantInvite PermissionFlag = 1 << (iota - 1)
	//PermissionFlagKickMembers allows kicking GuildMember(s)
	PermissionFlagKickMembers
	//PermissionFlagBanMembers allows banning GuildMember(s)
	PermissionFlagBanMembers
	//PermissionFlagAdministrator allows all PermissionFlag(s) and bypasses all Overwrite(s)
	PermissionFlagAdministrator
	//PermissionFlagManageChannels allows management and editing of Channel types ChannelTypeGuildText, ChannelTypeGuildVoice, & ChannelTypeGuildStageVoice
	PermissionFlagManageChannels
	//PermissionFlagManageGuild allows management and editing of a Guild
	PermissionFlagManageGuild
	//PermissionFlagAddReactions allows adding Reaction(s) (an emoji) to a message in a ChannelTypeGuildText
	PermissionFlagAddReactions
	//PermissionFlagViewAuditLog allows viewing AuditLog
	PermissionFlagViewAuditLog
	//PermissionFlagPrioritySpeaker allows being a PrioritySpeaker in a ChannelTypeGuildVoice
	PermissionFlagPrioritySpeaker
	//PermissionFlagStream allows User to start a Stream in a ChannelTypeGuildVoice
	PermissionFlagStream
	//PermissionFlagViewChannel allows a User to view a Channel
	PermissionFlagViewChannel
	//PermissionFlagSendMessages allows a User to send messages in a ChannelTypeGuildText
	PermissionFlagSendMessages
	//PermissionFlagSendTTSMessage allows a User to send Text-To-Speech messages in a ChannelTypeGuildText
	PermissionFlagSendTTSMessage
	//PermissionFlagManageMessages allows a User to manage a ChannelTypeGuildText messages
	PermissionFlagManageMessages
	//PermissionFlagEmbedLinks makes links sent by User with this PermissionFlag to be embedded automatically
	PermissionFlagEmbedLinks
	//PermissionFlagAttachFiles allows a User to upload images and files
	PermissionFlagAttachFiles
	//PermissionFlagReadMessageHistory allows a User to read message history in a ChannelTypeGuildText
	PermissionFlagReadMessageHistory
	//PermissionFlagMentionEveryone allows a User use the @everyone, @here, and all @roles
	PermissionFlagMentionEveryone
	//PermissionFlagUseExternalEmojis allows a User to use Emoji(s) from another Guild
	PermissionFlagUseExternalEmojis
	//PermissionFlagViewGuildInsights allows a User to view Guild Insights
	PermissionFlagViewGuildInsights
	//PermissionFlagConnect allows a User to connect to a ChannelTypeGuildVoice and ChannelTypeGuildStageVoice
	PermissionFlagConnect
	//PermissionFlagSpeak allows a User to speak in a ChannelTypeGuildVoice
	PermissionFlagSpeak
	//PermissionFlagMuteMembers allows a User to mute another User in a ChannelTypeGuildVoice and ChannelTypeGuildStageVoice
	PermissionFlagMuteMembers
	//PermissionFlagDeafenMembers allows a User to deafen another User in a ChannelTypeGuildVoice and ChannelTypeGuildStageVoice
	PermissionFlagDeafenMembers
	//PermissionFlagMoveMembers allows a User to move another User to another ChannelTypeGuildVoice or ChannelTypeGuildStageVoice
	PermissionFlagMoveMembers
	//PermissionFlagUseVoiceActivityDetection allows a User to use VoiceActivity to show when they are speaking
	PermissionFlagUseVoiceActivityDetection
	//PermissionFlagChangeNickname allows a User to change their User.Nickname
	PermissionFlagChangeNickname
	//PermissionFlagManageNicknames allows a User to change others User.Nickname
	PermissionFlagManageNicknames
	//PermissionFlagManageRoles allows a User to manage Role(s)
	PermissionFlagManageRoles
	//PermissionFlagManageWebhooks allows a User to manage Webhooks in a ChannelTypeGuildText
	PermissionFlagManageWebhooks
	//PermissionFlagManageEmojisAndStickers allows a User to manage Emoji(s) and Sticker(s)
	PermissionFlagManageEmojisAndStickers
	//PermissionFlagUseApplicationCommands allows a User to use application commands (slash commands and context menus)
	PermissionFlagUseApplicationCommands
	//PermissionFlagRequestToSpeak allows a User to request to speak in a ChannelTypeGuildStageVoice
	PermissionFlagRequestToSpeak
	//PermissionFlagSkippedNotReal is a fake flag because discord skips 1<<33
	PermissionFlagSkippedNotReal
	//PermissionFlagManageThreads allows a User to manage Thread(s)
	PermissionFlagManageThreads
	//PermissionFlagCreatePublicThreads allows a User create public and announcement threads
	PermissionFlagCreatePublicThreads
	//PermissionFlagCreatePrivateThreads allows a User to create a private Thread
	PermissionFlagCreatePrivateThreads
	//PermissionFlagUseExternalStickers allows a User to use another Guild's Sticker(s)
	PermissionFlagUseExternalStickers
	//PermissionFlagSendMessageInThreads allows a User to send messages in a Thread
	PermissionFlagSendMessageInThreads
	//PermissionFlagStartEmbeddedActivities allows a User to launch Activities (applications with the Embedded flag) in a ChannelTypeGuildVoice
	PermissionFlagStartEmbeddedActivities
	//PermissionModerateMembers allows a User to timeout users
	PermissionModerateMembers
	//PermissionFlagALL is a ANDed of all valid PermissionFlag
	PermissionFlagALL PermissionFlag = (1 << (iota - 1)) - 1
)

func (PermissionFlag) Contains

func (permissionFlag PermissionFlag) Contains(flags PermissionFlag) bool

Contains another PermissionFlag

func (PermissionFlag) IsValid

func (permissionFlag PermissionFlag) IsValid() bool

IsValid PermissionFlag

type PremiumTier

type PremiumTier uint8

PremiumTier from https://discord.com/developers/docs/resources/guild#guild-object-premium-tier

const (
	//PremiumTier0 is no Server Boost's perks
	PremiumTier0 PremiumTier = iota
	//PremiumTier1 is Server Boost level 1 perks
	PremiumTier1
	//PremiumTier2 is Server Boost level 2 perks
	PremiumTier2
	//PremiumTier3 is Server Boost level 3 perks
	PremiumTier3
)

func (PremiumTier) IsValid

func (premiumTier PremiumTier) IsValid() bool

IsValid PremiumTier

type PremiumType

type PremiumType uint8

PremiumType documented at https://discord.com/developers/docs/resources/user#user-object-premium-types

const (
	//PremiumTypeNil is a User without a Nitro subscription
	PremiumTypeNil PremiumType = iota
	//PremiumTypeNitroClassic is a User with a Classic Nitro subscription
	PremiumTypeNitroClassic
	//PremiumTypeNitro is a User with a Nitro subscription
	PremiumTypeNitro
)

func (PremiumType) IsValid

func (premiumType PremiumType) IsValid() bool

IsValid PremiumType

type PresenceStatus

type PresenceStatus string

PresenceStatus documented at https://discord.com/developers/docs/topics/gateway#update-presence-status-types

const (
	//PresenceStatusNil is a Nil Presence Status
	PresenceStatusNil PresenceStatus = ""
	//PresenceStatusIdle of PresenceUpdate.Status
	PresenceStatusIdle PresenceStatus = "idle"
	//PresenceStatusDnd of PresenceUpdate.Status
	PresenceStatusDnd PresenceStatus = "dnd"
	//PresenceStatusOnline of PresenceUpdate.Status
	PresenceStatusOnline PresenceStatus = "online"
	//PresenceStatusOffline of PresenceUpdate.Status
	PresenceStatusOffline PresenceStatus = "offline"
)

Const list of PresenceStatus possibilities

func (PresenceStatus) IsValid

func (status PresenceStatus) IsValid() bool

IsValid PresenceStatus

type PresenceUpdate

type PresenceUpdate struct {
	//User presence is being updated for
	User User `json:"user"`
	//GuildID where PresenceUpdate is for
	GuildID Snowflake `json:"guild_id,string"`
	//Status that is being updated
	Status PresenceStatus `json:"status"`
	//Activities of User
	Activities []Activity `json:"activities"`
	//ClientStatus of User, platform-dependent
	ClientStatus ClientStatus `json:"client_status"`
}

PresenceUpdate struct documented at https://discord.com/developers/docs/topics/gateway#presence-update

type PrivacyLevel

type PrivacyLevel int8

PrivacyLevel documented at https://discord.com/developers/docs/resources/stage-instance#stage-instance-object-privacy-level

const (
	PrivacyLevelNil PrivacyLevel = iota
	PrivacyLevelPublic
	PrivacyLevelGuildOnly
)

func (PrivacyLevel) IsValid

func (privacyLevel PrivacyLevel) IsValid() bool

IsValid PrivacyLevel

type Reaction

type Reaction struct {
	//Count of times Emoji has been used
	Count int `json:"count"`
	//IsMe who reacted
	IsMe bool `json:"me"`
	//Emoji information for Reaction
	Emoji Emoji `json:"emoji"`
}

Reaction is documented at https://discord.com/developers/docs/resources/channel#reaction-object

type Role

type Role struct {
	//ID of Role
	ID Snowflake `json:"id,string"`
	//Name of Role
	Name string `json:"name"`
	//Color of Role
	Color int `json:"color"`
	//IsHoist aka pinned in GuildMember list on client
	IsHoist bool `json:"hoist"`
	//IconHash is the Role's IconHash for grabbing from CDN
	IconHash ImageHash `json:"icon"`
	//UnicodeEmoji equivalent
	UnicodeEmoji string `json:"unicode_emoji"`
	//Position of Role
	Position int `json:"position"`
	//Permissions for Role as a PermissionsBitSet
	Permissions PermissionFlag `json:"permissions,string"`
	//IsManaged by integration?
	IsManaged bool `json:"managed"`
	//IsMentionable Emoji?
	Mentionable bool `json:"mentionable"`
	//Tag for role
	Tag RoleTag `json:"tags"`
}

Role struct from https://discord.com/developers/docs/topics/permissions#role-object

type RoleTag

type RoleTag struct {
	//BotID that owns this Role
	BotID Snowflake `json:"bot_id"`
	//IntegrationID that this Role belongs to
	IntegrationID Snowflake `json:"integration_id"`
	//IsPremiumSubscriber Role aka booster Role
	IsPremiumSubscriber bool `json:"premium_subscriber"`
}

RoleTag struct from https://discord.com/developers/docs/topics/permissions#role-object-role-tags-structure

type ShardInformation

type ShardInformation []int

ShardInformation https://discord.com/developers/docs/topics/gateway#sharding

func (ShardInformation) Count

func (s ShardInformation) Count() int

Count of Shard(s) Bot should use

func (ShardInformation) ID

func (s ShardInformation) ID() int

ID of Shard

type Snowflake

type Snowflake uint64 //todo: helper methods

Snowflake documented at https://discord.com/developers/docs/reference#snowflakes

func (Snowflake) Increment

func (snowflake Snowflake) Increment() uint16

Increment (ed) for every ID generated on InternalProcessID

func (Snowflake) InternalProcessID

func (snowflake Snowflake) InternalProcessID() uint8

InternalProcessID used by Discord

func (Snowflake) InternalWorkerID

func (snowflake Snowflake) InternalWorkerID() uint8

InternalWorkerID used by Discord

func (Snowflake) IsValid

func (snowflake Snowflake) IsValid() bool

IsValid Snowflake

func (Snowflake) Timestamp

func (snowflake Snowflake) Timestamp() time.Time

Timestamp of Snowflake as a time.Time UTC

func (*Snowflake) UnmarshalJSON

func (snowflake *Snowflake) UnmarshalJSON(data []byte) error

type StageInstance

type StageInstance struct {
	//ID of StageInstance
	ID Snowflake `json:"id"`
	//GuildID of StageInstance
	GuildID Snowflake `json:"guild_id"`
	//ChannelID of StageInstance
	ChannelID Snowflake `json:"channel_id"`
	//Topic of StageInstance
	Topic string `json:"topic"`
	//PrivacyLevel of StageInstance
	PrivacyLevel PrivacyLevel `json:"privacy_level"`
	//IsDiscoverableDisabled aka stage discovery
	IsDiscoverableDisabled bool `json:"discoverable_disabled"`
}

StageInstance struct from json, documented at https://discord.com/developers/docs/resources/stage-instance#stage-instance-object

type Sticker

type Sticker struct {
	//ID of Sticker
	ID Snowflake `json:"id"`
	//PackID of Sticker, if a standard sticker
	PackID Snowflake `json:"pack_id"`
	//Name of Sticker
	Name string `json:"name"`
	//Description of Sticker
	Description string `json:"description"`
	//Tags for Autocomplete when searching for Sticker (max 200 characters)
	Tags string `json:"tags"`
	//Asset Deprecated, previously an Asset hash, now just empty
	Asset string `json:"asset"`
	//Type of Sticker
	Type StickerType `json:"type"`
	//FormatType of Sticker
	FormatType StickerFormatType `json:"format_type"`
	//IsAvailable false if fell below required PremiumTier
	IsAvailable bool `json:"is_available"`
	//GuildID of Guild this Sticker was uploaded to
	GuildID Snowflake `json:"guild_id"`
	//User that uploaded this Sticker
	User User `json:"user"`
	//SortValue this Sticker is in within its pack
	SortValue int `json:"sort_value"`
}

Sticker struct from json, documented at https://discord.com/developers/docs/resources/sticker#sticker-object

type StickerFormatType

type StickerFormatType uint8

StickerFormatType documented at https://discord.com/developers/docs/resources/sticker#sticker-object-sticker-format-types

const (
	//StickerFormatTypeNil is the default StickerFormatType
	StickerFormatTypeNil StickerFormatType = iota
	//StickerFormatTypePNG is a PNG format
	StickerFormatTypePNG
	//StickerFormatTypeAPNG is a APNG format
	StickerFormatTypeAPNG
	//StickerFormatTypeLOTTIE is a LOTTIE format
	StickerFormatTypeLOTTIE
)

func (StickerFormatType) IsValid

func (stickerFormatType StickerFormatType) IsValid() bool

type StickerType

type StickerType uint8

StickerType documented at https://discord.com/developers/docs/resources/sticker#sticker-object-sticker-types

const (
	//StickerTypeNil is a zero-value StickerType
	StickerTypeNil StickerType = iota
	//StickerTypeStandard is a Discord-set Sticker in a pack
	StickerTypeStandard
	//StickerTypeGuild is a Sticker uploaded by a User to a Guild
	StickerTypeGuild
)

func (StickerType) IsValid

func (stickerType StickerType) IsValid() bool

IsValid StickerType

type SystemChannelFlag

type SystemChannelFlag uint8

SystemChannelFlag (bitwise, potential combination of flags) from https://discord.com/developers/docs/resources/guild#guild-object-system-channel-flags

const (
	//SystemChannelFlagNil is a default Nil SystemChannelFlag
	SystemChannelFlagNil SystemChannelFlag = 0
	//SystemChannelFlagSuppressJoinNotifications SystemChannelFlag to suppress member join notifications
	SystemChannelFlagSuppressJoinNotifications SystemChannelFlag = 1 << (iota - 1)
	//SystemChannelFlagPremiumSubscriptions SystemChannelFlag to suppress guild boost notifications
	SystemChannelFlagPremiumSubscriptions
	//SystemChannelFlagSuppressGuildReminderNotifications SystemChannelFlag to suppress guild setup tips
	SystemChannelFlagSuppressGuildReminderNotifications
	//SystemChannelFlagALL ANDed bitmask of all SystemChannelFlag(s)
	SystemChannelFlagALL SystemChannelFlag = (1 << (iota - 1)) - 1
)

func (SystemChannelFlag) Contains

func (systemChannelFlag SystemChannelFlag) Contains(flags SystemChannelFlag) bool

Contains a SystemChannelFlag

func (SystemChannelFlag) IsValid

func (systemChannelFlag SystemChannelFlag) IsValid() bool

IsValid SystemChannelFlag

type Team

type Team struct {
	//IconHash of Team Icon
	IconHash ImageHash `json:"icon"`
	//ID of Team
	ID Snowflake `json:"id,string"`
	//Members of Team
	Members []TeamMember `json:"members"`
	//Name of Team
	Name string `json:"name"`
	//OwnerID of Team
	OwnerID Snowflake `json:"owner_id,string"`
}

Team documented at https://discord.com/developers/docs/topics/teams#data-models-team-object

type TeamMember

type TeamMember struct {
	//MembershipState on Team
	MembershipState TeamMembershipState `json:"membership_state"`
	//Permissions of TeamMember; always "*"
	Permissions []string `json:"permissions"`
	//TeamID TeamMember is a part of
	TeamID Snowflake `json:"team_id,string"`
	//User this TeamMember is from (with discriminator, flags, id, and username fields filled)
	User User `json:"user"`
}

TeamMember documented at https://discord.com/developers/docs/topics/teams#data-models-team-member-object

type TeamMembershipState

type TeamMembershipState uint8

TeamMembershipState documented at https://discord.com/developers/docs/topics/teams#data-models-membership-state-enum

const (
	//TeamMembershipStateInvalid is a zero-value from Discord (should never be this)
	TeamMembershipStateInvalid TeamMembershipState = iota
	//TeamMembershipStateInvited is a Member in a valid invite state
	TeamMembershipStateInvited
	//TeamMembershipStateAccepted is a Member who accepted the Membership
	TeamMembershipStateAccepted
)

func (TeamMembershipState) IsValid

func (teamMembershipState TeamMembershipState) IsValid() bool

IsValid TeamMembershipState

type ThreadMember

type ThreadMember struct {
	//ID of Thread; only sent in GUILD_CREATE event
	ID Snowflake `json:"id"`
	//UserID of User; only sent in GUILD_CREATE event
	UserID Snowflake `json:"user_id"`
	//JoinTimeStamp when User last joined Thread
	JoinTimeStamp Snowflake `json:"join_time_stamp"`
	//Flags for user-thread settings, currently only for notifications
	Flags MessageType `json:"flags"` //todo: find where this is documented, can't find the value possibilities; assuming MessageType
}

ThreadMember struct from https://discord.com/developers/docs/resources/channel#thread-member-object

type ThreadMetadata

type ThreadMetadata struct {
	//IsArchived Thread
	IsArchived bool `json:"archived"`
	//AutoArchiveDuration in minutes (possible values are: 60, 1440, 4320, 10080)
	AutoArchiveDuration int `json:"auto_archive_duration"`
	//ArchiveTimestamp is when Thread archive status was last set
	ArchiveTimestamp time.Time `json:"archive_timestamp"`
	//IsLocked Thread
	IsLocked bool `json:"locked"`
	//IsInvitable by non-moderators
	IsInvitable bool `json:"invitable"`
}

ThreadMetadata struct from https://discord.com/developers/docs/resources/channel#thread-metadata-object

type UnavailableGuild

type UnavailableGuild struct {
	//ID of UnavailableGuild
	ID Snowflake `json:"id"`
	//IsUnavailable Guild, should always be true
	IsUnavailable bool `json:"unavailable"`
}

UnavailableGuild documented at https://discord.com/developers/docs/resources/guild#unavailable-guild-object

type User

type User struct {
	//ID of User
	ID Snowflake `json:"id,string"`
	//Username of User, not unique
	Username string `json:"username"`
	//Discriminator of User, 4 suffix digits
	Discriminator string `json:"discriminator"`
	//AvatarHash of User
	AvatarHash ImageHash `json:"avatar"`
	//IsBot User
	IsBot bool `json:"bot"`
	//IsSystemUser maintained by Discord for official communications
	IsSystemUser bool `json:"system"`
	//MFAEnabled is if a User has MultiFactorAuthenticated enabled
	MFAEnabled bool `json:"mfa_enabled"`
	//BannerHash of User
	BannerHash ImageHash `json:"banner"`
	//BannerAccentColor of User as a hexadecimal color code todo: maybe helper function or custom parse for a "color" package color
	BannerAccentColor int `json:"accent_color"`
	//Locale of User
	Locale string `json:"locale"`
	//IsVerified account (by email)
	IsVerified bool `json:"is_verified"`
	//Email of User
	Email string `json:"email"`
	//Flags for User (ex: Discord Employee, Early Supporter)
	Flags UserFlag `json:"flags"`
	//PremiumType of User (aka nitro type)
	PremiumType PremiumType `json:"premium_type"`
	//PublicFlags seen by all User(s)
	PublicFlags UserFlag `json:"public_flags"`
}

User struct from https://discord.com/developers/docs/resources/user#user-object

type UserFlag

type UserFlag uint32

UserFlag documented at https://discord.com/developers/docs/resources/user#user-object-user-flags

const (
	//UserFlagNil is a User without any UserFlag(s)
	UserFlagNil UserFlag = 0
	//UserFlagDiscordEmployee is a Discord Employee
	UserFlagDiscordEmployee UserFlag = 1 << 0
	//UserFlagPartneredServerOwner is a Partnered Server Owner
	UserFlagPartneredServerOwner UserFlag = 1 << 1
	//UserFlagHypeSquadEvents is a HypeSquad Event coordinator
	UserFlagHypeSquadEvents UserFlag = 1 << 2
	//UserFlagBugHunterLevel1 is a Level 1 Bug Hunter
	UserFlagBugHunterLevel1 UserFlag = 1 << 3
	//UserFlagHouseBravery is a User that is part of House Bravery
	UserFlagHouseBravery UserFlag = 1 << 6
	//UserFlagHouseBrilliance is a User that is part of House Brilliance
	UserFlagHouseBrilliance UserFlag = 1 << 7
	//UserFlagHouseBalance is a User that is part of House Balance
	UserFlagHouseBalance UserFlag = 1 << 8
	//UserFlagEarlySupporter is an Early Nitro Supporter
	UserFlagEarlySupporter UserFlag = 1 << 9
	//UserFlagTeamUser is a bot team user? todo: don't actually know about this
	UserFlagTeamUser UserFlag = 1 << 10
	//UserFlagBugHunterLevel2 is Level 2 Bug Hunter
	UserFlagBugHunterLevel2 UserFlag = 1 << 14
	//UserFlagVerifiedBot is a Bot that has gone through the Verification process
	UserFlagVerifiedBot UserFlag = 1 << 16
	//UserFlagEarlyVerifiedBotDeveloper is a User who owns a Bot that has gone through the Verification Process when it just came out
	UserFlagEarlyVerifiedBotDeveloper UserFlag = 1 << 17
	//UserFlagDiscordCertifiedModerator is a User who has gone through the discord moderator academy and been active in the moderator Guild
	UserFlagDiscordCertifiedModerator UserFlag = 1 << 18
	//UserFlagAll is a UserFlag of all flags apart from UserFlagNil ANDed together
	UserFlagAll = UserFlagDiscordEmployee | UserFlagPartneredServerOwner | UserFlagHypeSquadEvents | UserFlagBugHunterLevel1 | UserFlagHouseBravery | UserFlagHouseBrilliance | UserFlagHouseBalance | UserFlagEarlySupporter | UserFlagTeamUser | UserFlagBugHunterLevel2 | UserFlagVerifiedBot | UserFlagEarlyVerifiedBotDeveloper | UserFlagDiscordCertifiedModerator
)

func (UserFlag) Contains

func (userFlag UserFlag) Contains(flags UserFlag) bool

Contains another UserFlag

func (UserFlag) IsValid

func (userFlag UserFlag) IsValid() bool

IsValid UserFlag

type VoiceQualityMode

type VoiceQualityMode uint8

VoiceQualityMode struct from https://discord.com/developers/docs/resources/channel#channel-object-video-quality-modes

const (
	//VoiceQualityModeInvalid is an invalid VoiceQualityMode
	VoiceQualityModeInvalid VoiceQualityMode = iota
	//VoiceQualityModeAuto is where VoiceQualityMode is automatically chosen by Discord
	VoiceQualityModeAuto
	//VoiceQualityModeFull is 720p
	VoiceQualityModeFull
)

func (VoiceQualityMode) IsValid

func (voiceQualityMode VoiceQualityMode) IsValid() bool

IsValid VoiceQualityMode

type VoiceRegion

type VoiceRegion struct {
	//ID of VoiceRegion
	ID string `json:"id"`
	//Name of VoiceRegion
	Name string `json:"name"`
	//IsOptimal VoiceRegion, in terms of distance for Bot
	IsOptimal bool `json:"optimal"`
	//IsDeprecated VoiceRegion
	IsDeprecated bool `json:"deprecated"`
	//IsCustom VoiceRegion
	IsCustom bool `json:"custom"`
}

VoiceRegion struct from https://discord.com/developers/docs/resources/voice#voice-region-object

type VoiceState

type VoiceState struct {
	//GuildID this VoiceState is from
	GuildID Snowflake `json:"guild_id,string"`
	//ChannelID this VoiceState is from
	ChannelID Snowflake `json:"channel_id,string"`
	//UserID this VoiceState is for
	UserID Snowflake `json:"user_id,string"`
	//GuildMember this VoiceState is for; only filled on GUILD_CREATE Event
	GuildMember GuildMember `json:"member"`
	//SessionID for VoiceState
	SessionID string `json:"session_id"`
	//IsDeafened by Guild
	IsDeafened bool `json:"deaf"`
	//IsMuted by Guild
	IsMuted bool `json:"mute"`
	//IsSelfDeafened by UserID
	IsSelfDeafened bool `json:"self_deaf"`
	//IsSelfMuted by UserID
	IsSelfMuted bool `json:"self_mute"`
	//IsSelfStreaming using "Go Live"
	IsSelfStreaming bool `json:"self_stream"`
	//IsSuppressed by Bot
	IsSuppressed bool `json:"suppress"`
	//RequestToSpeakTimestamp is when a UserID requested to speak
	RequestToSpeakTimestamp time.Time `json:"request_to_speak_timestamp"`
}

VoiceState struct from https://discord.com/developers/docs/resources/voice#voice-state-object

Jump to

Keyboard shortcuts

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