discord

package
v0.0.0-...-9e75793 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2024 License: MIT Imports: 7 Imported by: 8

Documentation

Index

Constants

View Source
const (
	EmbedDefault    = 0x000000
	EmbedWhite      = 0xffffff
	EmbedAqua       = 0x1abc9c
	EmbedGreen      = 0x2ecc71
	EmbedBlue       = 0x3498db
	EmbedYellow     = 0xffff00
	EmbedPurple     = 0x9b59b6
	EmbedGold       = 0xf1c40f
	EmbedOrange     = 0xe67e22
	EmbedRed        = 0xe74c3c
	EmbedGrey       = 0x95a5a6
	EmbedDarkAqua   = 0x11806a
	EmbedDarkGreen  = 0x1f8b4c
	EmbedDarkBlue   = 0x206694
	EmbedDarkPurple = 0x71368a
	EmbedDarkGold   = 0xc27c0e
	EmbedDarkOrange = 0xa84300
	EmbedDarkRed    = 0x992d22
	EmbedDarkGrey   = 0x979c9f
	EmbedBlurple    = 0x7289da
	EmbedDark       = 0x2c2f33
)
View Source
const (
	ApplicationCommandChat = iota + 1 // slash command
	ApplicationCommandUser
	ApplicationCommandMessage
)
View Source
const (
	ApplicationCommandOptionSubCommand = iota + 1
	ApplicationCommandOptionSubCommandGroup
	ApplicationCommandOptionString
	ApplicationCommandOptionInteger
	ApplicationCommandOptionBoolean
	ApplicationCommandOptionUser
	ApplicationCommandOptionChannel
	ApplicationCommandOptionRole
	ApplicationCommandOptionMentionable
	ApplicationCommandOptionNumber
	ApplicationCommandOptionAttachment
)
View Source
const (
	InteractionTypePing = iota + 1
	InteractionTypeApplicationCommand
	InteractionTypeMessageComponent
	InteractionTypeApplicationCommandAutocomplete
	InteractionTypeModalSubmit
)
View Source
const (
	InteractionCallbackTypePong                                 = 1 // ack a ping
	InteractionCallbackTypeChannelWithSource                    = 4 // respond to an rawInteraction with a message
	InteractionCallbackTypeDeferredChannelMessageWithSource     = 5 // ACK an rawInteraction and edit a response later, the user sees a loading state
	InteractionCallbackTypeDeferredUpdateMessage                = 6 // for components, ACK an rawInteraction and edit the original message later; the user does not see a loading state
	InteractionCallbackTypeUpdateMessage                        = 7 // for components, edit the message the component was attached to
	InteractionCallbackTypeApplicationCommandAutocompleteResult = 8 // for autocomplete, return the results of the autocomplete
	InteractionCallbackTypeModal                                = 9 // respond to an rawInteraction with a popup modal
)

Variables

This section is empty.

Functions

func FormatImage

func FormatImage(data []byte) string

Types

type ActionRows

type ActionRows struct {
	Type       ComponentType      `json:"type"`       // 1 for an action rows
	Components []MessageComponent `json:"components"` // Can contain only one type of component
}

func (ActionRows) MarshalJSON

func (r ActionRows) MarshalJSON() ([]byte, error)

func (ActionRows) UnmarshalJSON

func (r ActionRows) UnmarshalJSON(data []byte) error

type Activity

type Activity struct {
	Name          string              `json:"name"`
	Type          ActivityType        `json:"type"`
	Url           string              `json:"url,omitempty"`
	CreatedAt     int                 `json:"created_at"`
	Timestamps    *ActivityTimestamps `json:"timestamps,omitempty"`
	ApplicationId string              `json:"application_id,omitempty"`
	Details       string              `json:"details,omitempty"`
	State         string              `json:"state,omitempty"`
	Emojis        []*ActivityEmoji    `json:"emojis,omitempty"`
	Party         *ActivityParty      `json:"party,omitempty"`
	Assets        *ActivityAssets     `json:"assets,omitempty"`
	Secrets       *ActivitySecrets    `json:"secrets,omitempty"`
	Instance      bool                `json:"instance,omitempty"`
	Flags         ActivityFlag        `json:"flags,omitempty"`
	Buttons       []*ActivityButton   `json:"buttons,omitempty"`
}

type ActivityAssets

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

type ActivityButton

type ActivityButton struct {
	Label string `json:"label"`
	URL   string `json:"url"`
}

type ActivityEmoji

type ActivityEmoji struct {
	Name     string `json:"name"`
	Id       string `json:"id,omitempty"`
	Animated bool   `json:"animated,omitempty"`
}

type ActivityFlag

type ActivityFlag int
const (
	ActivityFlagInstance ActivityFlag = 1 << iota
	ActivityFlagJoin
	ActivityFlagSpectate
	ActivityFlagJoinRequest
	ActivityFlagSync
	ActivityFlagPlay
	ActivityFlagPartyPrivacyFriends
	ActivityFlagPartyPrivacyVoiceChannel
	ActivityFlagEmbedded
)

type ActivityParty

type ActivityParty struct {
	Id   string `json:"id,omitempty"`
	Size [2]int `json:"size,omitempty"` // array of 2 ints
}

type ActivitySecrets

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

type ActivityTimestamps

type ActivityTimestamps struct {
	Start int `json:"start,omitempty"` // Unix timestamp in milliseconds
	End   int `json:"end,omitempty"`   // Unix timestamp in milliseconds
}

type ActivityType

type ActivityType int
const (
	ActivityPlaying ActivityType = iota
	ActivityStreaming
	ActivityListening
	ActivityWatching
	ActivityCustom
	ActivityCompeting
)

type AllowedMentions

type AllowedMentions struct {
	Parse        []*AllowedMentions `json:"parse"`
	Roles        []string           `json:"roles"`
	Users        []string           `json:"users"`
	RepliedUsers bool               `json:"replied_users"`
}

type AllowedMentionsType

type AllowedMentionsType string
const (
	AllowedMentionsRoleMentions AllowedMentionsType = "roles"
	AllowedMentionsUserMentions AllowedMentionsType = "users"
	AllowedMentionsEveryone     AllowedMentionsType = "everyone"
)

type Application

type Application struct {
	Id                  string          `json:"id"`
	Name                string          `json:"name"`
	Icon                string          `json:"icon"`
	Description         string          `json:"description"`
	RpcOrigins          []string        `json:"rpc_origins,omitempty"`
	BotPublic           bool            `json:"bot_public"`
	BotRequireGrantCode bool            `json:"bot_require_grant_code"`
	TermsOfServiceUrl   string          `json:"terms_of_service_url,omitempty"`
	PrivacyPolicyUrl    string          `json:"privacy_policy_url,omitempty"`
	Owner               *User           `json:"owner,omitempty"`
	Summary             string          `json:"summary"` // deprecated
	VerifyKey           string          `json:"verify_key"`
	Team                *Team           `json:"team"`
	GuildId             string          `json:"guild_id,omitempty"`
	PrimarySkuId        string          `json:"primary_sku_id,omitempty"`
	Slug                string          `json:"slug,omitempty"`
	CoverImage          string          `json:"cover_image,omitempty"`
	Flags               ApplicationFlag `json:"flags,omitempty"`
	Tags                []string        `json:"tags,omitempty"`
	InstallParams       *InstallParams  `json:"install_params,omitempty"`
	CustomInstallUrl    string          `json:"custom_install_url,omitempty"`
}

