primitives

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2021 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

This section is empty.

Functions

func GetGatewayURI

func GetGatewayURI() (url.URL, error)

GetGatewayURI returns the current Discord Gateway WSS URL //todo: make it so test doesn't have to hit server

Types

type Activity

type Activity struct {
	//Name of Activity
	Name string `json:"name"`
	//Type of Activity
	Type ActivityType `json:"type"`
	//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"`
	//Flags of Activity ORed together
	Flags ActivityFlag `json:"flags"`
	//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 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"`
	//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"`
	//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"`
	//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"`
	//ApplicationID if group DM is bot-created
	ApplicationID Snowflake `json:"application_id"`
	//ParentID for a Guild Channel: category, Thread: Channel where created
	ParentID Snowflake `json:"parent_id"`
	//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 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
	IsDesktop bool `json:"desktop"`
	//IsMobile application session
	IsMobile bool `json:"mobile"`
	//IsWeb or Bot application session
	IsWeb bool `json:"web"`
}

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

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

type GatewayEventHello

type GatewayEventHello struct {
}

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

func (GatewayEventHello) Type

func (discordGatewayHelloEvent GatewayEventHello) Type() GatewayEventType

type GatewayEventMessageCreate

type GatewayEventMessageCreate struct {
	//ID of Message
	ID Snowflake `json:"id"`
	//ChannelID Message was sent in
	ChannelID Snowflake `json:"channel_id"`
	//GuildID Message was sent in
	GuildID Snowflake `json:"guild_id"`
	//Author of Message
	Author User `json:"author"`
	//todo: rest
	//Content of Message
	Content string `json:"content"`
}

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

func (GatewayEventMessageCreate) Type

func (messageCreateEvent GatewayEventMessageCreate) Type() GatewayEventType

type GatewayEventType

