Skip to content

Commit

Permalink
[Fix] 🐛 BingAPI Init nil Pointer adams549659584#406
Browse files Browse the repository at this point in the history
  • Loading branch information
Harry-zklcdc committed Apr 29, 2024
1 parent cfd8d3b commit c29d6b3
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions common/api/v1/func.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,13 @@ func init() {
common.Logger.Info("APIKEY: %s", apikey)
}
go func() {
globalChat = binglib.NewChat("").SetBingBaseUrl("http://localhost:" + common.PORT).SetSydneyBaseUrl("ws://localhost:" + common.PORT).SetBypassServer(common.BypassServer)
globalImage = binglib.NewImage("").SetBingBaseUrl("http://localhost:" + common.PORT).SetBypassServer(common.BypassServer)
time.Sleep(200 * time.Millisecond)
t, _ := getCookie("", "", "")
common.Logger.Info("BingAPI Ready!")
globalChat = binglib.NewChat(t).SetBingBaseUrl("http://localhost:" + common.PORT).SetSydneyBaseUrl("ws://localhost:" + common.PORT).SetBypassServer(common.BypassServer)
globalImage = binglib.NewImage(t).SetBingBaseUrl("http://localhost:" + common.PORT).SetBypassServer(common.BypassServer)
globalChat.SetCookies(t)
globalImage.SetCookies(t)
}()
}

Expand Down

0 comments on commit c29d6b3

Please sign in to comment.