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