Skip to content

Commit c29d6b3

Browse files
committed
[Fix] 🐛 BingAPI Init nil Pointer #406
1 parent cfd8d3b commit c29d6b3

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

common/api/v1/func.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,13 @@ func init() {
2323
common.Logger.Info("APIKEY: %s", apikey)
2424
}
2525
go func() {
26+
globalChat = binglib.NewChat("").SetBingBaseUrl("http://localhost:" + common.PORT).SetSydneyBaseUrl("ws://localhost:" + common.PORT).SetBypassServer(common.BypassServer)
27+
globalImage = binglib.NewImage("").SetBingBaseUrl("http://localhost:" + common.PORT).SetBypassServer(common.BypassServer)
2628
time.Sleep(200 * time.Millisecond)
2729
t, _ := getCookie("", "", "")
2830
common.Logger.Info("BingAPI Ready!")
29-
globalChat = binglib.NewChat(t).SetBingBaseUrl("http://localhost:" + common.PORT).SetSydneyBaseUrl("ws://localhost:" + common.PORT).SetBypassServer(common.BypassServer)
30-
globalImage = binglib.NewImage(t).SetBingBaseUrl("http://localhost:" + common.PORT).SetBypassServer(common.BypassServer)
31+
globalChat.SetCookies(t)
32+
globalImage.SetCookies(t)
3133
}()
3234
}
3335

0 commit comments

Comments
 (0)