type ApplicationCommand

type ApplicationCommand struct {
	Id                       string                      `json:"id,omitempty"`
	ApplicationId            string                      `json:"application_id,omitempty"`
	GuildId                  string                      `json:"guild_id,omitempty"`
	Version                  string                      `json:"version,omitempty"`
	Type                     ApplicationCommandType      `json:"type,omitempty"`
	Name                     string                      `json:"name"`
	NameLocalizations        map[Locale]string           `json:"name_localizations,omitempty"`
	DefaultPermission        bool                        `json:"default_permission,omitempty"`
	DefaultMemberPermissions int64                       `json:"default_member_permissions,string,omitempty"`
	DMPermission             bool                        `json:"dm_permission,omitempty"`
	Description              string                      `json:"description,omitempty"`
	DescriptionLocalizations map[Locale]string           `json:"description_localizations,omitempty"`
	Options                  []*ApplicationCommandOption `json:"options"`
}

type ApplicationCommandData

type ApplicationCommandData struct {
	ID       string                                     `json:"id"`
	Name     string                                     `json:"name"`
	Resolved *ResolvedData                              `json:"resolved"`
	Options  []*ApplicationCommandInteractionDataOption `json:"options"`
	TargetID string                                     `json:"target_id"`
}

func (ApplicationCommandData) Type

type ApplicationCommandInteractionDataOption

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

func (ApplicationCommandInteractionDataOption) Bool

func (ApplicationCommandInteractionDataOption) Float

func (ApplicationCommandInteractionDataOption) Int

func (ApplicationCommandInteractionDataOption) String

type ApplicationCommandOption

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

type ApplicationCommandOptionChoice

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

type ApplicationCommandOptionType

type ApplicationCommandOptionType int

type ApplicationCommandPermissionType

type ApplicationCommandPermissionType int
const (
	ApplicationCommandPermissionTypeRole ApplicationCommandPermissionType
	ApplicationCommandPermissionTypeUser
	ApplicationCommandPermissionTypeChannel
)

type ApplicationCommandPermissions

type ApplicationCommandPermissions struct {
	Id         string                           `json:"id"`
	Type       ApplicationCommandPermissionType `json:"type"`
	Permission bool                             `json:"permission"`
}

type ApplicationCommandPermissionsList

type ApplicationCommandPermissionsList struct {
	Permissions []*ApplicationCommandPermissions `json:"permissions"`
}

type ApplicationCommandType

type ApplicationCommandType int

type ApplicationFlag

type ApplicationFlag int
const (
	ApplicationFlagGatewayPresence              ApplicationFlag = 1 << 12
	ApplicationFlagPresenceLimited              ApplicationFlag = 1 << 13
	ApplicationFlagGatewayGuildMembers          ApplicationFlag = 1 << 14
	ApplicationFlagGatewayGuildMembersLimited   ApplicationFlag = 1 << 15
	ApplicationFlagVerificationGuildLimit       ApplicationFlag = 1 << 16
	ApplicationFlagEmbedded                     ApplicationFlag = 1 << 17
	ApplicationFlagGatewayMessageContent        ApplicationFlag = 1 << 18
	ApplicationFlagGatewayMessageContentLimited ApplicationFlag = 1 << 19
)

type Attachment

type Attachment struct {
	Id       string `json:"id"`
	Filename string `json:"filename"`
	Size     int    `json:"size"`
	URL      string `json:"url"`
	Data     []byte `json:"-"`
	ProxyURL string `json:"proxy_url"`
	Height   int    `json:"height"`
	Width    int    `json:"width"`
}

type AutoModerationAction

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

type AutoModerationActionExecutionEventFields

type AutoModerationActionExecutionEventFields struct {
	GuildId              string                        `json:"guild_id"`
	Action               *AutoModerationAction         `json:"action"`
	RuleId               string                        `json:"rule_id"`
	RuleTriggerType      AutoModerationRuleTriggerType `json:"rule_trigger_type"`
	UserId               string                        `json:"user_id"`
	ChannelId            string                        `json:"channel_id,omitempty"`
	MessageId            string                        `json:"message_id,omitempty"`
	AlertSystemMessageId string                        `json:"alert_system_message_id,omitempty"`
	Content              string                        `json:"content"`
	MatchedKeyword       string                        `json:"matched_keyword"`
	MatchedContent       string                        `json:"matched_content"`
}

AutoModerationActionExecutionEventFields is used by AUTO_MODERATION_ACTION_EXECUTION event

type AutoModerationActionMetadata

type AutoModerationActionMetadata struct {
	ChannelId       string `json:"channel_id"`
	DurationSeconds int    `json:"duration_seconds"`
}

type AutoModerationActionType

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

type AutoModerationRule

type AutoModerationRule struct {
	Id          string                        `json:"id"`
	GuildId     string                        `json:"guild_id"`
	Name        string                        `json:"name"`
	CreatorId   string                        `json:"creator_id"`
	EventType   AutoModerationRuleEventType   `json:"event_type"`
	TriggerType AutoModerationRuleTriggerType `json:"trigger_type"`
	// ToDo : TriggerMetadata
	Actions        []*AutoModerationAction `json:"actions"`
	Enabled        bool                    `json:"enabled"`
	ExemptRoles    []string                `json:"exempt_roles"`    // 	the role ids that should not be affected by the rule (Maximum of 20)
	ExemptChannels []string                `json:"exempt_channels"` //	the channel ids that should not be affected by the rule (Maximum of 50)
}

type AutoModerationRuleEventType

type AutoModerationRuleEventType int
const (
	AutoModerationRuleEventTypeMessageSend AutoModerationRuleEventType = iota + 1 // when a member sends or edits a message in the guild
)

type AutoModerationRuleKeywordPreset

type AutoModerationRuleKeywordPreset int
const (
	AutoModerationRuleKeywordPresetProfanity     AutoModerationRuleKeywordPreset = iota + 1 // Words that may be considered forms of swearing or cursing
	AutoModerationRuleKeywordPresetSexualContent                                            // Words that refer to sexually explicit behavior or activity
	AutoModerationRuleKeywordPresetSlurs                                                    // Personal insults or words that may be considered hate speech
)

type AutoModerationRuleTriggerType

type AutoModerationRuleTriggerType int
const (
	AutoModerationRuleTriggerTypeKeyword AutoModerationRuleTriggerType = iota + 1
	AutoModerationRuleTriggerTypeSpam
	AutoModerationRuleTriggerTypeKeywordPreset
	AutoModerationRuleTriggerTypeMentionSpam
)

type Ban

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

type BitwisePermissionFlag

