model

package
v0.0.0-...-99e091e Latest Latest
Warning

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

Go to latest
Published: May 29, 2016 License: MIT, BSD-3-Clause Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Attachment

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

An Attachment stores data for message attachments.

func (Attachment) MarshalEasyJSON

func (v Attachment) MarshalEasyJSON(w *jwriter.Writer)

func (Attachment) MarshalJSON

func (v Attachment) MarshalJSON() ([]byte, error)

func (*Attachment) UnmarshalEasyJSON

func (v *Attachment) UnmarshalEasyJSON(l *jlexer.Lexer)

func (*Attachment) UnmarshalJSON

func (v *Attachment) UnmarshalJSON(data []byte) error

type Channel

type Channel struct {
	ID                   string                 `json:"id"`
	GuildID              string                 `json:"guild_id"`
	Name                 string                 `json:"name"`
	Topic                string                 `json:"topic"`
	Type                 string                 `json:"type"`
	LastMessageID        string                 `json:"last_message_id"`
	Position             int                    `json:"position"`
	Bitrate              int                    `json:"bitrate"`
	IsPrivate            bool                   `json:"is_private"`
	Recipient            *User                  `json:"recipient"`
	Messages             []*Message             `json:"-"`
	PermissionOverwrites []*PermissionOverwrite `json:"permission_overwrites"`
}

A Channel holds all data related to an individual Discord channel.

func (Channel) MarshalEasyJSON

func (v Channel) MarshalEasyJSON(w *jwriter.Writer)

func (Channel) MarshalJSON

func (v Channel) MarshalJSON() ([]byte, error)

func (*Channel) UnmarshalEasyJSON

func (v *Channel) UnmarshalEasyJSON(l *jlexer.Lexer)

func (*Channel) UnmarshalJSON

func (v *Channel) UnmarshalJSON(data []byte) error

type Embed

type Embed struct {
	URL         string `json:"url"`
	Type        string `json:"type"`
	Title       string `json:"title"`
	Description string `json:"description"`
	Thumbnail   *struct {
		URL      string `json:"url"`
		ProxyURL string `json:"proxy_url"`
		Width    int    `json:"width"`
		Height   int    `json:"height"`
	} `json:"thumbnail"`
	Provider *struct {
		URL  string `json:"url"`
		Name string `json:"name"`
	} `json:"provider"`
	Author *struct {
		URL  string `json:"url"`
		Name string `json:"name"`
	} `json:"author"`
	Video *struct {
		URL    string `json:"url"`
		Width  int    `json:"width"`
		Height int    `json:"height"`
	} `json:"video"`
}

An Embed stores data for message embeds.

func (Embed) MarshalEasyJSON

func (v Embed) MarshalEasyJSON(w *jwriter.Writer)

func (Embed) MarshalJSON

func (v Embed) MarshalJSON() ([]byte, error)

func (*Embed) UnmarshalEasyJSON

func (v *Embed) UnmarshalEasyJSON(l *jlexer.Lexer)

func (*Embed) UnmarshalJSON

func (v *Embed) UnmarshalJSON(data []byte) error

type Emoji

type Emoji struct {
	ID            string   `json:"id"`
	Name          string   `json:"name"`
	Roles         []string `json:"roles"`
	Managed       bool     `json:"managed"`
	RequireColons bool     `json:"require_colons"`
}

Emoji struct holds data related to Emoji's

func (Emoji) MarshalEasyJSON

func (v Emoji) MarshalEasyJSON(w *jwriter.Writer)

func (Emoji) MarshalJSON

func (v Emoji) MarshalJSON() ([]byte, error)

func (*Emoji) UnmarshalEasyJSON

func (v *Emoji) UnmarshalEasyJSON(l *jlexer.Lexer)

func (*Emoji) UnmarshalJSON

func (v *Emoji) UnmarshalJSON(data []byte) error

type Event

type Event struct {
	Type      string          `json:"t"`
	State     int             `json:"s"`
	Operation int             `json:"op"`
	Direction int             `json:"dir"`
	RawData   json.RawMessage `json:"d"`
	Struct    interface{}     `json:"-"`
}

