diff --git a/bot.sh b/bot.sh index 298f6fb..02ba138 100755 --- a/bot.sh +++ b/bot.sh @@ -6,6 +6,8 @@ if [ "$(whoami)" = "root" ]; then fi [ -f functions.sh ] && source functions.sh [ -f bot.cfg ] && source bot.cfg +export allowList +export ignoreList input=".botinput" close_bot() { diff --git a/functions.sh b/functions.sh index fd87028..5c92f8f 100644 --- a/functions.sh +++ b/functions.sh @@ -11,6 +11,13 @@ shift echo -en "${msg}$@\r\n" | tee -a "$input" } +nick() +{ + local msg="NICK $1" +shift +echo -en "${msg}\r\n" | tee -a "$input" +} + reply() { shift diff --git a/modules/nick/nick.sh b/modules/nick/nick.sh new file mode 100755 index 0000000..79b3e9a --- /dev/null +++ b/modules/nick/nick.sh @@ -0,0 +1,8 @@ +[ -f functions.sh ] && source functions.sh + +user=$1 +shift +shift +if [[ "$user" =~ $allowList ]]; then + nick $1 +fi