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.
8561e2bd51
...
8e02b1652c
|
@ -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
|
||||
|
|
|
@ -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 {
|
||||
|
|
Loading…
Reference in a new issue