From b39f6298a1e11ac072a29968691ae73384a81c3e Mon Sep 17 00:00:00 2001 From: Karmanyaah Malhotra Date: Wed, 10 Mar 2021 20:31:30 -0500 Subject: [PATCH] Fix token not saved bug --- user.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/user.go b/user.go index 13714b5..c139fde 100644 --- a/user.go +++ b/user.go @@ -362,7 +362,7 @@ func (user *User) Login(ce *CommandEvent) { // // Also between the two logout methods (commands.go and provisioning.go) // user.ConnectionErrors = 0 // user.JID = strings.Replace(user.Conn.Info.Wid, whatsappExt.OldUserSuffix, whatsappExt.NewUserSuffix, 1) - if len(ce.Args) == 0 { + if len(ce.Args) < 1 { ce.Reply(`Get your access token from https://dev.groupme.com/ which should be the first argument to login`) return } @@ -372,6 +372,7 @@ func (user *User) Login(ce *CommandEvent) { //user.SetSession(&session) ce.Reply("Successfully logged in, synchronizing chats...") user.PostLogin() + user.Connect() } type Chat struct { @@ -483,8 +484,8 @@ func (user *User) intPostLogin() { log.Fatal(err) //TODO } user.JID = myuser.ID.String() - user.Update() } + user.Update() user.createCommunity() user.tryAutomaticDoublePuppeting()