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/")
|
||||
|
||||
# "#" would mean it's a channel
|
||||
if [[ $from =~ ^#.* ]]; then
|
||||
test "$(printf %s "$line" | grep ":$nick:")" || continue
|
||||
args=$(printf %s "$line" | sed -E "s/.*:$nick:(.*)/\1/")
|
||||
if printf %s "$from" | grep -q "^#"; then
|
||||
# channel messages need to continue our nick
|
||||
printf %s "$line" | grep -q ":$nick:" || continue
|
||||
trailing=$(printf %s "$line" | sed -E "s/.*:$nick:(.*)/\1/")
|
||||
else
|
||||
args=$(printf %s "$line" | sed -E "s/.*$nick :(.*)/\1/")
|
||||
trailing=$(printf %s "$line" | sed -E "s/.*$nick :(.*)/\1/")
|
||||
from="$who"
|
||||
fi
|
||||
|
||||
# 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
|
||||
subscribe)
|
||||
|
|
Loading…
Reference in New Issue