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

Compare commits

..

No commits in common. "8561e2bd51708aa277c29bf1494a1c00777398b3" and "8e02b1652ca0129bf4775c972aced463ef7fcaba" have entirely different histories.

2 changed files with 4 additions and 21 deletions

View file

@ -58,12 +58,10 @@ type SessionStartLimit struct {
func URL() (string, error) {
var g BotData
c := httputil.NewClient()
if err := c.RequestJSON(&g, "GET", EndpointGateway); err != nil {
return "", err
}
return g.URL, nil
return g.URL, httputil.NewClient().RequestJSON(
&g, "GET",
EndpointGateway,
)
}
// BotURL fetches the Gateway URL along with extra metadata. The token

View file

@ -21,21 +21,6 @@ func init() {
}
}
func TestURL(t *testing.T) {
u, err := URL()
if err != nil {
t.Fatal("failed to get gateway URL:", err)
}
if u == "" {
t.Fatal("gateway URL is empty")
}
if !strings.HasPrefix(u, "wss://") {
t.Fatal("gatewayURL is invalid:", u)
}
}
func TestInvalidToken(t *testing.T) {
g, err := NewGateway("bad token")
if err != nil {