1
0
Fork 0
mirror of https://github.com/diamondburned/arikawa.git synced 2025-07-26 07:20:50 +00:00

Compare commits

...

3 commits

Author SHA1 Message Date
dependabot[bot] 4662d7efbe
Merge b20a4a4a58 into 7824d15d26 2025-06-08 08:49:28 +00:00
ayn2op 7824d15d26 feat(api): add fields to LoginResponse 2025-05-15 10:38:23 -07:00
dependabot[bot] b20a4a4a58
build(deps): bump golang.org/x/crypto in the go_modules group
Bumps the go_modules group with 1 update: [golang.org/x/crypto](https://github.com/golang/crypto).


Updates `golang.org/x/crypto` from 0.32.0 to 0.35.0
- [Commits](https://github.com/golang/crypto/compare/v0.32.0...v0.35.0)

---
updated-dependencies:
- dependency-name: golang.org/x/crypto
  dependency-version: 0.35.0
  dependency-type: direct:production
  dependency-group: go_modules
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-04-14 19:07:20 +00:00
3 changed files with 30 additions and 13 deletions

View file

@ -1,6 +1,9 @@
package api
import "github.com/diamondburned/arikawa/v3/utils/httputil"
import (
"github.com/diamondburned/arikawa/v3/discord"
"github.com/diamondburned/arikawa/v3/utils/httputil"
)
var (
EndpointAuth = Endpoint + "auth/"
@ -8,12 +11,25 @@ var (
EndpointTOTP = EndpointAuth + "mfa/totp"
)
type LoginResponse struct {
MFA bool `json:"mfa"`
SMS bool `json:"sms"`
Ticket string `json:"ticket"`
Token string `json:"token"`
}
type (
LoginSettings struct {
Locale discord.Language `json:"locale"`
Theme string `json:"theme"`
}
LoginResponse struct {
UserID discord.UserID `json:"user_id"`
Token string `json:"token"`
UserSettings LoginSettings `json:"user_settings"`
RequiredActions []string `json:"required_actions"`
Ticket string `json:"ticket"`
MFA bool `json:"mfa"`
TOTP bool `json:"totp"`
SMS bool `json:"sms"`
Backup bool `json:"backup"`
}
)
// login is the user's email or E.164-formatted phone number
func (c *Client) Login(login, password string) (*LoginResponse, error) {

5
go.mod
View file

@ -1,12 +1,13 @@
module github.com/diamondburned/arikawa/v3
go 1.23
toolchain go1.24.1
require (
github.com/gorilla/schema v1.4.1
github.com/gorilla/websocket v1.5.3
golang.org/x/crypto v0.32.0
golang.org/x/crypto v0.35.0
golang.org/x/time v0.10.0
)
require golang.org/x/sys v0.29.0 // indirect
require golang.org/x/sys v0.30.0 // indirect

8
go.sum
View file

@ -2,9 +2,9 @@ github.com/gorilla/schema v1.4.1 h1:jUg5hUjCSDZpNGLuXQOgIWGdlgrIdYvgQ0wZtdK1M3E=
github.com/gorilla/schema v1.4.1/go.mod h1:Dg5SSm5PV60mhF2NFaTV1xuYYj8tV8NOPRo4FggUMnM=
github.com/gorilla/websocket v1.5.3 h1:saDtZ6Pbx/0u+bgYQ3q96pZgCzfhKXGPqt7kZ72aNNg=
github.com/gorilla/websocket v1.5.3/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
golang.org/x/crypto v0.32.0 h1:euUpcYgM8WcP71gNpTqQCn6rC2t6ULUPiOzfWaXVVfc=
golang.org/x/crypto v0.32.0/go.mod h1:ZnnJkOaASj8g0AjIduWNlq2NRxL0PlBrbKVyZ6V/Ugc=
golang.org/x/sys v0.29.0 h1:TPYlXGxvx1MGTn2GiZDhnjPA9wZzZeGKHHmKhHYvgaU=
golang.org/x/sys v0.29.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/crypto v0.35.0 h1:b15kiHdrGCHrP6LvwaQ3c03kgNhhiMgvlhxHQhmg2Xs=
golang.org/x/crypto v0.35.0/go.mod h1:dy7dXNW32cAb/6/PRuTNsix8T+vJAqvuIy5Bli/x0YQ=
golang.org/x/sys v0.30.0 h1:QjkSwP/36a20jFYWkSue1YwXzLmsV5Gfq7Eiy72C1uc=
golang.org/x/sys v0.30.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/time v0.10.0 h1:3usCWA8tQn0L8+hFJQNgzpWbd89begxN66o1Ojdn5L4=
golang.org/x/time v0.10.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM=