Documentation
¶
Index ¶
- Constants
- func Version() string
- func VersionString() string
- type Attachment
- type CHANNEL_CREATE
- type CHANNEL_DELETE
- type CHANNEL_UPDATE
- type Callback
- type Channel
- type Connection
- type Creds
- type CredsError
- type Discord
- func (c Discord) AckMsg(msg Message) (err error)
- func (c *Discord) AddChan(gIdx int, ch Channel)
- func (c *Discord) AddGuild(g Guild)
- func (c *Discord) AddGuildRole(gIdx int, r Role)
- func (c Discord) Cache() *READY
- func (c Discord) Chan(guildID, name string) (Channel, error)
- func (c Discord) ChanDelete(chanID string) (err error)
- func (c Discord) ChanDeletePerms(chanID, permID string) (err error)
- func (c Discord) ChanEdit(chanID, name string, topic *string) (resp Channel, err error)
- func (c Discord) ChanID(guildID, name string) (string, error)
- func (c Discord) ChanInviteAllCreate(chanID string, age, uses *uint, temp, xkcd *bool, code *string) (Invite, error)
- func (c Discord) ChanInviteCreate(chanID string) (Invite, error)
- func (c Discord) ChanInviteValidate(chanID, code string) (Invite, error)
- func (c Discord) ChanInvites(chanID string) (resp []Invite, err error)
- func (c Discord) ChanReplacePerms(chanID string, ur userOrRole, allow, deny Perm) (err error)
- func (c *Discord) ChannelParseWS(event string, ch Channel)
- func (c *Discord) CreatePrivateChan(userID string) (resp Channel, err error)
- func (c Discord) DelMsg(msg Message) (err error)
- func (c Discord) Delete(url string) error
- func (c Discord) DeletePrivateChan(userID string) error
- func (c Discord) EditMsg(msg Message, newMsg string, usrs []User) (Message, error)
- func (c Discord) EditTextMsg(msg Message, newMsg string) (Message, error)
- func (c Discord) Gateway() (string, error)
- func (c Discord) Get(url string, resp interface{}) error
- func (c Discord) GetMsgs(chanID, before, after string, limit int) ([]Message, error)
- func (c Discord) GetMyGuilds() (resp []Guild, err error)
- func (c Discord) GetMyPrivateChans() (resp []Channel, err error)
- func (c Discord) Guild(name string) (Guild, error)
- func (c Discord) GuildAddBan(guildID, userID string, days int) (err error)
- func (c Discord) GuildAddNamedRole(guildID, name string) (resp Role, err error)
- func (c Discord) GuildAddRole(guildID string) (resp Role, err error)
- func (c *Discord) GuildBanParseWS(event string, b WSBan)
- func (c Discord) GuildBans(guildID string) (resp []User, err error)
- func (c Discord) GuildChanCreate(guildID, name, kind string) (resp Channel, err error)
- func (c Discord) GuildChannels(guildID string) (resp []Channel, err error)
- func (c Discord) GuildCreate(name, region string) (resp Guild, err error)
- func (c Discord) GuildDeleteRole(guildID, roleID string) (err error)
- func (c Discord) GuildEdit(guildID, name, region string) (resp Guild, err error)
- func (c Discord) GuildEditRole(guildID string, r Role) (resp Role, err error)
- func (c Discord) GuildEmbed(guildID string) (resp EmbedInfo, err error)
- func (c Discord) GuildFindMember(guildID, n string) ([]Member, error)
- func (c Discord) GuildID(name string) (string, error)
- func (c Discord) GuildIntegrations(guildID string) (resp []Integration, err error)
- func (c Discord) GuildInvitesList(guildID string) (resp []Invite, err error)
- func (c Discord) GuildLeave(guildID string) (err error)
- func (c Discord) GuildMemberEdit(guildID, userID string, roleIDs []string) (err error)
- func (c Discord) GuildMemberKick(guildID, userID string) (err error)
- func (c *Discord) GuildMemberParseWS(event string, m Member)
- func (c Discord) GuildMembers(guildID string) (resp []Member, err error)
- func (c *Discord) GuildParseWS(event string, g Guild)
- func (c Discord) GuildPruneInfo(guildID string, days int) (int, error)
- func (c Discord) GuildRemoveBan(guildID, userID string) (err error)
- func (c *Discord) GuildRoleParseWS(event string, r WSRole)
- func (c Discord) GuildRoles(guildID string) (resp []Role, err error)
- func (c Discord) Guilds() []Guild
- func (c Discord) InviteAccept(code string) (resp Invite, err error)
- func (c Discord) InviteInfo(code string) (resp Invite, err error)
- func (c Discord) InviteRevoke(code string) (err error)
- func (c Discord) Logout() (err error)
- func (c Discord) Patch(url string, req, resp interface{}) error
- func (c Discord) Post(url string, req, resp interface{}) error
- func (c Discord) PrivateChan(name string) (Channel, error)
- func (c *Discord) PrivateChanDelete(chanID string) (err error)
- func (c Discord) PrivateChanFromID(ID string) (Channel, error)
- func (c Discord) PrivateChanID(name string) (string, error)
- func (c *Discord) PrivateChannelParseWS(event string, ch Channel)
- func (c Discord) Put(url string, req interface{}) error
- func (c *Discord) RemChanIdx(gIdx, idx int)
- func (c *Discord) RemGuildIdx(idx int)
- func (c *Discord) RemGuildRoleIdx(gIdx, idx int)
- func (c Discord) SendMsg(message, chanID string, usrs []User) (Message, error)
- func (c Discord) SendRawMsg(message, chanID string, ids []string) (resp Message, err error)
- func (c Discord) SendTextMsg(message, chanID string) (Message, error)
- func (c Discord) SendTyping(chanID string) (err error)
- func (c Discord) SetMaxRuntime(amt time.Duration, expireMsg string)
- func (c Discord) SetUserSettings(s Setting) (err error)
- func (c Discord) Stop()
- func (c Discord) TutorialInfo() (req Tutorial, err error)
- func (c Discord) UserConnections() (req []Connection, err error)
- func (c Discord) UserSettings() (req Setting, err error)
- func (c Discord) VoiceIce() (resp Ice, err error)
- func (c Discord) VoiceRegions() (resp []Region, err error)
- func (c Discord) WSConnect(call *Callback) (err error)
- func (c Discord) WSInit(con *websocket.Conn, msgChan chan WSMsg)
- func (c *Discord) WSProcess(con *websocket.Conn, msgSend, msgRead chan WSMsg, CB *Callback)
- type Embed
- type EmbedInfo
- type EncodingFromError
- type EncodingToError
- type Entity
- type GUILD_BAN_ADD
- type GUILD_BAN_REMOVE
- type GUILD_CREATE
- type GUILD_DELETE
- type GUILD_INTEGRATIONS_UPDATE
- type GUILD_MEMBER_ADD
- type GUILD_MEMBER_REMOVE
- type GUILD_MEMBER_UPDATE
- type GUILD_ROLE_CREATE
- type GUILD_ROLE_DELETE
- type GUILD_ROLE_UPDATE
- type GUILD_UPDATE
- type Game
- type Guild
- type HTTPError
- type Heartbeat
- type IDNotFoundError
- type INIT
- type Ice
- type Integration
- type InvalidTypeError
- type Invite
- type MESSAGE_ACK
- type MESSAGE_CREATE
- type MESSAGE_DELETE
- type MESSAGE_UPDATE
- type Member
- type Message
- type MessageSend
- type NameNotFoundError
- type PRESENCE_UPDATE
- type Perm
- type PermOver
- type PermissionsError
- type PostError
- type PrivateChannel
- type Properties
- type READY
- type RateLimitError
- type ReadError
- type Region
- type Role
- type Server
- type Setting
- type State
- type TYPING_START
- type Thumbnail
- type TokenError
- type Tutorial
- type USER_SETTINGS_UPDATE
- type UnknownError
- type User
- type VOICE_STATE_UPDATE
- type Video
- type WSBan
- type WSMsg
- type WSPres
- type WSRole
- type WSVoiceState
Constants ¶
const ( APIURL = "https://discordapp.com/api" GatewayURL = APIURL + "/gateway" AuthURL = APIURL + "/auth" LoginURL = AuthURL + "/login" //post LogoutURL = AuthURL + "/logout" //post RegisterURL = AuthURL + "/register" VerifyURL = AuthURL + "/verify" VerifyResendURL = VerifyURL + "/resend" ForgotURL = AuthURL + "/forgot" ResetURL = AuthURL + "/reset" InviteURL = APIURL + "/invite/%s" //invite ID (get forinfo, post to accept) GuildsURL = APIURL + "/guilds" //get for list, post for new, patch for edit) GuildIDURL = GuildsURL + "/%s" //guild (server) ID GuildBansURL = GuildIDURL + "/bans" GuildBanIDURL = GuildBansURL + "/%s" GuildMembersURL = GuildIDURL + "/members" // get (being removed) GuildMemberIDURL = GuildMembersURL + "/%s" GuildRolesURL = GuildIDURL + "/roles" // get, patch GuildRoleIDURL = GuildRolesURL + "/%s" // get?, put?, patch GuildChansURL = GuildIDURL + "/channels" // get GuildInvitesURL = GuildIDURL + "/invites" GuildPruneURL = GuildIDURL + "/prune" GuildEmbedURL = GuildIDURL + "/embed" GuildIntegrationsURL = GuildIDURL + "/integrations" ChansURL = APIURL + "/channels" // chanID ChanIDURL = ChansURL + "/%s" // chanID ChanMsgsURL = ChanIDURL + "/messages" // chanID (get) MsgURL = ChanMsgsURL + "/%s" //channel ID, message ID (Patch edit, delete del) MsgAckURL = MsgURL + "/ack" //channel ID, message ID (Post) ChanInviteURL = ChanIDURL + "/invites" // chanID ChanTypingURL = ChanIDURL + "/typing" // chanID (post only) ChanPermsURL = ChanIDURL + "/permissions" // chanID ChanPermIDURL = ChanPermsURL + "/%s" // chanID, permID UsersURL = APIURL + "/users" //invite ID UserIDURL = UsersURL + "/%s" // user ID UserChansURL = UserIDURL + "/channels" //(get chans) UserGuildsURL = UserIDURL + "/guilds" // get UserAvatarsURL = UserIDURL + "/avatars" // get UserAvatarIDURL = UserAvatarsURL + "/%s" // avatar ID MyURL = UsersURL + "/@me" MySettingsURL = MyURL + "/settings" // get MyDevicesURL = MyURL + "/devices" // get MyConnectionsURL = MyURL + "/connections" // get MyChansURL = MyURL + "/channels" MyGuildsURL = MyURL + "/guilds" VoiceURL = APIURL + "/voice" VoiceRegionsURL = VoiceURL + "/regions" VoiceIceURL = VoiceURL + "/ice" TutorialURL = APIURL + "/tutorial" TutorialIndURL = TutorialURL + "/indicators" )
Variables ¶
This section is empty.
Functions ¶
func VersionString ¶
func VersionString() string
Types ¶
type Attachment ¶
type Attachment struct { URL string `json:"url"` //URL of downloadable object ProxyURL string `json:"proxy_url"` //URL of ? Size int `json:"size"` //size in bytes ID string `json:"id"` //id of attachment Filename string `json:"filename"` //filename Width int `json:"width,omitempty"` //image width Height int `json:"height,omitempty"` //image height }
type CHANNEL_CREATE ¶
type CHANNEL_CREATE Channel
type CHANNEL_DELETE ¶
type CHANNEL_DELETE Channel
type CHANNEL_UPDATE ¶
type CHANNEL_UPDATE Channel
type Channel ¶
type Channel struct { GuildID string `json:"guild_id,omitempty"` Name string `json:"name,omitempty"` Permissions []PermOver `json:"permission_overwrites,omitempty"` Topic *string `json:"topic,omitempty"` // can be null Position int `json:"position,omitempty"` LastMsgID *string `json:"last_message_id"` // can be null Recipient *User `json:"recipient,omitempty"` //only exists if private Type string `json:"type,omitempty"` //only exists if not private (text|voice) ID string `json:"id"` Private bool `json:"is_private"` }
type Connection ¶
type Connection struct { Integrations []Integration `json:"integrations"` Revoked bool `json:"revoked"` Type string `json:"type"` ID string `json:"id"` Name string `json:"name"` }
type CredsError ¶
type CredsError Creds
func (CredsError) Error ¶
func (e CredsError) Error() string
type Discord ¶
type Discord struct { Client *http.Client Token string LoggingIn bool Me *User // contains filtered or unexported fields }
func (*Discord) AddGuildRole ¶
func (Discord) ChanDelete ¶
func (Discord) ChanDeletePerms ¶
func (Discord) ChanInviteAllCreate ¶
func (c Discord) ChanInviteAllCreate(chanID string, age, uses *uint, temp, xkcd *bool, code *string) (Invite, error)
{"max_age":1800,"max_uses":0,"temporary":false,"xkcdpass":true} defaults: 1 day, 0, false, false TODO Disallow validate if anything else is there
func (Discord) ChanInviteValidate ¶
func (Discord) ChanReplacePerms ¶
func (*Discord) ChannelParseWS ¶
func (*Discord) CreatePrivateChan ¶
* Pehaps not 100% POST compliant, but creates channel if it doesn't already exist * on a different URL
func (Discord) DeletePrivateChan ¶
* Note that this does not remove message history; only removes the channel from * the list of private chats you have open. * The current implementation is to find it in our cache, then delete it using DeleteChannel(). * This could change in the future.
func (Discord) EditTextMsg ¶
func (Discord) GetMyGuilds ¶
func (Discord) GetMyPrivateChans ¶
func (Discord) GuildAddBan ¶
func (Discord) GuildAddNamedRole ¶
func (*Discord) GuildBanParseWS ¶
func (Discord) GuildChanCreate ¶
func (Discord) GuildChannels ¶
func (Discord) GuildCreate ¶
func (Discord) GuildDeleteRole ¶
func (Discord) GuildEditRole ¶
func (Discord) GuildFindMember ¶
func (Discord) GuildIntegrations ¶
func (c Discord) GuildIntegrations(guildID string) (resp []Integration, err error)
func (Discord) GuildInvitesList ¶
func (Discord) GuildLeave ¶
func (Discord) GuildMemberEdit ¶
func (Discord) GuildMemberKick ¶
func (*Discord) GuildMemberParseWS ¶
func (Discord) GuildMembers ¶
now use cache instead
func (*Discord) GuildParseWS ¶
func (Discord) GuildPruneInfo ¶
func (Discord) GuildRemoveBan ¶
func (*Discord) GuildRoleParseWS ¶
func (Discord) InviteInfo ¶
validation of code returns full invite
func (Discord) InviteRevoke ¶
func (*Discord) PrivateChanDelete ¶
func (*Discord) PrivateChannelParseWS ¶
func (*Discord) RemChanIdx ¶
func (*Discord) RemGuildIdx ¶
func (*Discord) RemGuildRoleIdx ¶
func (Discord) SendRawMsg ¶
TODO: for 0.7.1, add abiltity to change TTS TODO: for 0.7.1, change to use <@ID> only For now, this means SendTextMsg is a workaround
func (Discord) SendTyping ¶
func (Discord) SetUserSettings ¶
func (Discord) TutorialInfo ¶
func (Discord) UserConnections ¶
func (c Discord) UserConnections() (req []Connection, err error)
func (Discord) UserSettings ¶
func (Discord) VoiceRegions ¶
type Embed ¶
type Embed struct { Desc *string `json:"description"` Author *Entity `json:"author,omitempty"` URL string `json:"url"` Title *string `json:"title"` Provider *Entity `json:"provider,omitempty"` Type string `json:"type"` Thumb *Thumbnail `json:"thumbnail,omitempty"` Video *Video `json:"video,omitempty"` }
type EncodingFromError ¶
type EncodingFromError string
func (EncodingFromError) Error ¶
func (e EncodingFromError) Error() string
type EncodingToError ¶
type EncodingToError string
func (EncodingToError) Error ¶
func (e EncodingToError) Error() string
type GUILD_BAN_ADD ¶
type GUILD_BAN_ADD WSBan
type GUILD_BAN_REMOVE ¶
type GUILD_BAN_REMOVE WSBan
type GUILD_CREATE ¶
type GUILD_CREATE Guild
type GUILD_DELETE ¶
type GUILD_DELETE Guild
type GUILD_INTEGRATIONS_UPDATE ¶
type GUILD_INTEGRATIONS_UPDATE struct {
GuildID string `json:"guild_id"`
}
type GUILD_MEMBER_ADD ¶
type GUILD_MEMBER_ADD Member
type GUILD_MEMBER_REMOVE ¶
type GUILD_MEMBER_REMOVE Member
type GUILD_MEMBER_UPDATE ¶
type GUILD_MEMBER_UPDATE Member
type GUILD_ROLE_CREATE ¶
func (GUILD_ROLE_CREATE) GetGuildID ¶
func (m GUILD_ROLE_CREATE) GetGuildID() string
func (GUILD_ROLE_CREATE) GetRole ¶
func (m GUILD_ROLE_CREATE) GetRole() Role
func (GUILD_ROLE_CREATE) GetRoleID ¶
func (m GUILD_ROLE_CREATE) GetRoleID() string
type GUILD_ROLE_DELETE ¶
func (GUILD_ROLE_DELETE) GetGuildID ¶
func (m GUILD_ROLE_DELETE) GetGuildID() string
func (GUILD_ROLE_DELETE) GetRole ¶
func (m GUILD_ROLE_DELETE) GetRole() Role
func (GUILD_ROLE_DELETE) GetRoleID ¶
func (m GUILD_ROLE_DELETE) GetRoleID() string
type GUILD_ROLE_UPDATE ¶
func (GUILD_ROLE_UPDATE) GetGuildID ¶
func (m GUILD_ROLE_UPDATE) GetGuildID() string
func (GUILD_ROLE_UPDATE) GetRole ¶
func (m GUILD_ROLE_UPDATE) GetRole() Role
func (GUILD_ROLE_UPDATE) GetRoleID ¶
func (m GUILD_ROLE_UPDATE) GetRoleID() string
type GUILD_UPDATE ¶
type GUILD_UPDATE Guild
type Guild ¶
type Guild struct { VoiceStates []WSVoiceState `json:"voice_states"` //only READY Roles []Role `json:"roles"` Region string `json:"region"` Presences []WSPres `json:"presences"` // only READY OwnerID string `json:"owner_id"` Name string `json:"name"` //Large bool `json:"large"` //only READY Members []Member `json:"members"` //only READY JoinedAt time.Time `json:"joined_at"` ID string `json:"id"` Icon *string `json:"icon"` Channels []Channel `json:"channels"` // only READY AfkTimeout uint64 `json:"afk_timeout"` AfkChannelID *string `json:"afk_channel_id"` }
func (*Guild) RemMemberIdx ¶
type IDNotFoundError ¶
type IDNotFoundError string
func (IDNotFoundError) Error ¶
func (c IDNotFoundError) Error() string
type INIT ¶
type INIT struct { Token string `json:"token"` Version int `json:"v"` Properties *Properties `json:"properties,omitempty"` LargeThresh int `json:"large_threshold,omitempty"` Compress bool `json:"compress,omitempty"` }
type Integration ¶
type Integration string
type InvalidTypeError ¶
type InvalidTypeError string
func (InvalidTypeError) Error ¶
func (e InvalidTypeError) Error() string
type Invite ¶
type Invite struct { MaxAge int `json:"max_age"` Code string `json:"code"` Guild struct { ID string `json:"id"` Name string `json:"name"` } `json:"guild"` Revoked bool `json:"revoked"` CreatedAt time.Time `json:"created_at"` Temporary bool `json:"temporary"` Uses int `json:"uses"` MaxUses int `json:"max_uses"` Inviter User `json:"inviter"` XKCDpass *string `json:"xkcdpass"` Chan Channel `json:"channel"` }
type MESSAGE_ACK ¶
type MESSAGE_CREATE ¶
type MESSAGE_CREATE Message
func (*MESSAGE_CREATE) UnmarshalJSON ¶
func (m *MESSAGE_CREATE) UnmarshalJSON(raw []byte) (err error)
type MESSAGE_DELETE ¶
type MESSAGE_DELETE Message
type MESSAGE_UPDATE ¶
type MESSAGE_UPDATE Message
type Message ¶
type Message struct { Nonce int64 `json:"nonce,string,omitempty"` //only used when sending messages Attachments []Attachment `json:"attachments"` Tts bool `json:"tts"` Embeds []Embed `json:"embeds"` Timestamp time.Time `json:"timestamp"` MentionAll bool `json:"mention_everyone"` ID string `json:"id"` EditedTime *time.Time `json:"edited_timestamp"` //can be null (not worth seperate struct member) Author User `json:"author"` Content string `json:"content"` ChanID string `json:"channel_id"` //including json tag magic to have it look for both, and ignore whichever one doesn't exist. Mentions []User `json:"mentions,omitempty"` // Users (only receved) }
type MessageSend ¶
type MessageSend struct { Content string `json:"content"` Mentions []string `json:"mentions,omitempty"` //deprecatd Nonce int64 `json:"nonce,string"` Tts bool `json:"tts"` }
Only reason not to remove this is its used evey time we create a message. Theoretically, we could use Message instead, and have the other fields of the struct set to omit from the json if empty, but that would just make everything annoying to read, so this stays seperate for now.
type NameNotFoundError ¶
type NameNotFoundError string
func (NameNotFoundError) Error ¶
func (c NameNotFoundError) Error() string
type PRESENCE_UPDATE ¶
type PRESENCE_UPDATE map[string]interface{}
type Perm ¶
type Perm struct { CreateInstantInvite bool KickMembers bool BanMembers bool ManageRoles bool ManageChannels bool ManageGuild bool // Text ReadMessages bool SendMessages bool SendTssMessages bool ManageMessages bool EmbedLinks bool AttachFiles bool ReadMessageHistory bool MentionEveryone bool // Voice Connect bool Speak bool MuteMembers bool DeafenMembers bool MoveMembers bool UseVad bool }
func (Perm) MarshalJSON ¶
func (*Perm) UnmarshalJSON ¶
type PermissionsError ¶
type PermissionsError string
func (PermissionsError) Error ¶
func (e PermissionsError) Error() string
type PrivateChannel ¶
type Properties ¶
type READY ¶
type READY struct { Version int `json:"v"` User User `json:"user"` SessionId string `json:"session_id"` //SessionId int `json:"session_id"`//testing error ReadState []State `json:"read_state"` PrivateChannels []Channel `json:"private_channels"` HeartbeatInterval uint64 `json:"heartbeat_interval"` Guilds []Guild `json:"guilds"` }
TODO add compression
type RateLimitError ¶
func (RateLimitError) Error ¶
func (e RateLimitError) Error() string
type Role ¶
type Setting ¶
type Setting struct { RenderEmbeds *bool `json:"render_embeds,omitempty"` InlineEmbedMedia *bool `json:"inline_embed_media,omitempty"` EnableTTSCmd *bool `json:"enable_tts_command,omitempty"` MsgDispCompact *bool `json:"message_display_compact,omitempty"` Locale string `json:"locale,omitempty"` ShowCurrentGame *bool `json:"show_current_game,omitempty"` Theme string `json:"theme,omitempty"` // emptystring should not be sent MutedChanIDs []string `json:"muted_channels,omitempty"` InlineAttachMedia *bool `json:"inline_attachment_media,omitempty"` }
type TYPING_START ¶
type TokenError ¶
type TokenError string
func (TokenError) Error ¶
func (e TokenError) Error() string
type USER_SETTINGS_UPDATE ¶
type USER_SETTINGS_UPDATE Setting
type UnknownError ¶
type UnknownError string
func (UnknownError) Error ¶
func (e UnknownError) Error() string
type User ¶
type User struct { Verified bool `json:"verified,omitempty"` //only for WS Username string `json:"username"` Email string `json:"email,omitempty"` //only for WS Discriminator string `json:"-"` //4 digits ID string `json:"id"` Avatar *string `json:"avatar"` // hex string (can be null) }
func (*User) UnmarshalJSON ¶
type VOICE_STATE_UPDATE ¶
type VOICE_STATE_UPDATE WSVoiceState
type WSBan ¶
* means unparsed + means implemented with cache x means not planning to implement - means eventual new event = means not fully impemented ? means possible new event
+CHANNEL_CREATE ?CHANNEL_CREATE (private) +CHANNEL_DELETE ?CHANNEL_DELETE (private) +CHANNEL_UPDATE +GUILD_CREATE -GUILD_CREATE (unavailable) +GUILD_DELETE -GUILD_DELETE (unavailable) +GUILD_UPDATE =GUILD_BAN_ADD =GUILD_BAN_REMOVE +GUILD_MEMBER_ADD +GUILD_MEMBER_REMOVE +GUILD_MEMBER_UPDATE +GUILD_ROLE_CREATE +GUILD_ROLE_DELETE +GUILD_ROLE_UPDATE GUILD_INTEGRATIONS_UPDATE MESSAGE_CREATE MESSAGE_DELETE MESSAGE_UPDATE MESSAGE_UPDATE (embeds only) +PRESENCE_UPDATE +READY xTYPING_START //pointless for bots? USER_SETTINGS_UPDATE //unsure if this is really needed VOICE_STATE_UPDATE xMESSAGE_ACK //unimportant,clients only OP 7
type WSMsg ¶
type WSMsg struct { Type string `json:"t,omitempty"` Seq int `json:"s,omitempty"` Op int `json:"op"` Data interface{} `json:"d"` //deferred until we know what it is. // contains filtered or unexported fields }
func (*WSMsg) UnmarshalJSON ¶
type WSPres ¶
type WSVoiceState ¶
type WSVoiceState struct { UserID string `json:"user_id"` Token string `json:"token"` Suppress bool `json:"suppress"` SessionID string `json:"session_id"` SelfMute *bool `json:"self_mute"` SelfDeaf *bool `json:"self_deaf"` Mute bool `json:"mute"` Deaf bool `json:"deaf"` ChannelID *string `json:"channel_id"` GuildID string `json:"guild_id"` }