From 01d8803a010b78946f6244b3cd44694f48a22f7a Mon Sep 17 00:00:00 2001 From: Kyle Date: Mon, 24 Aug 2020 09:15:46 -0400 Subject: [PATCH 1/3] Allow numbers at the beginning of commands --- bot.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bot.sh b/bot.sh index 9fd0753..52d4f82 100755 --- a/bot.sh +++ b/bot.sh @@ -148,7 +148,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-Z_].* ]]; then + elif [[ "${result#:*:}" =~ ^[${botCaller}][a-zA-Z0-9_].* ]]; then command="${result#*:[[:punct:]]}" command="${command//# /}" will="${command#* }" From 8dc71fdaad3a32d06ed26fe2d936316e15410fca Mon Sep 17 00:00:00 2001 From: Kyle Date: Sun, 25 Oct 2020 19:06:24 +0000 Subject: [PATCH 2/3] If the nick is changed on command using the nick module, retain the new nick after reconnect or restart --- modules/nick/nick.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/nick/nick.sh b/modules/nick/nick.sh index b23ffa9..0e3e919 100755 --- a/modules/nick/nick.sh +++ b/modules/nick/nick.sh @@ -6,4 +6,5 @@ shift if [[ "$user" =~ $allowList ]]; then ./modules/do/do.sh "$1" "#$channel" "does a magical gesture and turns into ${1}!" nick $1 + sed -i bot.cfg -e "s/nick=.*/nick=\"$1\"/" fi From 2f13552fb2492c034166e4db00dfd1929e850609 Mon Sep 17 00:00:00 2001 From: Kyle Date: Sat, 14 Nov 2020 21:46:05 +0000 Subject: [PATCH 3/3] Removed the pandoc dependency from the link trigger. --- triggers/link/link.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/triggers/link/link.sh b/triggers/link/link.sh index 93bdc86..fe35d9f 100755 --- a/triggers/link/link.sh +++ b/triggers/link/link.sh @@ -3,7 +3,7 @@ for l in $3 ; do text="${l#:}" if [[ "${text}" =~ http://|https://|www\..* ]]; then -pageTitle="$(curl -L -s --connect-timeout 5 "$text" | sed -n -e 'H;${x;s!.*]*>\(.*\).*!\1!;T;s!.*\(.*\).*!\1!p}' | pandoc -t plain | tr '[:space:]' ' ')" +pageTitle="$(curl -L -s --connect-timeout 5 "$text" | sed -n -e 'H;${x;s!.*]*>\(.*\).*!\1!;T;s!.*\(.*\).*!\1!p}' | w3m -dump -T text/html | tr '[:space:]' ' ')" pageTitle="$(echo "$pageTitle" | tr -cd '[:print:]')" if [[ ${#pageTitle} -gt 1 ]]; then msg "$2" "$pageTitle"