An Event provides a basic initial struct for all websocket event.

func (Event) MarshalEasyJSON

func (v Event) MarshalEasyJSON(w *jwriter.Writer)

func (Event) MarshalJSON

func (v Event) MarshalJSON() ([]byte, error)

func (*Event) UnmarshalEasyJSON

func (v *Event) UnmarshalEasyJSON(l *jlexer.Lexer)

func (*Event) UnmarshalJSON

func (v *Event) UnmarshalJSON(data []byte) error

type Game

type Game struct {
	Name string `json:"name"`
}

A Game struct holds the name of the "playing .." game for a user

func (Game) MarshalEasyJSON

func (v Game) MarshalEasyJSON(w *jwriter.Writer)

func (Game) MarshalJSON

func (v Game) MarshalJSON() ([]byte, error)

func (*Game) UnmarshalEasyJSON

func (v *Game) UnmarshalEasyJSON(l *jlexer.Lexer)

func (*Game) UnmarshalJSON

func (v *Game) UnmarshalJSON(data []byte) error

type Guild

type Guild struct {
	ID                string            `json:"id"`
	Name              string            `json:"name"`
	Icon              string            `json:"icon"`
	Region            string            `json:"region"`
	AfkChannelID      string            `json:"afk_channel_id"`
	EmbedChannelID    string            `json:"embed_channel_id"`
	OwnerID           string            `json:"owner_id"`
	JoinedAt          string            `json:"joined_at"` // make this a timestamp
	Splash            string            `json:"splash"`
	AfkTimeout        int               `json:"afk_timeout"`
	VerificationLevel VerificationLevel `json:"verification_level"`
	EmbedEnabled      bool              `json:"embed_enabled"`
	Large             bool              `json:"large"` // ??
	Roles             []*Role           `json:"roles"`
	Emojis            []*Emoji          `json:"emojis"`
	Members           []*Member         `json:"members"`
	Presences         []*Presence       `json:"presences"`
	Channels          []*Channel        `json:"channels"`
	VoiceStates       []*VoiceState     `json:"voice_states"`
	Unavailable       *bool             `json:"unavailable"`
}

A Guild holds all data related to a specific Discord Guild. Guilds are also sometimes referred to as Servers in the Discord client.

func (Guild) MarshalEasyJSON

func (v Guild) MarshalEasyJSON(w *jwriter.Writer)

func (Guild) MarshalJSON

func (v Guild) MarshalJSON() ([]byte, error)

func (*Guild) UnmarshalEasyJSON

func (v *Guild) UnmarshalEasyJSON(l *jlexer.Lexer)

func (*Guild) UnmarshalJSON

func (v *Guild) UnmarshalJSON(data []byte) error

type GuildBan

type GuildBan struct {
	User    *User  `json:"user"`
	GuildID string `json:"guild_id"`
}

A GuildBan stores data for a guild ban.

func (GuildBan) MarshalEasyJSON

func (v GuildBan) MarshalEasyJSON(w *jwriter.Writer)

func (GuildBan) MarshalJSON

func (v GuildBan) MarshalJSON() ([]byte, error)

func (*GuildBan) UnmarshalEasyJSON

func (v *GuildBan) UnmarshalEasyJSON(l *jlexer.Lexer)

func (*GuildBan) UnmarshalJSON

func (v *GuildBan) UnmarshalJSON(data []byte) error

type GuildEmojisUpdate

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

A GuildEmojisUpdate stores data for a guild emoji update event.

func (GuildEmojisUpdate) MarshalEasyJSON

func (v GuildEmojisUpdate) MarshalEasyJSON(w *jwriter.Writer)

func (GuildEmojisUpdate) MarshalJSON

func (v GuildEmojisUpdate) MarshalJSON() ([]byte, error)

func (*GuildEmojisUpdate) UnmarshalEasyJSON