type BitwisePermissionFlag int64
const (
	BitwisePermissionFlagCreateInstantInvite BitwisePermissionFlag = 1 << iota
	BitwisePermissionFlagKickMembers
	BitwisePermissionFlagBanMembers
	BitwisePermissionFlagAdministrator
	BitwisePermissionFlagManageChannels
	BitwisePermissionFlagManageGuild
	BitwisePermissionFlagAddReactions
	BitwisePermissionFlagViewAuditLog
	BitwisePermissionFlagPrioritySpeaker
	BitwisePermissionFlagStream
	BitwisePermissionFlagViewChannel
	BitwisePermissionFlagSendMessages
	BitwisePermissionFlagSendTTSMessages
	BitwisePermissionFlagManageMessages
	BitwisePermissionFlagEmbedLinks
	BitwisePermissionFlagAttachFiles
	BitwisePermissionFlagReadMessageHistory
	BitwisePermissionFlagMentionEveryone
	BitwisePermissionFlagUseExternalEmojis
	BitwisePermissionFlagViewGuildInsights
	BitwisePermissionFlagConnect
	BitwisePermissionFlagSpeak
	BitwisePermissionFlagMuteMembers
	BitwisePermissionFlagDeafenMembers
	BitwisePermissionFlagMoveMembers
	BitwisePermissionFlagUseVAD
	BitwisePermissionFlagChangeNickname
	BitwisePermissionFlagManageNicknames
	BitwisePermissionFlagManageRoles
	BitwisePermissionFlagManageWebhooks
	BitwisePermissionFlagManageEmojisAndStickers
	BitwisePermissionFlagManageUseApplicationCommands
	BitwisePermissionFlagManageRequestToSpeak
	BitwisePermissionFlagManageManageEvents
	BitwisePermissionFlagManageManageThreads
	BitwisePermissionFlagManageCreatePublicThreads
	BitwisePermissionFlagManageCreatePrivateThreads
	BitwisePermissionFlagManageUseExternalStickers
	BitwisePermissionFlagManageSendMessagesInThreads
	BitwisePermissionFlagManageUseEmbeddedActivities
	BitwisePermissionFlagManageModerateMembers
)

func (BitwisePermissionFlag) Has

type Button

type Button struct {
	Type     ComponentType `json:"type"` // 2 for a button
	Style    ButtonStyle   `json:"style"`
	Label    string        `json:"label,omitempty"`
	Emoji    *Emoji        `json:"emoji,omitempty"` // name, id, and animated required
	CustomId string        `json:"custom_id,omitempty"`
	Url      string        `json:"url,omitempty"`
	Disabled bool          `json:"disabled,omitempty"`
}

func (Button) MarshalJSON

func (b Button) MarshalJSON() ([]byte, error)

type ButtonStyle

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

type Channel

type Channel struct {
	Id                         string                `json:"id"`
	Type                       ChannelType           `json:"type"`
	GuildId                    string                `json:"guild_id,omitempty"`
	Position                   int                   `json:"position,omitempty"`
	PermissionOverwrites       []*Overwrite          `json:"permission_overwrites,omitempty"`
	Name                       string                `json:"name,omitempty"`
	Topic                      string                `json:"topic,omitempty"`
	Nsfw                       bool                  `json:"nsfw,omitempty"`
	LastMessageId              string                `json:"last_message_id,omitempty"`
	Bitrate                    int                   `json:"bitrate,omitempty"`
	UserLimit                  int                   `json:"user_limit,omitempty"`
	RateLimitPerUser           int                   `json:"rate_limit_per_user,omitempty"`
	Recipients                 []*User               `json:"recipients,omitempty"`
	Icon                       string                `json:"icon,omitempty"`
	OwnerId                    string                `json:"owner_id,omitempty"`
	ApplicationId              string                `json:"application_id,omitempty"`
	ParentId                   string                `json:"parent_id,omitempty"`
	LastPinTimestamp           *time.Time            `json:"last_pin_timestamp,omitempty"`
	RtcRegion                  string                `json:"rtc_region,omitempty"` // 	voice region id for the voice channel, automatic when set to null
	VideoQualityMode           VideoQuality          `json:"video_quality_mode,omitempty"`
	MessageCount               int                   `json:"message_count,omitempty"`
	MemberCount                int                   `json:"member_count,omitempty"`
	ThreadMetadata             *ThreadMetadata       `json:"thread_metadata,omitempty"`
	Member                     *ThreadMember         `json:"member,omitempty"`
	DefaultAutoArchiveDuration int                   `json:"default_auto_archive_duration,omitempty"`
	Permissions                BitwisePermissionFlag `json:"permissions,string,omitempty"`
	Flags                      ChannelFlags          `json:"flags,omitempty"`
	TotalMessageSent           int                   `json:"total_message_sent,omitempty"`
}

type ChannelFlags

type ChannelFlags int
const (
	ChannelFlagsPinned ChannelFlags = 1 << 1
)

type ChannelMention

type ChannelMention struct {
	Id      string      `json:"id"`
	GuildId string      `json:"guild_id"`
	Type    ChannelType `json:"type"`
	Name    string      `json:"name"`
}

type ChannelPinsUpdateEventFields

type ChannelPinsUpdateEventFields struct {
	GuildId          string     `json:"guild_id,omitempty"`
	ChannelId        string     `json:"channel_id"`
	LastPinTimestamp *time.Time `json:"last_pin_timestamp,omitempty"`
}

ChannelPinsUpdateEventFields is used by the CHANNEL_PINS_UPDATE event

type ChannelType

type ChannelType int
const (
	ChannelTypeText ChannelType = iota
	ChannelTypeDM
	ChannelTypeVoice
	ChannelTypeGroupDM
	ChannelTypeCategory
	ChannelTypeNews
	ChannelTypeNewsThread
	ChannelTypePublicThread
	ChannelTypePrivateThread
	ChannelTypeStageVoice
	ChannelTypeDirectory
	ChannelTypeForum // Still in development
)

type ClientStatus

type ClientStatus struct {
	Desktop string `json:"deskop,omitempty"` // windows, linux, mac
	Mobile  string `json:"mobile,omitempty"` // ios, android
	Web     string `json:"web,omitempty"`    // browser, bot_account
}

type ComponentType

type ComponentType int
const (
	ComponentTypeActionRow  ComponentType = iota + 1 // container for other components
	ComponentTypeButton                              // clickable button
	ComponentTypeSelectMenu                          // dropdown
	ComponentTypeTextInput                           // text input
)

type Connection

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

type Embed

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

type EmbedAuthor

type EmbedAuthor struct {
	Name         string `json:"name"`
	URL          string `json:"url,omitempty"`
	IconURL      string `json:"icon_url,omitempty"`
	ProxyIconURL string `json:"proxy_icon_url,omitempty"`
}

type EmbedField

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

type EmbedFooter

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

type EmbedImage

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

type EmbedProvider

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

type EmbedThumbnail

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

type EmbedType

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

type EmbedVideo

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

type Emoji

