mirror of
https://github.com/fumiama/NanoBot.git
synced 2026-06-15 16:01:01 +08:00
fix b.client nil pointer
This commit is contained in:
2
bot.go
2
bot.go
@@ -48,7 +48,7 @@ type Bot struct {
|
|||||||
// getinitinfo 获得 gateway 和 shard
|
// getinitinfo 获得 gateway 和 shard
|
||||||
func (b *Bot) getinitinfo() (gw string, shard [2]byte, err error) {
|
func (b *Bot) getinitinfo() (gw string, shard [2]byte, err error) {
|
||||||
shard[1] = 1
|
shard[1] = 1
|
||||||
if b.client != nil {
|
if b.client == nil {
|
||||||
b.client = http.DefaultClient
|
b.client = http.DefaultClient
|
||||||
}
|
}
|
||||||
if b.ShardIndex == 0 {
|
if b.ShardIndex == 0 {
|
||||||
|
|||||||
Reference in New Issue
Block a user