Added ignoreList for things that should be ignore for bot triggers.
This commit is contained in:
parent
751657369d
commit
255edc3075
1
bot.cfg
1
bot.cfg
@ -25,3 +25,4 @@ curseKicker=true
|
|||||||
botCaller=",.!+?"
|
botCaller=",.!+?"
|
||||||
# People who are allowed to private message the bot separate multiple names with |
|
# People who are allowed to private message the bot separate multiple names with |
|
||||||
allowList=""
|
allowList=""
|
||||||
|
ignoreList="storm_bot"
|
||||||
|
26
bot.sh
26
bot.sh
@ -9,7 +9,7 @@ fi
|
|||||||
input=".botinput"
|
input=".botinput"
|
||||||
|
|
||||||
close_bot() {
|
close_bot() {
|
||||||
echo -en "QUIT :$quitMessage\r\n" >> "$input"
|
echo -en "QUIT :${quitMessage}\r\n" | telnet "$server" "$port"
|
||||||
rm "$input"
|
rm "$input"
|
||||||
exit 0
|
exit 0
|
||||||
}
|
}
|
||||||
@ -78,6 +78,22 @@ tail -f "$input" | telnet "$server" "$port" | while read -r result ; do
|
|||||||
set +f
|
set +f
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
|
# run when a private message is seen
|
||||||
|
*"PRIVMSG "[[:alnum:]-_]*)
|
||||||
|
echo "$result" >> "$log"
|
||||||
|
who="${result%%!*}"
|
||||||
|
who="${who:1}"
|
||||||
|
from="${who%!*}"
|
||||||
|
command="${result#:* PRIVMSG [[:alnum:]_-]*:}"
|
||||||
|
command="${command//# /}"
|
||||||
|
will="${command#* }"
|
||||||
|
command="${command%% *}"
|
||||||
|
if [[ "$from" =~ $allowList ]]; then
|
||||||
|
./modules/say/say.sh "$who" "#$channel" $from really loves me, they sent me a private message saying $command $will
|
||||||
|
else
|
||||||
|
reply "$who" "You are not in the allowed list for this bot. If you think this is an error, please contact the bot's administrator."
|
||||||
|
fi
|
||||||
|
;;
|
||||||
# run when a message is seen
|
# run when a message is seen
|
||||||
*PRIVMSG*)
|
*PRIVMSG*)
|
||||||
echo "$result" >> "$log"
|
echo "$result" >> "$log"
|
||||||
@ -110,9 +126,11 @@ tail -f "$input" | telnet "$server" "$port" | while read -r result ; do
|
|||||||
./modules/say/say.sh "$who" "$from" "$who: $(shuf -n1 "response/error.txt")"
|
./modules/say/say.sh "$who" "$from" "$who: $(shuf -n1 "response/error.txt")"
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
set -f
|
if ! [[ "$who" =~ $ignoreList ]]; then
|
||||||
./triggers/keywords/keywords.sh "$who" "$from" "$result"
|
set -f
|
||||||
set +f
|
./triggers/keywords/keywords.sh "$who" "$from" "$result"
|
||||||
|
set +f
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
|
Loading…
Reference in New Issue
Block a user