Hopefully fixed ignore not ignoring.
This commit is contained in:
21
bot.sh
21
bot.sh
@@ -109,6 +109,11 @@ rm_input() {
|
||||
fi
|
||||
}
|
||||
|
||||
is_ignored() {
|
||||
local nick="$1"
|
||||
[[ -n "$ignoreList" && "$nick" =~ ^($ignoreList)$ ]]
|
||||
}
|
||||
|
||||
# Function to stop ping monitor process
|
||||
stop_ping_monitor() {
|
||||
if [[ -n "$pingMonitorPid" ]] && kill -0 "$pingMonitorPid" 2>/dev/null; then
|
||||
@@ -297,7 +302,9 @@ while true; do
|
||||
kickerName="${kickerName:1}"
|
||||
kickerChannel="${result##*#}"
|
||||
kickerChannel="#${kickerChannel%% *}"
|
||||
msg "$kickerChannel" "$kickerName: $(shuf -e -n1 "fuck you" "go fuck yourself")!"
|
||||
if ! is_ignored "$kickerName"; then
|
||||
msg "$kickerChannel" "$kickerName: $(shuf -e -n1 "fuck you" "go fuck yourself")!"
|
||||
fi
|
||||
fi
|
||||
;;
|
||||
# run when someone joins
|
||||
@@ -306,6 +313,9 @@ while true; do
|
||||
who="${who:1}"
|
||||
from="${result#*#}"
|
||||
from="#$from"
|
||||
if is_ignored "$who"; then
|
||||
continue
|
||||
fi
|
||||
if [ "$who" = "$nick" ]; then
|
||||
continue
|
||||
fi
|
||||
@@ -321,6 +331,9 @@ while true; do
|
||||
who="${who:1}"
|
||||
from="${result#*#}"
|
||||
from="#$from"
|
||||
if is_ignored "$who"; then
|
||||
continue
|
||||
fi
|
||||
if [ "$who" = "$nick" ]; then
|
||||
continue
|
||||
fi
|
||||
@@ -336,6 +349,9 @@ while true; do
|
||||
who="${result%%!*}"
|
||||
who="${who:1}"
|
||||
from="${who%!*}"
|
||||
if is_ignored "$who"; then
|
||||
continue
|
||||
fi
|
||||
command="${result#:* PRIVMSG [[:alnum:]_-]*:}"
|
||||
command="${command//# /}"
|
||||
will="${command#* }"
|
||||
@@ -366,6 +382,9 @@ while true; do
|
||||
|
||||
who="${result%%!*}"
|
||||
who="${who:1}"
|
||||
if is_ignored "$who"; then
|
||||
continue
|
||||
fi
|
||||
from="${result#*#}"
|
||||
from="${from%% *}"
|
||||
from="#${from:-${channels[0]}}"
|
||||
|
||||
Reference in New Issue
Block a user