type Emoji struct {
	Id            string   `json:"id"`
	Name          string   `json:"name"`
	Roles         []string `json:"roles,omitempty"`
	User          *User    `json:"user,omitempty"`
	RequireColons bool     `json:"require_colons,omitempty"`
	Managed       bool     `json:"managed,omitempty"`
	Animated      bool     `json:"animated,omitempty"`
	Available     bool     `json:"available,omitempty"`
}

type ExplicitContentFilterLevel

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

type FollowedChannel

type FollowedChannel struct {
	ChannelId string `json:"channel_id"`
	WebhookId string `json:"webhook_id"`
}

type Guild

type Guild struct {
	Id                          string                     `json:"id"`
	Name                        string                     `json:"name"`
	Icon                        string                     `json:"icon,omitempty"`
	IconHash                    string                     `json:"icon_hash,omitempty"`
	Splash                      string                     `json:"splash,omitempty"`
	DiscoverySplash             string                     `json:"discovery_splash"`
	Owner                       bool                       `json:"owner,omitempty"`
	OwnerId                     string                     `json:"owner_id"`
	Permissions                 BitwisePermissionFlag      `json:"permissions,string,omitempty"`
	Region                      string                     `json:"region,omitempty"`
	AfkChannelId                string                     `json:"afk_channel_id"`
	AfkTimeout                  int                        `json:"afk_timeout"`
	WidgetEnabled               bool                       `json:"widget_enabled,omitempty"`
	WidgetChannelId             string                     `json:"widget_channel_id,omitempty"`
	VerificationLevel           VerificationLevel          `json:"verification_level"`
	DefaultMessageNotifications MessageNotificationLevel   `json:"default_message_notifications"`
	ExplicitContentFilter       ExplicitContentFilterLevel `json:"explicit_content_filter"`
	Roles                       []*Role                    `json:"roles"`
	Emojis                      []*Emoji                   `json:"emojis"`
	Features                    []GuildFeature             `json:"features"`
	MfaLevel                    MfaLevel                   `json:"mfa_level"`
	ApplicationId               string                     `json:"application_id"`
	SystemChannelId             string                     `json:"system_channel_id"`
	SystemChannelFlags          SystemChannelFlag          `json:"system_channel_flags"`
	RuleChannelId               string                     `json:"rules_channel_id"`
	MaxPresences                int                        `json:"max_presences,omitempty"`
	MaxMembers                  int                        `json:"max_members,omitempty"`
	VanityUrlCode               string                     `json:"vanity_url_code"`
	Description                 string                     `json:"description"`
	Banner                      string                     `json:"banner"`
	PremiumTier                 PremiumTier                `json:"premium_tier"`
	PremiumSubscriptionCount    int                        `json:"premium_subscription_count,omitempty"`
	PreferredLocale             Locale                     `json:"preferred_locale"` // Reference: https://discordapp.com/developers/docs/resources/guild#guild-object-preferred-locale
	PublicUpdatesChannelId      string                     `json:"public_updates_channel_id"`
	MaxVideoChannelUsers        int                        `json:"max_video_channel_users,omitempty"`
	ApproximateMemberCount      int                        `json:"approximate_member_count,omitempty"`
	ApproximatePresenceCount    int                        `json:"approximate_presence_count,omitempty"`
	WelcomeScreen               *WelcomeScreen             `json:"welcome_screen,omitempty"`
	NsfwLevel                   GuildNsfwLevel             `json:"nsfw_level"`
	Stickers                    []*Sticker                 `json:"stickers,omitempty"`
	PremiumProgressBarEnabled   bool                       `json:"premium_progress_bar_enabled"`

	// GUILD_CREATE event specific fields
	JoinedAt       *time.Time        `json:"joined_at"`
	Large          bool              `json:"large"`
	Unavailable    bool              `json:"unavailable,omitempty"`
	MemberCount    int               `json:"member_count"`
	VoiceStates    []*VoiceState     `json:"voice_states"`
	Members        []*GuildMember    `json:"members"`
	Channels       []*Channel        `json:"channels"`
	Threads        []*Channel        `json:"threads"`
	Presences      []*PresenceUpdate `json:"presences"`
	StageInstances []*Channel        `json:"stage_instances"` // ToDo : Change to StageInstance

}

type GuildApplicationCommandPermissions

type GuildApplicationCommandPermissions struct {
	Id            string                           `json:"id"`
	ApplicationId string                           `json:"application_id"`
	GuildId       string                           `json:"guild_id"`
	Permissions   []*ApplicationCommandPermissions `json:"permissions"`
}

type GuildEmojisUpdateEventFields

type GuildEmojisUpdateEventFields struct {
	GuildId string   `json:"guild_id"`
	Emojis  []*Emoji `json:"emojis"`
}

GuildEmojisUpdateEventFields is the fields for the GUILD_EMOJIS_UPDATE event

type GuildFeature

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

type GuildIntegrationsUpdateEventFields

type GuildIntegrationsUpdateEventFields struct {
	GuildId string `json:"guild_id"`
}

GuildIntegrationsUpdateEventFields is the fields for the GUILD_INTEGRATIONS_UPDATE event

type GuildMember

type GuildMember struct {
	User                       *User                 `json:"user"`
	Nick                       string                `json:"nick,omitempty"`
	Roles                      []string              `json:"roles"`
	JoinedAt                   *time.Time            `json:"joined_at"`
	PremiumSince               *time.Time            `json:"premium_since,omitempty"`
	Deaf                       bool                  `json:"deaf"`
	Mute                       bool                  `json:"mute"`
	Pending                    bool                  `json:"pending"`
	Permissions                BitwisePermissionFlag `json:"permissions,string,omitempty"`
	CommunicationDisabledUntil *time.Time            `json:"communication_disabled_until"`
	GuildId                    string                `json:"guild_id"`
}

type GuildMemberRemoveEventFields

type GuildMemberRemoveEventFields struct {
	GuildId string `json:"guild_id"`
	User    *User  `json:"user"`
}

type GuildMembersChunkEventFields

type GuildMembersChunkEventFields struct {
	GuildId    string            `json:"guild_id"`
	Members    []*GuildMember    `json:"members"`
	ChunkIndex int               `json:"chunk_index"`
	ChunkCount int               `json:"chunk_count"`
	NotFound   []string          `json:"not_found,omitempty"`
	Presences  []*PresenceUpdate `json:"presences,omitempty"`
	Nonce      string            `json:"nonce,omitempty"`
}

GuildMembersChunkEventFields is the fields for the GUILD_MEMBERS_CHUNK event

type GuildNsfwLevel

type GuildNsfwLevel int
const (
	GuildNsfwLevelDefault GuildNsfwLevel = iota
	GuildNsfwLevelExplicit
	GuildNsfwLevelSafe
	GuildNsfwLevelAgeRestricted
)

type GuildPreview

type GuildPreview Guild

type GuildRoleCreateEventFields

type GuildRoleCreateEventFields struct {
	GuildId string `json:"guild_id"`
	Role    *Role  `json:"role"`
}

GuildRoleCreateEventFields is the fields for the GUILD_ROLE_CREATE event

