From 06b35cfe248ad7ee3cbfa77e8dcab8f2bc61f9bf Mon Sep 17 00:00:00 2001 From: Bruce Date: Sun, 3 Sep 2017 20:01:46 +0000 Subject: [PATCH] Linting. --- endpoints.go | 6 +++--- message.go | 2 ++ state.go | 2 +- structs.go | 3 +++ wsapi.go | 2 +- 5 files changed, 10 insertions(+), 5 deletions(-) diff --git a/endpoints.go b/endpoints.go index 5c1d71d..b10f958 100644 --- a/endpoints.go +++ b/endpoints.go @@ -11,8 +11,8 @@ package discordgo -// The Discord API version used for the REST and Websocket API. -var ApiVersion = "6" +// APIVersion is the Discord API version used for the REST and Websocket API. +var APIVersion = "6" // Known Discord API Endpoints. var ( @@ -22,7 +22,7 @@ var ( EndpointSmUpcoming = EndpointSm + "upcoming.json" EndpointDiscord = "https://discordapp.com/" - EndpointAPI = EndpointDiscord + "api/v" + ApiVersion + "/" + EndpointAPI = EndpointDiscord + "api/v" + APIVersion + "/" EndpointGuilds = EndpointAPI + "guilds/" EndpointChannels = EndpointAPI + "channels/" EndpointUsers = EndpointAPI + "users/" diff --git a/message.go b/message.go index 5232e83..19345b9 100644 --- a/message.go +++ b/message.go @@ -15,8 +15,10 @@ import ( "strings" ) +// MessageType is the type of Message type MessageType int +// Block contains the valid known MessageType values const ( MessageTypeDefault MessageType = iota MessageTypeRecipientAdd diff --git a/state.go b/state.go index 7627796..35a8e75 100644 --- a/state.go +++ b/state.go @@ -782,7 +782,7 @@ func (s *State) onReady(se *Session, r *Ready) (err error) { return nil } -// onInterface handles all events related to states. +// OnInterface handles all events related to states. func (s *State) OnInterface(se *Session, i interface{}) (err error) { if s == nil { return ErrNilState diff --git a/structs.go b/structs.go index 5dde7aa..c3e3956 100644 --- a/structs.go +++ b/structs.go @@ -148,8 +148,10 @@ type Invite struct { Temporary bool `json:"temporary"` } +// ChannelType is the type of a Channel type ChannelType int +// Block contains known ChannelType values const ( ChannelTypeGuildText ChannelType = iota ChannelTypeDM @@ -604,6 +606,7 @@ const ( PermissionAdministrator ) +// Block contains Discord JSON Error Response codes const ( ErrCodeUnknownAccount = 10001 ErrCodeUnknownApplication = 10002 diff --git a/wsapi.go b/wsapi.go index ab37b5a..df87092 100644 --- a/wsapi.go +++ b/wsapi.go @@ -86,7 +86,7 @@ func (s *Session) Open() (err error) { } // Add the version and encoding to the URL - s.gateway = s.gateway + "?v=" + ApiVersion + "&encoding=json" + s.gateway = s.gateway + "?v=" + APIVersion + "&encoding=json" } header := http.Header{}