| 13 | ) |
| 14 | |
| 15 | type Bot struct { |
| 16 | ScanCallBack func(body CheckLoginResponse) // 扫码回调,可获取扫码用户的头像 |
| 17 | LoginCallBack func(body CheckLoginResponse) // 登陆回调 |
| 18 | LogoutCallBack func(bot *Bot) // 退出回调 |
| 19 | UUIDCallback func(uuid string) // 获取UUID的回调函数 |
| 20 | SyncCheckCallback func(resp SyncCheckResponse) // 心跳回调 |
| 21 | MessageHandler MessageHandler // 获取消息成功的handle |
| 22 | MessageErrorHandler MessageErrorHandler // 获取消息发生错误的handle, 返回err == nil 则尝试继续监听 |
| 23 | Caller *Caller |
| 24 | Storage *Session |
| 25 | err error |
| 26 | context context.Context |
| 27 | cancel func() |
| 28 | self *Self |
| 29 | hotReloadStorage HotReloadStorage |
| 30 | uuid string |
| 31 | loginUUID string |
| 32 | deviceId string // 设备Id |
| 33 | loginOptionGroup BotOptionGroup |
| 34 | } |
| 35 | |
| 36 | // Alive 判断当前用户是否正常在线 |
| 37 | func (b *Bot) Alive() bool { |
nothing calls this directly
no outgoing calls
no test coverage detected