func (v *GuildEmojisUpdate) UnmarshalEasyJSON(l *jlexer.Lexer)

func (*GuildEmojisUpdate) UnmarshalJSON

func (v *GuildEmojisUpdate) UnmarshalJSON(data []byte) error

type GuildIntegrationsUpdate

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

A GuildIntegrationsUpdate stores data for the guild integrations update websocket event.

func (GuildIntegrationsUpdate) MarshalEasyJSON

func (v GuildIntegrationsUpdate) MarshalEasyJSON(w *jwriter.Writer)

func (GuildIntegrationsUpdate) MarshalJSON

func (v GuildIntegrationsUpdate) MarshalJSON() ([]byte, error)

func (*GuildIntegrationsUpdate) UnmarshalEasyJSON

func (v *GuildIntegrationsUpdate) UnmarshalEasyJSON(l *jlexer.Lexer)

func (*GuildIntegrationsUpdate) UnmarshalJSON

func (v *GuildIntegrationsUpdate) UnmarshalJSON(data []byte) error

type GuildParams

type GuildParams struct {
	Name              string             `json:"name"`
	Region            string             `json:"region"`
	VerificationLevel *VerificationLevel `json:"verification_level"`
}

A GuildParams stores all the data needed to update discord guild settings

func (GuildParams) MarshalEasyJSON

func (v GuildParams) MarshalEasyJSON(w *jwriter.Writer)

func (GuildParams) MarshalJSON

func (v GuildParams) MarshalJSON() ([]byte, error)

func (*GuildParams) UnmarshalEasyJSON

func (v *GuildParams) UnmarshalEasyJSON(l *jlexer.Lexer)

func (*GuildParams) UnmarshalJSON

func (v *GuildParams) UnmarshalJSON(data []byte) error

type GuildRole

type GuildRole struct {
	Role    *Role  `json:"role"`
	GuildID string `json:"guild_id"`
}

A GuildRole stores data for guild role websocket events.

func (GuildRole) MarshalEasyJSON

func (v GuildRole) MarshalEasyJSON(w *jwriter.Writer)

func (GuildRole) MarshalJSON

func (v GuildRole) MarshalJSON() ([]byte, error)

func (*GuildRole) UnmarshalEasyJSON

func (v *GuildRole) UnmarshalEasyJSON(l *jlexer.Lexer)

func (*GuildRole) UnmarshalJSON

func (v *GuildRole) UnmarshalJSON(data []byte) error

type GuildRoleDelete

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

A GuildRoleDelete stores data for the guild role delete websocket event.

func (GuildRoleDelete) MarshalEasyJSON

func (v GuildRoleDelete) MarshalEasyJSON(w *jwriter.Writer)

func (GuildRoleDelete) MarshalJSON

func (v GuildRoleDelete) MarshalJSON() ([]byte, error)

func (*GuildRoleDelete) UnmarshalEasyJSON

func (v *GuildRoleDelete) UnmarshalEasyJSON(l *jlexer.Lexer)

func (*GuildRoleDelete) UnmarshalJSON

func (v *GuildRoleDelete) UnmarshalJSON(data []byte) error

type Handshake

type Handshake struct {
	Token          string              `json:"token"`
	Properties     HandshakeProperties `json:"properties"`
	Compress       bool                `json:"compress"`
	LargeThreshold int                 `json:"large_threshold"`
}

Handshake is sent initially on the first connection to the server.

func (Handshake) MarshalEasyJSON

func (v Handshake) MarshalEasyJSON(w *jwriter.Writer)

func (Handshake) MarshalJSON

func (v Handshake) MarshalJSON() ([]byte, error)

func (*Handshake) UnmarshalEasyJSON

func (v *Handshake) UnmarshalEasyJSON(l *jlexer.Lexer)

func (*Handshake) UnmarshalJSON

func (v *Handshake) UnmarshalJSON(data []byte) error

type HandshakeProperties

type HandshakeProperties struct {
	OS              string `json:"$os"`
	Browser         string `json:"$browser"`
	Device          string `json:"$device"`
	Referer         string `json:"$referer"`
	ReferringDomain string `json:"$referring_domain"`
}

