diff --git a/commands.go b/commands.go index 8d996cf..ffc91b5 100644 --- a/commands.go +++ b/commands.go @@ -509,7 +509,7 @@ func (handler *CommandHandler) CommandLogin(ce *CommandEvent) { var qrEventID id.EventID for item := range qrChan { - switch item.Code { + switch item.Event { case whatsmeow.QRChannelSuccess.Code: jid := ce.User.Client.Store.ID ce.Reply("Successfully logged in as +%s (device #%d)", jid.User, jid.Device) diff --git a/provisioning.go b/provisioning.go index 24566f3..aaae5db 100644 --- a/provisioning.go +++ b/provisioning.go @@ -307,7 +307,7 @@ func (prov *ProvisioningAPI) Login(w http.ResponseWriter, r *http.Request) { for { select { case evt := <-qrChan: - switch evt.Code { + switch evt.Event { case whatsmeow.QRChannelSuccess.Code: jid := user.Client.Store.ID user.log.Debugln("Successful login as", jid, "via provisioning API")