type GuildRoleDeleteEventFields

type GuildRoleDeleteEventFields struct {
	GuildId string `json:"guild_id"`
	RoleId  string `json:"role_id"`
}

GuildRoleDeleteEventFields is the fields for the GUILD_ROLE_DELETE event

type GuildRoleUpdateEventFields

type GuildRoleUpdateEventFields struct {
	GuildId string `json:"guild_id"`
	Role    *Role  `json:"role"`
}

GuildRoleUpdateEventFields is the fields for the GUILD_ROLE_UPDATE event

type GuildScheduledEvent

type GuildScheduledEvent struct {
	Id                 string                             `json:"id"`
	GuildId            string                             `json:"guild_id"`
	ChannelId          string                             `json:"channel_id"`
	CreatorId          string                             `json:"creator_id,omitempty"`
	Name               string                             `json:"name"`
	Description        string                             `json:"description,omitempty"`
	ScheduledStartTime *time.Time                         `json:"scheduled_start_time"`
	ScheduledEndTime   *time.Time                         `json:"scheduled_end_time"`
	PrivacyLevel       GuildScheduledEventPrivacyLevel    `json:"privacy_level"`
	Status             GuildScheduledEventStatus          `json:"status"`
	EntityType         GuildScheduledEventEntityType      `json:"entity_type"`
	EntityId           string                             `json:"entity_id"`
	EntityMetadata     *GuildScheduledEventEntityMetadata `json:"entity_metadata"`
	Creator            *User                              `json:"creator,omitempty"`
	UserCount          int                                `json:"user_count,omitempty"`
	Image              string                             `json:"image,omitempty"`
}

type GuildScheduledEventEntityMetadata

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

type GuildScheduledEventEntityType

type GuildScheduledEventEntityType int
const (
	GuildScheduledEventEntityTypeStageInstance GuildScheduledEventEntityType = iota + 1
	GuildScheduledEventEntityTypeVoice
	GuildScheduledEventEntityTypeExternal
)

type GuildScheduledEventPrivacyLevel

type GuildScheduledEventPrivacyLevel int
const (
	GuildScheduledEventPrivacyLevelGuildOnly GuildScheduledEventPrivacyLevel = 2
)

type GuildScheduledEventStatus

type GuildScheduledEventStatus int
const (
	GuildScheduledEventStatusScheduled GuildScheduledEventStatus = iota + 1
	GuildScheduledEventStatusActive
	GuildScheduledEventStatusCompleted
	GuildScheduledEventStatusCanceled
)

type GuildScheduledEventUserObject

type GuildScheduledEventUserObject struct {
	GuildScheduledEventId string       `json:"guild_scheduled_event_id"`
	User                  *User        `json:"user"`
	Member                *GuildMember `json:"member,omitempty"`
}

type GuildStickersUpdateEventFields

type GuildStickersUpdateEventFields struct {
	GuildId  string     `json:"guild_id"`
	Stickers []*Sticker `json:"stickers"`
}

GuildStickersUpdateEventFields is the fields for the GUILD_STICKERS_UPDATE event

type GuildTemplate

type GuildTemplate struct {
	Code                    string     `json:"code"`
	Name                    string     `json:"name"`
	Description             string     `json:"description"`
	UsageCount              int        `json:"usage_count"`
	CreatorId               string     `json:"creator_id"`
	Creator                 *User      `json:"creator"`
	CreatedAt               *time.Time `json:"created_at"`
	UpdatedAt               *time.Time `json:"updated_at"`
	SourceGuildId           string     `json:"source_guild_id"`
	SerializedSourceGuildId string     `json:"serialized_source_guild"`
	IsDirty                 bool       `json:"is_dirty"`
}

type GuildWidget

type GuildWidget struct {
	Id            string         `json:"id"`
	Name          string         `json:"name"`
	InstantInvite string         `json:"instant_invite"`
	Channels      []*Channel     `json:"channels"`
	Members       []*GuildMember `json:"members"`
	PresenceCount int            `json:"presence_count"`
}

type GuildWidgetSettings

type GuildWidgetSettings struct {
	Enabled   bool   `json:"enabled"`
	ChannelId string `json:"channel_id"`
}

type InstallParams

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

type Integration

type Integration struct {
	Id                string                    `json:"id"`
	Name              string                    `json:"name"`
	Type              string                    `json:"type"` // twitch, youtube or discord
	Enabled           bool                      `json:"enabled,omitempty"`
	Syncing           bool                      `json:"syncing,omitempty"`
	RoleId            string                    `json:"role_id,omitempty"`
	EnableEmoticons   bool                      `json:"enable_emoticons,omitempty"`
	ExpireBehavior    IntegrationExpireBehavior `json:"expire_behavior,omitempty"`
	ExpireGracePeriod int                       `json:"expire_grace_period,omitempty"`
	User              *User                     `json:"user,omitempty"`
	Account           *IntegrationAccount       `json:"account"`
	SyncedAt          *time.Time                `json:"synced_at,omitempty"`
	SubscriberCount   int                       `json:"subscriber_count,omitempty"`
	Revoked           bool                      `json:"revoked,omitempty"`
	Applications      []*IntegrationApplication `json:"applications,omitempty"`
}

type IntegrationAccount

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

type IntegrationApplication

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

type IntegrationExpireBehavior

type IntegrationExpireBehavior int
const (
	IntegrationExpireBehaviorRemoveRole IntegrationExpireBehavior = iota
	IntegrationExpireBehaviorKick
)

type Interaction

type Interaction struct {
	Id             string                `json:"id"`
	ApplicationId  string                `json:"application_id"`
	Type           InteractionType       `json:"type"`
	Data           InteractionData       `json:"data"`
	GuildId        string                `json:"guild_id,omitempty"`
	ChannelId      string                `json:"channel_id,omitempty"`
	Member         *GuildMember          `json:"member"`
	User           *User                 `json:"user"`
	Token          string                `json:"token"`
	Version        int                   `json:"version"`
	Message        *Message              `json:"message,omitempty"`
	AppPermissions BitwisePermissionFlag `json:"app_permissions,string,omitempty"`
	Locale         Locale                `json:"locale,omitempty"`
	GuildLocale    Locale                `json:"guild_locale,omitempty"`
}

func (*Interaction) ApplicationCommandData

func (i *Interaction) ApplicationCommandData() ApplicationCommandData

func (*Interaction) MessageComponentData

func (i *Interaction) MessageComponentData() MessageComponentData

func (*Interaction) ModalSubmitData

func (i *Interaction) ModalSubmitData() ModalSubmitData

func (*Interaction) UnmarshalJSON

func (i *Interaction) UnmarshalJSON(data []byte) error

UnmarshalJSON ...

type InteractionCallbackAutocomplete

type InteractionCallbackAutocomplete struct {
	Choices []*ApplicationCommandOptionChoice `json:"choices"`
}

type InteractionCallbackMessage

