Explorar el Código

Add DiscordBot user agent

Guillaume Desvé hace 9 años
padre
commit
ec31caac1b
Se han modificado 1 ficheros con 1 adiciones y 0 borrados
  1. 1 0
      restapi.go

+ 1 - 0
restapi.go

@@ -44,6 +44,7 @@ func (s *Session) Request(method, urlStr string, data interface{}) (response []b
 	}
 
 	req.Header.Set("Content-Type", "application/json")
+	req.Header.Set("User-Agent", "DiscordBot (https://github.com/bwmarrin/discordgo, v0.0.0)")
 	client := &http.Client{Timeout: (20 * time.Second)}
 
 	resp, err := client.Do(req)