From 85e832d625ec3f79c6cfc135da17366817e9c9b2 Mon Sep 17 00:00:00 2001 From: Storm Dragon Date: Fri, 16 Apr 2021 15:01:15 -0400 Subject: [PATCH] Better matching for commands. --- bot.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bot.sh b/bot.sh index f68b761..19c51c7 100755 --- a/bot.sh +++ b/bot.sh @@ -149,7 +149,7 @@ tail -f "$input" | telnet "$server" "$port" | while read -r result ; do set -f # Although this calls modules, it triggers on text other than the bot's nick # To make sure that modules are only called when they are supposed to be, had to combine string monipulation with regexp. - elif [[ "${result#:*:}" =~ ^[${botCaller}][a-zA-Z0-9_].* ]]; then + elif [[ "${result#:*PRIVMSG*:}" =~ ^[${botCaller}][a-zA-Z0-9_].* ]]; then command="${result#*:[[:punct:]]}" command="${command//# /}" will="${command#* }"