Reminder module added.

This commit is contained in:
Storm Dragon 2016-09-13 19:39:22 -04:00
parent eaab1500c4
commit 63f1aa1b30

17
modules/reminder/reminder.sh Executable file
View File

@ -0,0 +1,17 @@
[ -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