HandhsakeProperties are contained within the handshake and describe the device conntecting to Discord's server.

func (HandshakeProperties) MarshalEasyJSON

func (v HandshakeProperties) MarshalEasyJSON(w *jwriter.Writer)

func (HandshakeProperties) MarshalJSON

func (v HandshakeProperties) MarshalJSON() ([]byte, error)

func (*HandshakeProperties) UnmarshalEasyJSON

func (v *HandshakeProperties) UnmarshalEasyJSON(l *jlexer.Lexer)

func (*HandshakeProperties) UnmarshalJSON

func (v *HandshakeProperties) UnmarshalJSON(data []byte) error

type ICEServer

type ICEServer struct {
	URL        string `json:"url"`
	Username   string `json:"username"`
	Credential string `json:"credential"`
}

A ICEServer stores data for a specific voice ICE server.

func (ICEServer) MarshalEasyJSON

func (v ICEServer) MarshalEasyJSON(w *jwriter.Writer)

func (ICEServer) MarshalJSON

func (v ICEServer) MarshalJSON() ([]byte, error)

func (*ICEServer) UnmarshalEasyJSON

func (v *ICEServer) UnmarshalEasyJSON(l *jlexer.Lexer)

func (*ICEServer) UnmarshalJSON

func (v *ICEServer) UnmarshalJSON(data []byte) error

type Invite

type Invite struct {
	Guild     *Guild   `json:"guild"`
	Channel   *Channel `json:"channel"`
	Inviter   *User    `json:"inviter"`
	Code      string   `json:"code"`
	CreatedAt string   `json:"created_at"` // TODO make timestamp
	MaxAge    int      `json:"max_age"`
	Uses      int      `json:"uses"`
	MaxUses   int      `json:"max_uses"`
	XkcdPass  bool     `json:"xkcdpass"`
	Revoked   bool     `json:"revoked"`
	Temporary bool     `json:"temporary"`
}

A Invite stores all data related to a specific Discord Guild or Channel invite.

func (Invite) MarshalEasyJSON

func (v Invite) MarshalEasyJSON(w *jwriter.Writer)

func (Invite) MarshalJSON

func (v Invite) MarshalJSON() ([]byte, error)

func (*Invite) UnmarshalEasyJSON

func (v *Invite) UnmarshalEasyJSON(l *jlexer.Lexer)

func (*Invite) UnmarshalJSON

func (v *Invite) UnmarshalJSON(data []byte) error

type Member

type Member struct {
	GuildID  string   `json:"guild_id"`
	JoinedAt string   `json:"joined_at"`
	Deaf     bool     `json:"deaf"`
	Mute     bool     `json:"mute"`
	User     *User    `json:"user"`
	Roles    []string `json:"roles"`
}

A Member stores user information for Guild members.

func (Member) MarshalEasyJSON

func (v Member) MarshalEasyJSON(w *jwriter.Writer)

func (Member) MarshalJSON

func (v Member) MarshalJSON() ([]byte, error)

func (*Member) UnmarshalEasyJSON

func (v *Member) UnmarshalEasyJSON(l *jlexer.Lexer)

func (*Member) UnmarshalJSON

func (v *Member) UnmarshalJSON(data []byte) error

type Message

type Message struct {
	ID              string        `json:"id"`
	ChannelID       string        `json:"channel_id"`
	Content         string        `json:"content"`
	Timestamp       string        `json:"timestamp"`
	EditedTimestamp string        `json:"edited_timestamp"`
	Tts             bool          `json:"tts"`
	MentionEveryone bool          `json:"mention_everyone"`
	Author          *User         `json:"author"`
	Attachments     []*Attachment `json:"attachments"`
	Embeds          []*Embed      `json:"embeds"`
	Mentions        []*User       `json:"mentions"`
}

A Message stores all data related to a specific Discord message.

func (Message) MarshalEasyJSON

