diff --git a/cmd/state.go b/cmd/state.go index 0e4bd1e..653188c 100644 --- a/cmd/state.go +++ b/cmd/state.go @@ -7,7 +7,6 @@ import ( "github.com/ayn2op/discordo/internal/http" "github.com/ayn2op/discordo/internal/notifications" "github.com/ayn2op/tview" - "github.com/diamondburned/arikawa/v3/api" "github.com/diamondburned/arikawa/v3/gateway" "github.com/diamondburned/arikawa/v3/session" "github.com/diamondburned/arikawa/v3/state" @@ -22,8 +21,6 @@ import ( func openState(token string) error { identifyProps := http.IdentifyProperties() - - api.UserAgent = http.BrowserUserAgent gateway.DefaultIdentity = identifyProps gateway.DefaultPresence = &gateway.UpdatePresenceCommand{ Status: app.cfg.Status, diff --git a/internal/http/client.go b/internal/http/client.go index fcf6d25..c1303c2 100644 --- a/internal/http/client.go +++ b/internal/http/client.go @@ -12,5 +12,7 @@ func NewClient(token string) *api.Client { stdClient := http.DefaultClient stdClient.Transport = NewTransport() httpClient := httputil.NewClientWithDriver(httpdriver.WrapClient(*stdClient)) - return api.NewCustomClient(token, httpClient) + apiClient := api.NewCustomClient(token, httpClient) + apiClient.UserAgent = BrowserUserAgent + return apiClient }