From 6f6f7159c1cde35e073e3be38adec2ff8bef6136 Mon Sep 17 00:00:00 2001 From: Storm Dragon Date: Sat, 25 Oct 2025 02:14:29 -0400 Subject: [PATCH] Fixed regexp in reminder. --- modules/reminder/reminder.sh | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/modules/reminder/reminder.sh b/modules/reminder/reminder.sh index 9b64c57..0233c86 100755 --- a/modules/reminder/reminder.sh +++ b/modules/reminder/reminder.sh @@ -14,15 +14,15 @@ if [[ -z "$time" ]]; then exit 0 fi -# Normalize time format +# Normalize time format - add 's' suffix if no time unit specified if ! [[ "$time" =~ ^[0-9]+[HhMmSs]$ ]]; then - time="${time}s" -fi - -# Validate time is numeric -if ! [[ "${time%[HhMmSs]}" =~ ^[0-9]+$ ]]; then - msg "$chan" "$userNick: Time must be numeric (e.g., 30s, 5m, 1h)." - exit 0 + # Check if it's just a number without a unit + if [[ "$time" =~ ^[0-9]+$ ]]; then + time="${time}s" + else + msg "$chan" "$userNick: Time must be numeric (e.g., 30s, 5m, 1h)." + exit 0 + fi fi # Validate time is reasonable (max 24 hours) @@ -47,7 +47,7 @@ if [[ -z "$*" ]]; then fi msg "$chan" "ok, $userNick, reminder in $time." -reminderMessage="$@" +reminderMessage="$*" # Handle 'tell' syntax for targeting other users if [[ "$reminderMessage" =~ ^[Tt]ell[[:space:]]+ ]]; then