fix(util): directly pass code, ticket to data struct

This commit is contained in:
rigormorrtiss 2021-08-29 11:42:23 +04:00
parent 512db258d5
commit 88e27fa413

View file

@ -129,13 +129,10 @@ func Login(s *discordgo.Session, email, password string) (*loginResponse, error)
// TOTP creates a new request to `/mfa/totp` endpoint for time-based one-time
// passcode for essential login information
func TOTP(s *discordgo.Session, code, ticket string) (*loginResponse, error) {
var data struct {
data := struct {
Code string `json:"code"`
Ticket string `json:"ticket"`
}
data.Code = code
data.Ticket = ticket
}{code, ticket}
e := discordgo.EndpointAuth + "mfa/totp"
resp, err := s.RequestWithBucketID("POST", e, data, e)
if err != nil {