Fixed a bug where you could call the bot by putting :${botCaller}command in the middle or end of the text and it would work. Commands only fire now if the caller is used at the beginning of the line.
This commit is contained in:
parent
166948749c
commit
1041c973a4
2
bot.sh
2
bot.sh
@ -137,7 +137,7 @@ tail -f "$input" | telnet "$server" "$port" | while read -r result ; do
|
|||||||
./triggers/link/link.sh "$who" "$from" "$result"
|
./triggers/link/link.sh "$who" "$from" "$result"
|
||||||
set -f
|
set -f
|
||||||
# Although this calls modules, it triggers on text other than the bot's nick
|
# Although this calls modules, it triggers on text other than the bot's nick
|
||||||
elif [[ "$result" =~ ^.*PRIVMSG.*:[${botCaller}].* ]]; then
|
elif [[ "${result#:*:}" =~ ^[${botCaller}][a-zA-Z_].* ]]; then
|
||||||
command="${result#*:[[:punct:]]}"
|
command="${result#*:[[:punct:]]}"
|
||||||
command="${command//# /}"
|
command="${command//# /}"
|
||||||
will="${command#* }"
|
will="${command#* }"
|
||||||
|
Loading…
Reference in New Issue
Block a user