A few cleanups. - annna - Annna the nice friendly bot. | |
git clone git://bitreich.org/annna/ git://enlrupgkhuxnvlhsf6lc3fziv5h2hhfrinws6… | |
Log | |
Files | |
Refs | |
Tags | |
README | |
--- | |
commit 3f347661ec75dffbff4ec2f3c8759b0d81794c9b | |
parent 555e3461df780101ecd298afc9f2e1b0b8c29ae0 | |
Author: eidolon <[email protected]> | |
Date: Tue, 28 Feb 2023 00:03:43 -0500 | |
A few cleanups. | |
Signed-off-by: Annna Robert-Houdin <[email protected]> | |
Diffstat: | |
M annna-message-common | 13 ++++--------- | |
1 file changed, 4 insertions(+), 9 deletions(-) | |
--- | |
diff --git a/annna-message-common b/annna-message-common | |
@@ -106,11 +106,7 @@ case "${text}" in | |
;; | |
*imgur.com/*) | |
- nuris="$(youtube-dl -g "${uri}")" | |
- if [ $? -gt 0 ]; | |
- then | |
- nuris="" | |
- fi | |
+ nuris="$(youtube-dl -g "${uri}")" || nuris="" | |
;; | |
*xkcd.com/*) | |
nuris="$(xkcd-uri "${uri}")" | |
@@ -224,7 +220,7 @@ esac | |
case "${text}" in | |
"${ircuser}"?) | |
- exclamation="$(printf "${text}\n" | sed "s,${ircuser}\(.\),\1,g")" | |
+ exclamation="$(printf "%s\n" "${text}" | sed "s,${ircuser}\(.\),\1,g")" | |
exclamationsintime=$(exclamatio "${user}") | |
finalexclamation="${exclamation}" | |
while [ $exclamationsintime -gt 1 ]; | |
@@ -307,8 +303,7 @@ case "${text}" in | |
"${ircuser}, cowsay "*) | |
word="$(printf "%s\n" "${text}" | cut -c 15-)" | |
tmpf=$(mktemp) | |
- cowsayasaservice ${word} > ${tmpf} | |
- if [ $? -eq 0 ]; then | |
+ if cowsayasaservice ${word} > ${tmpf}; then | |
curi="$(/br/bin/bitreich-paste < ${tmpf})" | |
annna-say -s "${server}" -c "${channel}" "${user}: the cow sai… | |
fi | |
@@ -1172,7 +1167,7 @@ $0 !~ /#nospoil/ { | |
} | |
}' | while read -r tag; | |
do | |
- [ "${tag}" == "#expand" ] && continue | |
+ [ "${tag}" = "#expand" ] && continue | |
origtag="${tag}" | |
pointer=0 |