stormbot/modules/reminder/reminder.sh
2016-09-13 19:39:22 -04:00

18 lines
373 B
Bash
Executable File

[ -f functions.sh ] && source functions.sh
userNick="$1"
shift
chan="$1"
shift
time="$1"
shift
if ! [[ "$time" =~ ^[0-9]+$ ]]; then
reminderMessage="Times must be numeric (seconds)."
msg "$chan" "$userNick: $reminderMessage"
else
msg "$chan" "ok, $userNick, reminder in $time seconds."
reminderMessage="$@"
sleep $time && msg "$chan" "$userNick $reminderMessage"&
fi