From a112e48467948344eb169d5358e822b92b3f1b4b Mon Sep 17 00:00:00 2001 From: Tulir Asokan Date: Sun, 18 Sep 2022 14:46:16 +0300 Subject: [PATCH] Fix usage and help message for sync command --- commands.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/commands.go b/commands.go index 2c5d11a..a76eacc 100644 --- a/commands.go +++ b/commands.go @@ -1063,21 +1063,21 @@ var cmdSync = &commands.FullHandler{ Help: commands.HelpMeta{ Section: HelpSectionMiscellaneous, Description: "Synchronize data from WhatsApp.", - Args: " [--create-portals]", + Args: " [--contact-avatars] [--create-portals]", }, RequiresLogin: true, } func fnSync(ce *WrappedCommandEvent) { - if len(ce.Args) == 0 { - ce.Reply("**Usage:** `sync [--contact-avatars] [--create-portals]`") - return - } args := strings.ToLower(strings.Join(ce.Args, " ")) contacts := strings.Contains(args, "contacts") appState := strings.Contains(args, "appstate") space := strings.Contains(args, "space") groups := strings.Contains(args, "groups") || space + if !contacts && !appState && !space && !groups { + ce.Reply("**Usage:** `sync [--contact-avatars] [--create-portals]`") + return + } createPortals := strings.Contains(args, "--create-portals") contactAvatars := strings.Contains(args, "--contact-avatars") if contactAvatars && (!contacts || appState) {