From 1041c973a42cef0342424c8b77a09047e410a8a8 Mon Sep 17 00:00:00 2001 From: Storm Dragon Date: Wed, 19 Aug 2020 20:23:59 -0400 Subject: [PATCH] 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. --- bot.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bot.sh b/bot.sh index 8a448ea..17bd5de 100755 --- a/bot.sh +++ b/bot.sh @@ -137,7 +137,7 @@ tail -f "$input" | telnet "$server" "$port" | while read -r result ; do ./triggers/link/link.sh "$who" "$from" "$result" set -f # 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="${command//# /}" will="${command#* }"