From e748d36b684336337633c2887a398f9b4e4ce463 Mon Sep 17 00:00:00 2001 From: Storm Dragon Date: Sat, 15 Aug 2020 23:25:16 -0400 Subject: [PATCH] Now, control the bot via pm. --- bot.sh | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/bot.sh b/bot.sh index 8a5453e..298f6fb 100755 --- a/bot.sh +++ b/bot.sh @@ -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