type InteractionCallbackMessage struct {
	Tts             bool               `json:"tts,omitempty"`
	Content         string             `json:"content,omitempty"`
	Embeds          []*Embed           `json:"embeds,omitempty"`
	AllowedMentions *AllowedMentions   `json:"allowed_mentions,omitempty"`
	Flags           MessageFlag        `json:"flags,omitempty"`
	Components      []MessageComponent `json:"components,omitempty"` // ToDo : make this cleaner
	Attachments     []*Attachment      `json:"attachments,omitempty"`
}

type InteractionCallbackModal

type InteractionCallbackModal struct {
	CustomId   string             `json:"custom_id"` // a developer-defined identifier for the component, max 100 characters
	Title      string             `json:"title"`
	Components []MessageComponent `json:"components"` // ToDo : make this cleaner
}

type InteractionCallbackType

type InteractionCallbackType int

type InteractionData

type InteractionData interface {
	Type() InteractionType
}

type InteractionResponse

type InteractionResponse struct {
	Type InteractionCallbackType `json:"type"`
	Data interface{}             `json:"data"` // depends on type
}

type InteractionType

type InteractionType int

type Invite

type Invite struct {
	Code                     string               `json:"code"`
	Guild                    *Guild               `json:"guild,omitempty"`
	Channel                  *Channel             `json:"channel"`
	Inviter                  *User                `json:"inviter,omitempty"`
	TargetType               int                  `json:"target_type,omitempty"`
	TargetUser               *User                `json:"target_user,omitempty"`
	TargetApplication        *Application         `json:"target_application,omitempty"`
	ApproximatePresenceCount int                  `json:"approximate_presence_count,omitempty"`
	ApproximateMemberCount   int                  `json:"approximate_member_count,omitempty" `
	ExpiresAt                *time.Time           `json:"expires_at,omitempty"`
	StageInstance            *StageInstance       `json:"stage_instance,omitempty"`
	GuildScheduledEvent      *GuildScheduledEvent `json:"guild_scheduled_event,omitempty"`
}

type Locale

type Locale string
const (
	EnglishUS    Locale = "en-US"
	EnglishGB    Locale = "en-GB"
	Bulgarian    Locale = "bg"
	ChineseCN    Locale = "zh-CN"
	ChineseTW    Locale = "zh-TW"
	Croatian     Locale = "hr"
	Czech        Locale = "cs"
	Danish       Locale = "da"
	Dutch        Locale = "nl"
	Finnish      Locale = "fi"
	French       Locale = "fr"
	German       Locale = "de"
	Greek        Locale = "el"
	Hindi        Locale = "hi"
	Hungarian    Locale = "hu"
	Italian      Locale = "it"
	Japanese     Locale = "ja"
	Korean       Locale = "ko"
	Lithuanian   Locale = "lt"
	Norwegian    Locale = "no"
	Polish       Locale = "pl"
	PortugueseBR Locale = "pt-BR"
	Romanian     Locale = "ro"
	Russian      Locale = "ru"
	SpanishES    Locale = "es-ES"
	Swedish      Locale = "sv-SE"
	Thai         Locale = "th"
	Turkish      Locale = "tr"
	Ukrainian    Locale = "uk"
	Vietnamese   Locale = "vi"
)

type MembershipState

type MembershipState int
const (
	MembershipStateInvited MembershipState = iota + 1
	MembershipStateAccepted
)

type Message

type Message struct {
	Id                string              `json:"id"`
	ChannelId         string              `json:"channel_id"`
	GuildId           string              `json:"guild_id,omitempty"`
	Author            *User               `json:"author"`
	Member            *GuildMember        `json:"member"`
	Content           string              `json:"content"`
	Timestamp         *time.Time          `json:"timestamp"`
	EditedTimestamp   *time.Time          `json:"edited_timestamp"`
	Tts               bool                `json:"tts"`
	MentionEveryone   bool                `json:"mention_everyone"`
	Mentions          []*User             `json:"mentions"`
	MentionRoles      []string            `json:"mention_roles"`
	MentionChannels   []*Channel          `json:"mention_channels,omitempty"`
	Attachments       []*Attachment       `json:"attachments"`
	Embeds            []*Embed            `json:"embeds"`
	Reactions         []*Reaction         `json:"reactions"`
	Nonce             interface{}         `json:"nonce,omitempty"` // integer or string
	Pinned            bool                `json:"pinned"`
	WebhookId         string              `json:"webhook_id,omitempty"`
	Type              MessageType         `json:"type"`
	Activity          *MessageActivity    `json:"activity,omitempty"`
	Application       *Application        `json:"application,omitempty"`
	ApplicationId     string              `json:"application_id,omitempty"`
	MessageReference  *MessageReference   `json:"message_reference,omitempty"`
	Flags             MessageFlag         `json:"flags,omitempty"`
	ReferencedMessage *Message            `json:"referenced_message,omitempty"`
	Interaction       *MessageInteraction `json:"interaction,omitempty"`
	Thread            *Channel            `json:"thread,omitempty"`
	Components        []MessageComponent  `json:"components"`
	StickerItems      []*StickerItem      `json:"sticker_items,omitempty"`
	Position          int                 `json:"position,omitempty"`
}

func (*Message) UnmarshalJSON

func (m *Message) UnmarshalJSON(data []byte) error

UnmarshalJSON ...

type MessageActivity

type MessageActivity struct {
	Type    string `json:"type"`
	PartyId string `json:"party_id"`
}

type MessageActivityType

type MessageActivityType int
const (
	MessageActivityTypeJoin MessageActivityType = iota + 1
	MessageActivityTypeSpectate
	MessageActivityTypeListen
	MessageActivityTypeJoinRequest
)

type MessageComponent

type MessageComponent interface {
	json.Marshaler
}

type MessageComponentData

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

func (MessageComponentData) Type

type MessageFlag

type MessageFlag int
const (
	MessageFlagCrossposted MessageFlag = 1 << iota
	MessageFlagIsCrosspost
	MessageFlagSuppressEmbeds
	MessageFlagSourceMessageDeleted
	MessageFlagUrgent
	MessageFlagHasThread
	MessageFlagEphemeral
	MessageFlagLoading
	MessageFlagFailedToMentionSomeRolesInThreads
)

type MessageInteraction

type MessageInteraction struct {
	Id     string          `json:"id"`
	Type   InteractionType `json:"type"`
	Name   string          `json:"name"`
	User   *User           `json:"user"`
	Member *GuildMember    `json:"member,omitempty"`
}

type MessageNotificationLevel

type MessageNotificationLevel int
const (
	MessageNotificationLevelAllMessages MessageNotificationLevel = iota
	MessageNotificationLevelOnlyMentions
)

type MessageReaction

type MessageReaction struct {
	UserId          string       `json:"user_id"`
	ChannelId       string       `json:"channel_id"`
	MessageId       string       `json:"message_id"`
	GuildId         string       `json:"guild_id"`
	Member          *GuildMember `json:"member"`
	Emoji           *Emoji       `json:"emoji"`
	MessageAuthorId string       `json:"message_author_id"`
}

type MessageReference

