Better matching for commands.
This commit is contained in:
parent
6712003387
commit
85e832d625
2
bot.sh
2
bot.sh
@ -149,7 +149,7 @@ tail -f "$input" | telnet "$server" "$port" | while read -r result ; do
|
|||||||
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
|
||||||
# To make sure that modules are only called when they are supposed to be, had to combine string monipulation with regexp.
|
# 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="${result#*:[[:punct:]]}"
|
||||||
command="${command//# /}"
|
command="${command//# /}"
|
||||||
will="${command#* }"
|
will="${command#* }"
|
||||||
|
Loading…
Reference in New Issue
Block a user