func (v Message) MarshalEasyJSON(w *jwriter.Writer)

func (Message) MarshalJSON

func (v Message) MarshalJSON() ([]byte, error)

func (*Message) UnmarshalEasyJSON

func (v *Message) UnmarshalEasyJSON(l *jlexer.Lexer)

func (*Message) UnmarshalJSON

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

type MessageAck

type MessageAck struct {
	MessageID string `json:"message_id"`
	ChannelID string `json:"channel_id"`
}

A MessageAck stores data for the message ack websocket event.

func (MessageAck) MarshalEasyJSON

func (v MessageAck) MarshalEasyJSON(w *jwriter.Writer)

func (MessageAck) MarshalJSON

func (v MessageAck) MarshalJSON() ([]byte, error)

func (*MessageAck) UnmarshalEasyJSON

func (v *MessageAck) UnmarshalEasyJSON(l *jlexer.Lexer)

func (*MessageAck) UnmarshalJSON

func (v *MessageAck) UnmarshalJSON(data []byte) error

type PermissionOverwrite

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

A PermissionOverwrite holds permission overwrite data for a Channel

func (PermissionOverwrite) MarshalEasyJSON

func (v PermissionOverwrite) MarshalEasyJSON(w *jwriter.Writer)

func (PermissionOverwrite) MarshalJSON

func (v PermissionOverwrite) MarshalJSON() ([]byte, error)

func (*PermissionOverwrite) UnmarshalEasyJSON

func (v *PermissionOverwrite) UnmarshalEasyJSON(l *jlexer.Lexer)

func (*PermissionOverwrite) UnmarshalJSON

func (v *PermissionOverwrite) UnmarshalJSON(data []byte) error

type Presence

type Presence struct {
	User   *User  `json:"user"`
	Status string `json:"status"`
	Game   *Game  `json:"game"`
}

A Presence stores the online, offline, or idle and game status of Guild members.

func (Presence) MarshalEasyJSON

func (v Presence) MarshalEasyJSON(w *jwriter.Writer)

func (Presence) MarshalJSON

func (v Presence) MarshalJSON() ([]byte, error)

func (*Presence) UnmarshalEasyJSON

func (v *Presence) UnmarshalEasyJSON(l *jlexer.Lexer)

func (*Presence) UnmarshalJSON

func (v *Presence) UnmarshalJSON(data []byte) error

type PresenceUpdate

type PresenceUpdate struct {
	Status  string   `json:"status"`
	GuildID string   `json:"guild_id"`
	Roles   []string `json:"roles"`
	User    *User    `json:"user"`
	Game    *Game    `json:"game"`
}

A PresenceUpdate stores data for the presence update websocket event.

func (PresenceUpdate) MarshalEasyJSON

func (v PresenceUpdate) MarshalEasyJSON(w *jwriter.Writer)

func (PresenceUpdate) MarshalJSON

func (v PresenceUpdate) MarshalJSON() ([]byte, error)

func (*PresenceUpdate) UnmarshalEasyJSON

func (v *PresenceUpdate) UnmarshalEasyJSON(l *jlexer.Lexer)

func (*PresenceUpdate) UnmarshalJSON

func (v *PresenceUpdate) UnmarshalJSON(data []byte) error

type PresencesReplace

type PresencesReplace []*Presence

PresencesReplace is an array of Presences for an event.

func (*PresencesReplace) UnmarshalJSON

func (p *PresencesReplace) UnmarshalJSON(b []byte) error

type RateLimit

type RateLimit struct {
	Bucket     string        `json:"bucket"`
	Message    string        `json:"message"`
	RetryAfter time.Duration `json:"retry_after"`
}

A RateLimit struct holds information related to a specific rate limit.

func (RateLimit) MarshalEasyJSON

func (v RateLimit) MarshalEasyJSON(w *jwriter.Writer)

func (RateLimit) MarshalJSON

func (v RateLimit) MarshalJSON() ([]byte, error)

func (*RateLimit) UnmarshalEasyJSON

