Don't connect in reconnect command if the user is not logged in
This commit is contained in:
parent
f9c3e99d10
commit
239de25bf0
@ -177,8 +177,12 @@ const cmdReconnectHelp = `reconnect - Reconnect to WhatsApp`
|
|||||||
|
|
||||||
func (handler *CommandHandler) CommandReconnect(ce *CommandEvent) {
|
func (handler *CommandHandler) CommandReconnect(ce *CommandEvent) {
|
||||||
if ce.User.Conn == nil {
|
if ce.User.Conn == nil {
|
||||||
ce.Reply("No existing connection, creating one...")
|
if ce.User.Session == nil {
|
||||||
ce.User.Connect(false)
|
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
|
return
|
||||||
}
|
}
|
||||||
err := ce.User.Conn.Restore()
|
err := ce.User.Conn.Restore()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user