Fixed regexp in reminder.
This commit is contained in:
@@ -14,15 +14,15 @@ if [[ -z "$time" ]]; then
|
|||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Normalize time format
|
# Normalize time format - add 's' suffix if no time unit specified
|
||||||
if ! [[ "$time" =~ ^[0-9]+[HhMmSs]$ ]]; then
|
if ! [[ "$time" =~ ^[0-9]+[HhMmSs]$ ]]; then
|
||||||
time="${time}s"
|
# Check if it's just a number without a unit
|
||||||
fi
|
if [[ "$time" =~ ^[0-9]+$ ]]; then
|
||||||
|
time="${time}s"
|
||||||
# Validate time is numeric
|
else
|
||||||
if ! [[ "${time%[HhMmSs]}" =~ ^[0-9]+$ ]]; then
|
msg "$chan" "$userNick: Time must be numeric (e.g., 30s, 5m, 1h)."
|
||||||
msg "$chan" "$userNick: Time must be numeric (e.g., 30s, 5m, 1h)."
|
exit 0
|
||||||
exit 0
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Validate time is reasonable (max 24 hours)
|
# Validate time is reasonable (max 24 hours)
|
||||||
@@ -47,7 +47,7 @@ if [[ -z "$*" ]]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
msg "$chan" "ok, $userNick, reminder in $time."
|
msg "$chan" "ok, $userNick, reminder in $time."
|
||||||
reminderMessage="$@"
|
reminderMessage="$*"
|
||||||
|
|
||||||
# Handle 'tell' syntax for targeting other users
|
# Handle 'tell' syntax for targeting other users
|
||||||
if [[ "$reminderMessage" =~ ^[Tt]ell[[:space:]]+ ]]; then
|
if [[ "$reminderMessage" =~ ^[Tt]ell[[:space:]]+ ]]; then
|
||||||
|
|||||||
Reference in New Issue
Block a user