From 71f68eb0b2a84f0e36e854415925c5538c05e5f3 Mon Sep 17 00:00:00 2001 From: eatmoreapple <15055461510@163.com> Date: Sun, 26 Dec 2021 12:36:38 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=BAbot=E6=B7=BB=E5=8A=A0login=5Fwith=5Fuu?= =?UTF-8?q?id?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bot.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/bot.go b/bot.go index 382a1fa..0fa571f 100644 --- a/bot.go +++ b/bot.go @@ -106,13 +106,19 @@ func (b *Bot) hotLoginInit(item HotReloadStorageItem) error { } // Login 用户登录 -// 该方法会一直阻塞,直到用户扫码登录,或者二维码过期 func (b *Bot) Login() error { uuid, err := b.Caller.GetLoginUUID() b.uuid = uuid if err != nil { return err } + return b.LoginWithUUID(uuid) +} + +// LoginWithUUID 用户登录 +// 该方法会一直阻塞,直到用户扫码登录,或者二维码过期 +func (b *Bot) LoginWithUUID(uuid string) error { + b.uuid = uuid // 二维码获取回调 if b.UUIDCallback != nil { b.UUIDCallback(uuid)