Documentation
¶
Index ¶
Constants ¶
View Source
const StateLength = 32
StateLength is the integer number of characters that every state string will container
View Source
const UserEndpoint = "https://discord.com/api/oauth2/@me"
UserEndpoint is the endpoint to request when fetching Discord user data
Variables ¶
View Source
var Config = &oauth2.Config{ ClientID: config.Web.OAuth.ClientID, ClientSecret: config.Web.OAuth.ClientSecret, Endpoint: oauth2.Endpoint{ AuthURL: "https://discord.com/api/oauth2/authorize", TokenURL: "https://discord.com/api/oauth2/token", AuthStyle: oauth2.AuthStyleInParams, }, RedirectURL: config.Web.Domain().String() + "/auth/callback", Scopes: []string{"identify"}, }
Functions ¶
Types ¶
type User ¶
type User struct {
AvatarHash string `json:"avatar"`
DisplayName string `json:"global_name"`
ID string `json:"id"`
Username string `json:"username"`
}
User holds information about a Discord user
type UserEndpointPayload ¶
type UserEndpointPayload struct {
User User `json:"user"`
}
UserEndpointPayload wraps the JSON response from Discord when requesting UserEndpoint
Click to show internal directories.
Click to hide internal directories.