type MessageReference struct {
	MessageId      string `json:"message_id,omitempty"`
	ChannelId      string `json:"channel_id,omitempty"`
	GuildId        string `json:"guild_id,omitempty"`
	FailIfNotExist bool   `json:"fail_if_not_exist,omitempty"`
}

type MessageType

type MessageType int
const (
	MessageTypeDefault MessageType = iota
	MessageTypeRecipientAdd
	MessageTypeRecipientRemove
	MessageTypeCall
	MessageTypeChannelNameChange
	MessageTypeChannelIconChange
	MessageTypeChannelPinnedMessage
	MessageTypeUserJoin
	MessageTypeGuildBoost
	MessageTypeGuildBoostTier1
	MessageTypeGuildBoostTier2
	MessageTypeGuildBoostTier3
	MessageTypeChannelFollowAdd
	MessageTypeGuildDiscoveryAdd
	MessageTypeGuildDiscoveryDisqualified
	MessageTypeGuildDiscoveryRequalified
	MessageTypeGuildDiscoveryGracePeriodInitialWarning
	MessageTypeGuildDiscoveryGracePeriodFinalWarning
	MessageTypeThreadCreated
	MessageTypeReply
	MessageTypeChatInputCommand
	MessageTypeThreadStarterMessage
	MessageTypeGuildInviteReminder
	MessageTypeContextMenuCommand
	MessageTypeAutoModerationAction
	MessageTypeRoleSubscription
	MessageTypeInteractionPremiumUpsell
	MessageTypeGuildApplicationPremiumSubscription = 32
)

type MfaLevel

type MfaLevel int
const (
	MfaLevelNone MfaLevel = iota
	MfaLevelElevated
)

type ModalSubmitData

type ModalSubmitData struct {
	CustomId   string             `json:"custom_id"`
	Components []MessageComponent `json:"components"`
}

func (ModalSubmitData) Type

func (*ModalSubmitData) UnmarshalJSON

func (d *ModalSubmitData) UnmarshalJSON(data []byte) error

type Overwrite

type Overwrite struct {
	Id    string                `json:"id"`           // role or user id
	Type  int                   `json:"type"`         // 0 for role, 1 for user
	Allow BitwisePermissionFlag `json:"allow,string"` // permission bit set
	Deny  BitwisePermissionFlag `json:"deny,string"`  // permission bit set
}

type PremiumTier

type PremiumTier int
const (
	PremiumTierNone PremiumTier = iota
	PremiumTierTier1
	PremiumTierTier2
	PremiumTierTier3
)

type PremiumType

type PremiumType int
const (
	PremiumTypeNone PremiumType = iota
	PremiumTypeNitroClassic
	PremiumTypeNitro
)

type PresenceUpdate

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

type PrivacyLevel

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

type Reaction

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

type ResolvedData

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

type Role

type Role struct {
	Id           string                `json:"id"`
	Name         string                `json:"name"`
	Color        int                   `json:"color"`
	Hoist        bool                  `json:"hoist"`
	Icon         string                `json:"icon,omitempty"`
	UnicodeEmoji string                `json:"unicode_emoji,omitempty"`
	Position     int                   `json:"position"`
	Permissions  BitwisePermissionFlag `json:"permissions,string"`
	Managed      bool                  `json:"managed"`
	Mentionable  bool                  `json:"mentionable"`
	Tags         *RoleTag              `json:"tags,omitempty"`
}

func (*Role) String

func (role *Role) String() string

A function to turn a role into a string. The Role ID is the contents of the string.

type RoleTag

type RoleTag struct {
	BotId             string          `json:"bot_id,omitempty"`
	IntegrationId     string          `json:"integration_id,omitempty"`
	PremiumSubscriber json.RawMessage `json:"premium_subscriber,omitempty"` // null, whether this is the guild's premium subscriber role
}

type SelectMenu

type SelectMenu struct {
	Type         ComponentType   `json:"type"` // 3 fo a select menu
	CustomId     string          `json:"custom_id"`
	Options      []*SelectOption `json:"options"`
	ChannelTypes []*ChannelType  `json:"channel_types,omitempty"`
	PlaceHolder  string          `json:"placeholder,omitempty"`
	MinValues    int             `json:"min_values,omitempty"`
	MaxValues    int             `json:"max_values,omitempty"`
	Disabled     bool            `json:"disabled,omitempty"`
}

func (SelectMenu) MarshalJSON

func (sm SelectMenu) MarshalJSON() ([]byte, error)

type SelectOption

type SelectOption struct {
	Label       string `json:"label"`
	Value       string `json:"value"`
	Description string `json:"description,omitempty"`
	Emoji       *Emoji `json:"emoji,omitempty"` // id, name, and animated required
	Default     bool   `json:"default,omitempty"`
}

type Service

type Service string
const (
	ServiceBattleNet       Service = "battlenet"
	ServiceEpicGames       Service = "epicgames"
	ServiceFacebook        Service = "facebook"
	ServiceGithub          Service = "github"
	ServiceLeagueofLegends Service = "leagueoflegends"
	ServicePlaystation     Service = "playstation"
	ServiceReddit          Service = "reddit"
	ServiceSamsungGalaxy   Service = "samsunggalaxy"
	ServiceSpotify         Service = "spotify"
	ServiceSkype           Service = "skype"
	ServiceSteam           Service = "steam"
	ServiceTwitch          Service = "twitch"
	ServiceTwitter         Service = "twitter"
	ServiceXbox            Service = "xbox"
	ServiceYoutube         Service = "youtube"
)

type StageInstance

type StageInstance struct {
	Id                    string       `json:"id"`
	GuildId               string       `json:"guild_id"`
	ChannelId             string       `json:"channel_id"`
	Topic                 string       `json:"topic"`
	PrivacyLevel          PrivacyLevel `json:"privacy_level"`
	DiscoverableDisabled  bool         `json:"discoverable_disabled"`
	GuildScheduledEventId string       `json:"guild_scheduled_event_id"`
}

type StatusType

type StatusType string
const (
	StatusTypeOnline       StatusType = "online"
	StatusTypeIdle         StatusType = "idle"
	StatusTypeDoNotDisturb StatusType = "dnd"
	StatusTypeOffline      StatusType = "offline"
)

type Sticker

type Sticker struct {
	Id          string        `json:"id"`
	PackId      string        `json:"pack_id,omitempty"`
	Name        string        `json:"name,omitempty"`
	Description string        `json:"description"`
	Tags        string        `json:"tags,omitempty"`  // autocomplete/suggestion tags for the sticker (max 200 characters)
	Asset       string        `json:"asset,omitempty"` // Deprecated previously the sticker asset hash, now an empty string
	Type        StickerType   `json:"type"`
	FormatType  StickerFormat `json:"format_type"`
	Available   bool          `json:"available,omitempty"`
	GuildId     string        `json:"guild_id,omitempty"`
	User        *User         `json:"user,omitempty"`
	SortValue   int           `json:"sort_value,omitempty"`
}

type StickerFormat

type StickerFormat int
const (
	StickerFormatPng StickerFormat = iota + 1
	StickerFormatApng
	StickerFormatLottie
)

