Bruce 7 years ago
parent
commit
06b35cfe24
5 changed files with 10 additions and 5 deletions
  1. 3 3
      endpoints.go
  2. 2 0
      message.go
  3. 1 1
      state.go
  4. 3 0
      structs.go
  5. 1 1
      wsapi.go

+ 3 - 3
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/"

+ 2 - 0
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

+ 1 - 1
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

+ 3 - 0
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

+ 1 - 1
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{}