Now, control the bot via pm.

This commit is contained in:
Storm Dragon 2020-08-15 23:25:16 -04:00
parent 9ac3655a80
commit e748d36b68

11
bot.sh
View File

@ -89,7 +89,16 @@ tail -f "$input" | telnet "$server" "$port" | while read -r result ; do
will="${command#* }"
command="${command%% *}"
if [[ "$from" =~ $allowList ]]; then
./modules/say/say.sh "$who" "#$channel" $from really loves me, they sent me a private message saying $command $will
if command -v "./modules/${command% *}/${command% *}.sh" ; then
echo "Calling module ./modules/${command% *}/${command% *}/${command% *}.sh \"$who\" \"$from\" $will" >> "$log"
# Disable wildcards
set -f
./modules/${command% *}/${command% *}.sh "$who" "#$channel" $will
# Enable wildcards
set +f
else
reply "$who" "$(shuf -n1 "response/error.txt")"
fi
else
reply "$who" "You are not in the allowed list for this bot. If you think this is an error, please contact the bot's administrator."
fi