mirror of
https://github.com/tulir/mautrix-whatsapp
synced 2024-06-02 19:19:11 +02:00
Add validation for disappearing-timer command
This commit is contained in:
parent
0c0a55b940
commit
e9f01b81d5
|
@ -1144,9 +1144,14 @@ var cmdDisappearingTimer = &commands.FullHandler{
|
||||||
Args: "<off/1d/7d/90d>",
|
Args: "<off/1d/7d/90d>",
|
||||||
},
|
},
|
||||||
RequiresLogin: true,
|
RequiresLogin: true,
|
||||||
|
RequiresPortal: true,
|
||||||
}
|
}
|
||||||
|
|
||||||
func fnDisappearingTimer(ce *WrappedCommandEvent) {
|
func fnDisappearingTimer(ce *WrappedCommandEvent) {
|
||||||
|
if len(ce.Args) == 0 {
|
||||||
|
ce.Reply("**Usage:** `disappearing-timer <off/1d/7d/90d>`")
|
||||||
|
return
|
||||||
|
}
|
||||||
duration, ok := whatsmeow.ParseDisappearingTimerString(ce.Args[0])
|
duration, ok := whatsmeow.ParseDisappearingTimerString(ce.Args[0])
|
||||||
if !ok {
|
if !ok {
|
||||||
ce.Reply("Invalid timer '%s'", ce.Args[0])
|
ce.Reply("Invalid timer '%s'", ce.Args[0])
|
||||||
|
|
Loading…
Reference in a new issue