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