type StickerItem

type StickerItem struct {
	Id         string `json:"id"`
	Name       string `json:"name"`
	FormatType string `json:"format_type"`
}

type StickerPack

type StickerPack struct {
	Id             string    `json:"id"`
	Stickers       []Sticker `json:"stickers"`
	Name           string    `json:"name"`
	SkuId          string    `json:"sku_id"`
	CoverStickerId string    `json:"cover_sticker_id,omitempty"`
	Description    string    `json:"description"`
	BannerAssetId  string    `json:"banner_asset_id,omitempty"`
}

type StickerType

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

type SystemChannelFlag

type SystemChannelFlag int
const (
	SystemChannelFlagSupressJoinNotifications SystemChannelFlag = 1 << iota
	SystemChannelFlagSupressPremiumSubscriptions
	SystemChannelFlagSupressGuildReminderNotifications
	SystemChannelFlagSupressJoinNotificationReplies
)

type Team

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

type TeamMember

type TeamMember struct {
	MembershipState MembershipState       `json:"membership_state"`
	Permissions     BitwisePermissionFlag `json:"permissions,string"`
	TeamId          string                `json:"team_id"`
	User            *User                 `json:"user"`
}

type TextInput

type TextInput struct {
	Type        ComponentType  `json:"type"` // 4 for a text input
	CustomId    string         `json:"custom_id"`
	Style       TextInputStyle `json:"style"`
	Label       string         `json:"label"`
	MinLength   int            `json:"min_length,omitempty"`
	MaxLength   int            `json:"max_length,omitempty"`
	Required    bool           `json:"required,omitempty"`
	Value       string         `json:"value,omitempty"`
	PlaceHolder string         `json:"placeholder,omitempty"`
}

func (TextInput) MarshalJSON

func (ti TextInput) MarshalJSON() ([]byte, error)

type TextInputStyle

type TextInputStyle uint
const (
	TextInputShort TextInputStyle = iota + 1
	TextInputParagraph
)

type ThreadListSyncEventFields

type ThreadListSyncEventFields struct {
	GuildId    string   `json:"guild_id"`
	ChannelIds []string `json:"channel_ids,omitempty"`
	Threads    []*Channel
	Members    []*ThreadMember
}

ThreadListSyncEventFields is used by the THREAD_LIST_SYNC event

type ThreadMember

type ThreadMember struct {
	Id            string     `json:"id,omitempty"`
	UserId        string     `json:"user_id,omitempty"`
	JoinTimestamp *time.Time `json:"join_timestamp"`
	Flags         int        `json:"flags"`
	GuildId       string     `json:"guild_id,omitempty"`
}

type ThreadMembersUpdateEventFields

type ThreadMembersUpdateEventFields struct {
	Id                string          `json:"id"`
	GuildId           string          `json:"guild_id"`
	MemberCount       int             `json:"member_count"`
	AddedMembers      []*ThreadMember `json:"added_members,omitempty"`
	RemovedMembersIds []string        `json:"removed_member_ids,omitempty"`
}

ThreadMembersUpdateEventFields is used by the THREAD_MEMBERS_UPDATE event

type ThreadMetadata

type ThreadMetadata struct {
	Archived            bool       `json:"archived"`
	AutoArchiveDuration int        `json:"auto_archive_duration"`
	ArchiveTimestamp    *time.Time `json:"archive_timestamp"`
	Locked              bool       `json:"locked"`
	Invitable           bool       `json:"invitable,omitempty"`
	CreateTimestamp     *time.Time `json:"create_timestamp,omitempty"`
}

type UnavailableGuild

type UnavailableGuild Guild

type User

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

func (*User) AvatarURL

func (u *User) AvatarURL() string

func (*User) Tag

func (u *User) Tag() string

type UserFlag

type UserFlag int
const (
	UserFlagStaff UserFlag = 1 << iota
	UserFlagPartner
	UserFlagHypesquad
	UserFlagBugHunterLevel1
	UserFlagHypesquadOnlineHouse1 // Bravery member
	UserFlagHypesquadOnlineHouse2 // Brilliance member
	UserFlagHypesquadOnlineHouse3 // Balance member
	UserFlagEarlySupporter
	UserFlagPseudoUser // User in team
	UserFlagBugHunterLevel2
	UserFlagVerifiedBot
	UserFlagVerifiedDeveloper
	UserFlagCertifiedModerator
	UserFlagBotHTTPInteractions // 	Bot uses only HTTP interactions and is shown in the online member list
)

type VerificationLevel

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

type VideoQuality

type VideoQuality int
const (
	VideoQualityAuto VideoQuality // Discord chooses the quality for optimal performance
	VideoQualityFull              // 720p, 1080p, or higher quality
)

type VisibilityType

type VisibilityType int
const (
	VisibilityTypeNone VisibilityType = iota
	VisibilityTypeEveryone
)

type VoiceRegion

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

type VoiceServerUpdateEventFields

type VoiceServerUpdateEventFields struct {
	Token    string `json:"token"`
	GuildId  string `json:"guild_id"`
	Endpoint string `json:"endpoint"`
}

VoiceServerUpdateEventFields is the fields used by the VOICE_SERVER_UPDATE event.

type VoiceState

type VoiceState struct {
	GuildId                 string       `json:"guild_id,omitempty"`
	ChannelId               string       `json:"channel_id"`
	UserId                  string       `json:"user_id"`
	Member                  *GuildMember `json:"member,omitempty"`
	SessionId               string       `json:"session_id"`
	Deaf                    bool         `json:"deaf"`
	Mute                    bool         `json:"mute"`
	SelfDeaf                bool         `json:"self_deaf"`
	SelfMute                bool         `json:"self_mute"`
	SelfStream              bool         `json:"self_stream,omitempty"`
	SelfVideo               bool         `json:"self_video"`
	Suppress                bool         `json:"suppress"`
	RequestToSpeakTimestamp time.Time    `json:"request_to_speak_timestamp"`
}

type Webhook

type Webhook struct {
	Id            string      `json:"id"`
	Type          WebhookType `json:"type"`
	GuildId       string      `json:"guild_id,omitempty"`
	ChannelId     string      `json:"channel_id"`
	User          *User       `json:"user,omitempty"`
	Name          string      `json:"name"`
	Avatar        string      `json:"avatar"`
	Token         string      `json:"token,omitempty"`
	ApplicationId string      `json:"application_id"`
	SourceGuild   *Guild      `json:"source_guild,omitempty"`
	SourceChannel *Channel    `json:"source_channel,omitempty"`
	Url           string      `json:"url,omitempty"`
}

type WebhookType

type WebhookType int
const (
	WebhookTypeIncoming WebhookType = iota + 1
	WebhookTypeChannelFollower
	WebhookTypeApplication
)

type WelcomeScreen

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

type WelcomeScreenChannel

type WelcomeScreenChannel struct {
	ChannelId   string `json:"channel_id"`
	Description string `json:"description"`
	EmojiId     string `json:"emoji_id"`
	EmojiName   string `json:"emoji_name"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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