forked from tilderadio/radiobot
fix shellcheck warning SC2207
This commit is contained in:
parent
53e64bb1eb
commit
543dd48e01
11
bot.sh
11
bot.sh
|
@ -88,16 +88,17 @@ do
|
||||||
from=$(printf "%s" "$line" | sed -E "s/.*PRIVMSG (.*[#]?([a-zA-Z]|\-)*) :.*/\1/")
|
from=$(printf "%s" "$line" | sed -E "s/.*PRIVMSG (.*[#]?([a-zA-Z]|\-)*) :.*/\1/")
|
||||||
|
|
||||||
# "#" would mean it's a channel
|
# "#" would mean it's a channel
|
||||||
if [[ $from =~ ^#.* ]]; then
|
if printf %s "$from" | grep -q "^#"; then
|
||||||
test "$(printf %s "$line" | grep ":$nick:")" || continue
|
# channel messages need to continue our nick
|
||||||
args=$(printf %s "$line" | sed -E "s/.*:$nick:(.*)/\1/")
|
printf %s "$line" | grep -q ":$nick:" || continue
|
||||||
|
trailing=$(printf %s "$line" | sed -E "s/.*:$nick:(.*)/\1/")
|
||||||
else
|
else
|
||||||
args=$(printf %s "$line" | sed -E "s/.*$nick :(.*)/\1/")
|
trailing=$(printf %s "$line" | sed -E "s/.*$nick :(.*)/\1/")
|
||||||
from="$who"
|
from="$who"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# trim leading and split args on space
|
# trim leading and split args on space
|
||||||
args=( $(printf %s "$args" | sed -E "s/^ //") )
|
IFS=" " read -r -a args <<< "$(printf %s "$trailing" | sed -E "s/^ //")"
|
||||||
|
|
||||||
case "${args[0]}" in
|
case "${args[0]}" in
|
||||||
subscribe)
|
subscribe)
|
||||||
|
|
Loading…
Reference in New Issue