From 239de25bf0c573234ef228a1767bf951859ea40f Mon Sep 17 00:00:00 2001 From: Tulir Asokan Date: Thu, 23 May 2019 20:11:55 +0300 Subject: [PATCH] Don't connect in reconnect command if the user is not logged in --- commands.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/commands.go b/commands.go index ddff8a2..2665ddf 100644 --- a/commands.go +++ b/commands.go @@ -177,8 +177,12 @@ const cmdReconnectHelp = `reconnect - Reconnect to WhatsApp` func (handler *CommandHandler) CommandReconnect(ce *CommandEvent) { if ce.User.Conn == nil { - ce.Reply("No existing connection, creating one...") - ce.User.Connect(false) + if ce.User.Session == nil { + ce.Reply("No existing connection and no session. Did you mean `login`?") + } else { + ce.Reply("No existing connection, creating one...") + ce.User.Connect(false) + } return } err := ce.User.Conn.Restore()