func (v *RateLimit) UnmarshalEasyJSON(l *jlexer.Lexer)

func (*RateLimit) UnmarshalJSON

func (v *RateLimit) UnmarshalJSON(data []byte) error

type ReadState

type ReadState struct {
	MentionCount  int    `json:"mention_count"`
	LastMessageID string `json:"last_message_id"`
	ID            string `json:"id"`
}

A ReadState stores data on the read state of channels.

func (ReadState) MarshalEasyJSON

func (v ReadState) MarshalEasyJSON(w *jwriter.Writer)

func (ReadState) MarshalJSON

func (v ReadState) MarshalJSON() ([]byte, error)

func (*ReadState) UnmarshalEasyJSON

func (v *ReadState) UnmarshalEasyJSON(l *jlexer.Lexer)

func (*ReadState) UnmarshalJSON

func (v *ReadState) UnmarshalJSON(data []byte) error

type Ready

type Ready struct {
	Version           int          `json:"v"`
	SessionID         string       `json:"session_id"`
	HeartbeatInterval uint         `json:"heartbeat_interval"`
	User              *User        `json:"user"`
	ReadState         []*ReadState `json:"read_state"`
	PrivateChannels   []*Channel   `json:"private_channels"`
	Guilds            []*Guild     `json:"guilds"`
}

A Ready stores all data for the websocket READY event.

func (Ready) MarshalEasyJSON

func (v Ready) MarshalEasyJSON(w *jwriter.Writer)

func (Ready) MarshalJSON

func (v Ready) MarshalJSON() ([]byte, error)

func (*Ready) UnmarshalEasyJSON

func (v *Ready) UnmarshalEasyJSON(l *jlexer.Lexer)

func (*Ready) UnmarshalJSON

func (v *Ready) UnmarshalJSON(data []byte) error

type Resume

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

Resume can be sent over the websocket to continue an existing session.

func (Resume) MarshalEasyJSON

func (v Resume) MarshalEasyJSON(w *jwriter.Writer)

func (Resume) MarshalJSON

func (v Resume) MarshalJSON() ([]byte, error)

func (*Resume) UnmarshalEasyJSON

func (v *Resume) UnmarshalEasyJSON(l *jlexer.Lexer)

func (*Resume) UnmarshalJSON

func (v *Resume) UnmarshalJSON(data []byte) error

type Resumed

type Resumed struct {
	HeartbeatInterval uint `json:"heartbeat_interval"`
}

Resumed is received after a successful Resume packet is sent.

func (Resumed) MarshalEasyJSON

func (v Resumed) MarshalEasyJSON(w *jwriter.Writer)

func (Resumed) MarshalJSON

func (v Resumed) MarshalJSON() ([]byte, error)

func (*Resumed) UnmarshalEasyJSON

func (v *Resumed) UnmarshalEasyJSON(l *jlexer.Lexer)

func (*Resumed) UnmarshalJSON

func (v *Resumed) UnmarshalJSON(data []byte) error

type Role

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

A Role stores information about Discord guild member roles.

func (Role) MarshalEasyJSON

func (v Role) MarshalEasyJSON(w *jwriter.Writer)

func (Role) MarshalJSON

func (v Role) MarshalJSON() ([]byte, error)

func (*Role) UnmarshalEasyJSON

func (v *Role) UnmarshalEasyJSON(l *jlexer.Lexer)

func (*Role) UnmarshalJSON

func (v *Role) UnmarshalJSON(data []byte) error

type Settings

type Settings struct {
	RenderEmbeds          bool     `json:"render_embeds"`
	InlineEmbedMedia      bool     `json:"inline_embed_media"`
	EnableTtsCommand      bool     `json:"enable_tts_command"`
	MessageDisplayCompact bool     `json:"message_display_compact"`
	ShowCurrentGame       bool     `json:"show_current_game"`
	Locale                string   `json:"locale"`
	Theme                 string   `json:"theme"`
	MutedChannels         []string `json:"muted_channels"`
}

