mirror of
https://github.com/tulir/mautrix-whatsapp
synced 2024-12-14 01:14:29 +01:00
Add different error message in ping if user has no session
This commit is contained in:
parent
5af374e6b0
commit
4747d6999b
1 changed files with 4 additions and 5 deletions
|
@ -267,12 +267,11 @@ func (handler *CommandHandler) CommandDisconnect(ce *CommandEvent) {
|
||||||
const cmdPingHelp = `ping - Check your connection to WhatsApp.`
|
const cmdPingHelp = `ping - Check your connection to WhatsApp.`
|
||||||
|
|
||||||
func (handler *CommandHandler) CommandPing(ce *CommandEvent) {
|
func (handler *CommandHandler) CommandPing(ce *CommandEvent) {
|
||||||
if ce.User.Conn == nil {
|
if ce.User.Session == nil {
|
||||||
|
ce.Reply("You're not logged into WhatsApp.")
|
||||||
|
} else if ce.User.Conn == nil {
|
||||||
ce.Reply("You don't have a WhatsApp connection.")
|
ce.Reply("You don't have a WhatsApp connection.")
|
||||||
return
|
} else if ok, err := ce.User.Conn.AdminTest(); err != nil {
|
||||||
}
|
|
||||||
ok, err := ce.User.Conn.AdminTest()
|
|
||||||
if err != nil {
|
|
||||||
ce.Reply("Connection not OK: %v", err)
|
ce.Reply("Connection not OK: %v", err)
|
||||||
} else if !ok {
|
} else if !ok {
|
||||||
ce.Reply("Connection not OK, but no error received")
|
ce.Reply("Connection not OK, but no error received")
|
||||||
|
|
Loading…
Reference in a new issue