type GatewayEventType int

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 = iota
	//GatewayEventTypeReady contains initial state information; documented at https://discord.com/developers/docs/topics/gateway#ready
	GatewayEventTypeReady
	//GatewayEventTypeResumed is the response to a Resume Gateway command
	GatewayEventTypeResumed
	//GatewayEventTypeReconnect is Gateway instructed Client to reconnect and send a Resume
	GatewayEventTypeReconnect
	//GatewayEventTypeInvalidSession is a failure response to a Gateway Identity or a Resume
	GatewayEventTypeInvalidSession
	//GatewayEventTypeChannelCreate is a creation of a Channel
	GatewayEventTypeChannelCreate
	//GatewayEventTypeChannelUpdate is an update of a Channel
	GatewayEventTypeChannelUpdate
	//GatewayEventTypeChannelDelete is a deletion of a Channel
	GatewayEventTypeChannelDelete
	//GatewayEventTypeChannelPinsUpdate is the update of a Channel's pins
	GatewayEventTypeChannelPinsUpdate
	//GatewayEventTypeThreadCreate is the creation of Thread
	GatewayEventTypeThreadCreate
	//GatewayEventTypeThreadUpdate is the update of a Thread
	GatewayEventTypeThreadUpdate
	//GatewayEventTypeThreadDelete is the deletion of a Thread
	GatewayEventTypeThreadDelete
	//GatewayEventTypeThreadListSync is sent when gaining access to a Channel, contains all active Thread(s) in that Channel
	GatewayEventTypeThreadListSync
	//GatewayEventTypeThreadMemberUpdate ThreadMember for bot was updated
	GatewayEventTypeThreadMemberUpdate
	//GatewayEventTypeThreadMembersUpdate multiple ThreadMember(s) were added or removed from a thread
	GatewayEventTypeThreadMembersUpdate
	//GatewayEventTypeGuildCreate lazy-load for unavailable Guild, Guild became available, or User joined a new Guild
	GatewayEventTypeGuildCreate
	//GatewayEventTypeGuildUpdate is the update of a Guild
	GatewayEventTypeGuildUpdate
	//GatewayEventTypeGuildDelete is when a Guild became unavailable, or Bot left/was removed from Guild
	GatewayEventTypeGuildDelete
	//GatewayEventTypeGuildBanAdd is when a User is banned from a Guild
	GatewayEventTypeGuildBanAdd
	//GatewayEventTypeGuildBanRemove is when a User was unbanned from a Guild
	GatewayEventTypeGuildBanRemove
	//GatewayEventTypeGuildEmojisUpdate is a change in Emoji(s) in a Guild
	GatewayEventTypeGuildEmojisUpdate
	//GatewayEventTypeGuildStickersUpdate is a change in Sticker(s) in a Guild
	GatewayEventTypeGuildStickersUpdate
	//GatewayEventTypeGuildIntegrationsUpdate is a change in an Integration(s) in a guild
	GatewayEventTypeGuildIntegrationsUpdate
	//GatewayEventTypeGuildMemberAdd is when a new User joins a Guild
	GatewayEventTypeGuildMemberAdd
	//GatewayEventTypeGuildMemberRemove is when a User leaves or is removed from a Guild
	GatewayEventTypeGuildMemberRemove
	//GatewayEventTypeGuildMemberUpdate is when a GuildMember was updated
	GatewayEventTypeGuildMemberUpdate
	//GatewayEventTypeGuildMembersChunk is a response to a RequestGuildMembers (https://discord.com/developers/docs/topics/gateway#request-guild-members)
	GatewayEventTypeGuildMembersChunk
	//GatewayEventTypeGuildRoleCreate is when a Role is created in a Guild
	GatewayEventTypeGuildRoleCreate
	//GatewayEventTypeGuildRoleUpdate is when a Role is updated in a Guild
	GatewayEventTypeGuildRoleUpdate
	//GatewayEventTypeGuildRoleDelete is when a Role is deleted in a Guild
	GatewayEventTypeGuildRoleDelete
	//GatewayEventTypeGuildIntegrationCreate is when a Guild Integration was created
	GatewayEventTypeGuildIntegrationCreate
	//GatewayEventTypeGuildIntegrationUpdate is when a Guild Integration was updated
	GatewayEventTypeGuildIntegrationUpdate
	//GatewayEventTypeGuildIntegrationDelete is when a Guild Integration was deleted
	GatewayEventTypeGuildIntegrationDelete
	//GatewayEventTypeGuildInteractionCreate is when a User uses an Interaction (like application commands, https://discord.com/developers/docs/interactions/application-commands)
	GatewayEventTypeGuildInteractionCreate
	//GatewayEventTypeInviteCreate is when an Invite to a channel was created
	GatewayEventTypeInviteCreate
	//GatewayEventTypeInviteDelete is when an Invite to a channel was deleted
	GatewayEventTypeInviteDelete
	//GatewayEventTypeMessageCreate documented at https://discord.com/developers/docs/topics/gateway#message-create
	GatewayEventTypeMessageCreate
	//GatewayEventTypeMessageUpdate is when a Message was edited
	GatewayEventTypeMessageUpdate
	//GatewayEventTypeMessageDelete is when a Message was deleted
	GatewayEventTypeMessageDelete
	//GatewayEventTypeMessageDeleteBulk is when multiple Messages were deleted
	GatewayEventTypeMessageDeleteBulk
	//GatewayEventTypeMessageReactionAdd is when a User reacts to a Message
	GatewayEventTypeMessageReactionAdd
	//GatewayEventTypeMessageReactionRemove is when a User removed a reaction from a Message
	GatewayEventTypeMessageReactionRemove
	//GatewayEventTypeMessageReactionRemoveAll is when all reactions were removed from a Message
	GatewayEventTypeMessageReactionRemoveAll
	//GatewayEventTypeMessageReactionRemoveEmoji is when all reactions for a specific Emoji was removed from a Message
	GatewayEventTypeMessageReactionRemoveEmoji
	//GatewayEventTypePresenceUpdate is when a Presence for a User was updated
	GatewayEventTypePresenceUpdate
	//GatewayEventTypeStageInstanceCreate is when a ChannelTypeGuildStageVoice was created in a Guild
	GatewayEventTypeStageInstanceCreate
	//GatewayEventTypeStageInstanceDelete is when a ChannelTypeGuildStageVoice was deleted in a Guild
	GatewayEventTypeStageInstanceDelete
	//GatewayEventTypeStageInstanceUpdate is when a ChannelTypeGuildStageVoice was updated in a Guild
	GatewayEventTypeStageInstanceUpdate
	//GatewayEventTypeTypingStart is when a User has started typing in a Channel
	GatewayEventTypeTypingStart
	//GatewayEventTypeUserUpdate is when a User's properties have been updated
	GatewayEventTypeUserUpdate
	//GatewayEventTypeVoiceStateUpdate is when a User has joined, left, or moved Voice Channel(s); VoiceState
	GatewayEventTypeVoiceStateUpdate
	//GatewayEventTypeVoiceServerUpdate is when a Guild's ChannelTypeGuildVoice has changed Endpoints
	GatewayEventTypeVoiceServerUpdate
	//GatewayEventTypeWebhooksUpdate is when a Guild's Channel's Webhook was created, updated, or deleted
	GatewayEventTypeWebhooksUpdate
)

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

const (
	//GatewayOpcodeDispatch is received by a Client for a dispatched GatewayEvent
	GatewayOpcodeDispatch GatewayOpcode = iota
	//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 + 1
	//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
	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,string"`
	//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"`
}

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

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 a Thread
	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
	//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 (
	PremiumTier1 PremiumTier = iota + 1
	PremiumTier2
	PremiumTier3
)

todo: fill documentation and IsValid

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"`
	//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 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"`
	//Tags for role
	Tags []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,string"`
	//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 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

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 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 User

type User struct {
	//ID of User
	ID Snowflake `json:"id"`
	//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