From 02c042b0f3567b750a976368e398a4c0a3650d98 Mon Sep 17 00:00:00 2001 From: Marius Gavrilescu Date: Mon, 25 Mar 2013 09:46:59 +0200 Subject: [PATCH] Fix the notify command help The notify command now has help text and it no longer fails when calling it with a wrong number of arguments --- res/values/strings.xml | 7 ++++++- src/ro/ieval/fonbot/Utils.java | 1 + 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/res/values/strings.xml b/res/values/strings.xml index bdc90a6..7d76dc7 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -443,6 +443,11 @@ The help command can be used to get a list of commands and help for them. Exampl Could not parse id Notification canceled Notification shown - Notify help + + Usage: notify id [title text]\n + With three arguments, shows a notification with title <title> and text <text> and id <id>. This replaces any previous notiifcation with the same id.\n + With one argument, removes the notification with id <id>\n + Example: notify 10 Hello \"Hello, world!\" + User or password not set \ No newline at end of file diff --git a/src/ro/ieval/fonbot/Utils.java b/src/ro/ieval/fonbot/Utils.java index f06c43a..5fd9410 100644 --- a/src/ro/ieval/fonbot/Utils.java +++ b/src/ro/ieval/fonbot/Utils.java @@ -1010,6 +1010,7 @@ public final class Utils { case NOTIFY: if(args.length!=1 && args.length!=3){ Heavy.help(context, replyTo, toNonNull(Command.NOTIFY)); + return; } final int id; -- 2.39.2