A Settings stores data for a specific users Discord client settings.

func (Settings) MarshalEasyJSON

func (v Settings) MarshalEasyJSON(w *jwriter.Writer)

func (Settings) MarshalJSON

func (v Settings) MarshalJSON() ([]byte, error)

func (*Settings) UnmarshalEasyJSON

func (v *Settings) UnmarshalEasyJSON(l *jlexer.Lexer)

func (*Settings) UnmarshalJSON

func (v *Settings) UnmarshalJSON(data []byte) error

type TypingStart

type TypingStart struct {
	UserID    string `json:"user_id"`
	ChannelID string `json:"channel_id"`
	Timestamp int    `json:"timestamp"`
}

A TypingStart stores data for the typing start websocket event.

func (TypingStart) MarshalEasyJSON

func (v TypingStart) MarshalEasyJSON(w *jwriter.Writer)

func (TypingStart) MarshalJSON

func (v TypingStart) MarshalJSON() ([]byte, error)

func (*TypingStart) UnmarshalEasyJSON

func (v *TypingStart) UnmarshalEasyJSON(l *jlexer.Lexer)

func (*TypingStart) UnmarshalJSON

func (v *TypingStart) UnmarshalJSON(data []byte) error

type User

type User struct {
	ID            string `json:"id"`
	Email         string `json:"email"`
	Username      string `json:"username"`
	Avatar        string `json:"Avatar"`
	Discriminator string `json:"discriminator"`
	Token         string `json:"token"`
	Verified      bool   `json:"verified"`
	Bot           bool   `json:"bot"`
}

A User stores all data for an individual Discord user.

func (User) MarshalEasyJSON

func (v User) MarshalEasyJSON(w *jwriter.Writer)

func (User) MarshalJSON

func (v User) MarshalJSON() ([]byte, error)

func (*User) UnmarshalEasyJSON

func (v *User) UnmarshalEasyJSON(l *jlexer.Lexer)

func (*User) UnmarshalJSON

func (v *User) UnmarshalJSON(data []byte) error

type UserGuildSettings

type UserGuildSettings struct {
	SupressEveryone      bool                                `json:"suppress_everyone"`
	Muted                bool                                `json:"muted"`
	MobilePush           bool                                `json:"mobile_push"`
	MessageNotifications int                                 `json:"message_notifications"`
	GuildID              string                              `json:"guild_id"`
	ChannelOverrides     []*UserGuildSettingsChannelOverride `json:"channel_overrides"`
}

A UserGuildSettings stores data for a users guild settings.

func (UserGuildSettings) MarshalEasyJSON

func (v UserGuildSettings) MarshalEasyJSON(w *jwriter.Writer)

func (UserGuildSettings) MarshalJSON

func (v UserGuildSettings) MarshalJSON() ([]byte, error)

func (*UserGuildSettings) UnmarshalEasyJSON

func (v *UserGuildSettings) UnmarshalEasyJSON(l *jlexer.Lexer)

func (*UserGuildSettings) UnmarshalJSON

func (v *UserGuildSettings) UnmarshalJSON(data []byte) error

type UserGuildSettingsChannelOverride

type UserGuildSettingsChannelOverride struct {
	Muted                bool   `json:"muted"`
	MessageNotifications int    `json:"message_notifications"`
	ChannelID            string `json:"channel_id"`
}

A UserGuildSettingsChannelOverride stores data for a channel override for a users guild settings.

func (UserGuildSettingsChannelOverride) MarshalEasyJSON

func (v UserGuildSettingsChannelOverride) MarshalEasyJSON(w *jwriter.Writer)

func (UserGuildSettingsChannelOverride) MarshalJSON

func (v UserGuildSettingsChannelOverride) MarshalJSON() ([]byte, error)

func (*UserGuildSettingsChannelOverride) UnmarshalEasyJSON

func (v *UserGuildSettingsChannelOverride) UnmarshalEasyJSON(l *jlexer.Lexer)

func (*UserGuildSettingsChannelOverride) UnmarshalJSON

