From e9f01b81d507e8a99dcc8bfb5e8d2a7c1c5e28e4 Mon Sep 17 00:00:00 2001 From: Tulir Asokan Date: Thu, 30 Jun 2022 17:25:43 +0300 Subject: [PATCH] Add validation for disappearing-timer command --- commands.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/commands.go b/commands.go index 6ea0839..dbd557d 100644 --- a/commands.go +++ b/commands.go @@ -1143,10 +1143,15 @@ var cmdDisappearingTimer = &commands.FullHandler{ Description: "Set future messages in the room to disappear after the given time.", Args: "", }, - RequiresLogin: true, + RequiresLogin: true, + RequiresPortal: true, } func fnDisappearingTimer(ce *WrappedCommandEvent) { + if len(ce.Args) == 0 { + ce.Reply("**Usage:** `disappearing-timer `") + return + } duration, ok := whatsmeow.ParseDisappearingTimerString(ce.Args[0]) if !ok { ce.Reply("Invalid timer '%s'", ce.Args[0])