func (v *UserGuildSettingsChannelOverride) UnmarshalJSON(data []byte) error

type UserSettingsUpdate

type UserSettingsUpdate map[string]interface{}

UserSettingsUpdate is a map for an event.

func (*UserSettingsUpdate) UnmarshalJSON

func (u *UserSettingsUpdate) UnmarshalJSON(b []byte) error

type VerificationLevel

type VerificationLevel int

VerificationLevel type defination

const (
	VerificationLevelNone VerificationLevel = iota
	VerificationLevelLow
	VerificationLevelMedium
	VerificationLevelHigh
)

Constants for VerificationLevel levels from 0 to 3 inclusive

type VoiceICE

type VoiceICE struct {
	TTL     string       `json:"ttl"`
	Servers []*ICEServer `json:"servers"`
}

A VoiceICE stores data for voice ICE servers.

func (VoiceICE) MarshalEasyJSON

func (v VoiceICE) MarshalEasyJSON(w *jwriter.Writer)

func (VoiceICE) MarshalJSON

func (v VoiceICE) MarshalJSON() ([]byte, error)

func (*VoiceICE) UnmarshalEasyJSON

func (v *VoiceICE) UnmarshalEasyJSON(l *jlexer.Lexer)

func (*VoiceICE) UnmarshalJSON

func (v *VoiceICE) UnmarshalJSON(data []byte) error

type VoiceRegion

type VoiceRegion struct {
	ID       string `json:"id"`
	Name     string `json:"name"`
	Hostname string `json:"sample_hostname"`
	Port     int    `json:"sample_port"`
}

A VoiceRegion stores data for a specific voice region server.

func (VoiceRegion) MarshalEasyJSON

func (v VoiceRegion) MarshalEasyJSON(w *jwriter.Writer)

func (VoiceRegion) MarshalJSON

func (v VoiceRegion) MarshalJSON() ([]byte, error)

func (*VoiceRegion) UnmarshalEasyJSON

func (v *VoiceRegion) UnmarshalEasyJSON(l *jlexer.Lexer)

func (*VoiceRegion) UnmarshalJSON

func (v *VoiceRegion) UnmarshalJSON(data []byte) error

type VoiceServerUpdate

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

A VoiceServerUpdate stores the data received during the Voice Server Update data websocket event. This data is used during the initial Voice Channel join handshaking.

func (VoiceServerUpdate) MarshalEasyJSON

func (v VoiceServerUpdate) MarshalEasyJSON(w *jwriter.Writer)

func (VoiceServerUpdate) MarshalJSON

func (v VoiceServerUpdate) MarshalJSON() ([]byte, error)

func (*VoiceServerUpdate) UnmarshalEasyJSON

func (v *VoiceServerUpdate) UnmarshalEasyJSON(l *jlexer.Lexer)

func (*VoiceServerUpdate) UnmarshalJSON

func (v *VoiceServerUpdate) UnmarshalJSON(data []byte) error

type VoiceState

type VoiceState struct {
	UserID    string `json:"user_id"`
	SessionID string `json:"session_id"`
	ChannelID string `json:"channel_id"`
	GuildID   string `json:"guild_id"`
	Suppress  bool   `json:"suppress"`
	SelfMute  bool   `json:"self_mute"`
	SelfDeaf  bool   `json:"self_deaf"`
	Mute      bool   `json:"mute"`
	Deaf      bool   `json:"deaf"`
}

A VoiceState stores the voice states of Guilds

func (VoiceState) MarshalEasyJSON

func (v VoiceState) MarshalEasyJSON(w *jwriter.Writer)

func (VoiceState) MarshalJSON

func (v VoiceState) MarshalJSON() ([]byte, error)

func (*VoiceState) UnmarshalEasyJSON

func (v *VoiceState) UnmarshalEasyJSON(l *jlexer.Lexer)

func (*VoiceState) UnmarshalJSON

func (v *VoiceState) UnmarshalJSON(data []byte) error

Jump to

Keyboard shortcuts

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