Drop sloc like it is SLOC drop day! - annna - Annna the nice friendly bot.
(HTM) git clone git://bitreich.org/annna/ git://enlrupgkhuxnvlhsf6lc3fziv5h2hhfrinws65d7roiv6bfj7d652fid.onion/annna/
(DIR) Log
(DIR) Files
(DIR) Refs
(DIR) Tags
(DIR) README
---
(DIR) commit ae39f7d89e846846281873d6aaaec0c071b1f956
(DIR) parent 7e1ba9d699401c89806a32c2962f39e44449a886
(HTM) Author: Annna Robert-Houdin <annna@bitreich.org>
Date: Sun, 19 Oct 2025 11:06:51 +0200
Drop sloc like it is SLOC drop day!
Diffstat:
M annna-message-common | 597 ++++++++++---------------------
1 file changed, 185 insertions(+), 412 deletions(-)
---
(DIR) diff --git a/annna-message-common b/annna-message-common
@@ -6,6 +6,8 @@
export PATH="$PATH:/br/bin"
+annnasumerian="𒈹"
+annnabirthday="1989-05-18"
hashtagfile="${ANNNA_MODBASE}/hashtags/hashtags.txt"
idontcaredb="${ANNNA_MODBASE}/i-dont-care/i-dont-care.txt"
printnhashtags=2
@@ -13,14 +15,21 @@ brmembers="__20h__ Evil_Bob chripo posativ quinq stateless solene josuah parazyd
referees="__20h__"
ignorednicks="eidolon"
linkbrotherchannels="#bitreich-meme"
+# Flag, if some expansion of some URI happened.
+uriexpansion=0
+# Do not spoil at all.
+nospoil=0
+# Enforce spoiling in case of hard nospoil filter.
+dospoil=0
+# Expand meme hashtag and show recommendations.
+doexpand=0
-annnasumerian="𒈹"
-annnabirthday="1989-05-18"
-
+regeximatch() {
+ printf '%s' "$1" | grep -i -E -q "$2"
+}
hashtags() {
cat ${hashtagfile} 2>/dev/null
}
-
hashtagcount() {
int2bit "$(curl -s gophers://bitreich.org/1/meme/count \
| grep total \
@@ -28,10 +37,6 @@ hashtagcount() {
| sed 's,.*total on .*: \([0-9]*\)),\1,')"
}
-regeximatch() {
- printf '%s' "$1" | grep -i -E -q "$2"
-}
-
isignored=0
for ignorednick in $ignorednicks;
do
@@ -39,22 +44,9 @@ do
done
[ $isignored -eq 1 ] && exit
-# Flag, if some expansion of some URI happened.
-uriexpansion=0
-# Do not spoil at all.
-nospoil=0
-# Enforce spoiling in case of hard nospoil filter.
-dospoil=0
-# Expand meme hashtag and show recommendations.
-doexpand=0
-
case "${IRC_PRIVMSG_TEXT}" in
-*\#nospoil*)
- nospoil=1
- ;;
-*\#expand*)
- doexpand=1
- ;;
+*\#nospoil*) nospoil=1;;
+*\#expand*) doexpand=1;;
*::*::*)
if [ $(pgrep -f stable-diffusion-emoji 2>/dev/null | wc -l) -gt 3 ];
then
@@ -73,13 +65,10 @@ case "${IRC_PRIVMSG_TEXT}" in
fi
fi
} &
- fi
- ;;
+ fi;;
*http*://*|*ytdl://*)
case "${IRC_PRIVMSG_TEXT}" in
- *"#spoil"*)
- dospoil=1
- ;;
+ *"#spoil"*) dospoil=1;;
esac
case "${IRC_PRIVMSG_TEXT}" in
@@ -140,41 +129,31 @@ case "${IRC_PRIVMSG_TEXT}" in
[ -s "${tmpf}" ] && urititle="$(grabtitle < "${tmpf}")"
case "${urititle}" in
- "")
- ;;
+ "");;
*Gunther*|*GUNTHER*|*Günther*|*GÜNTHER*)
annna-say "Oh Günther! ❤ ❤ ❤ ${urititle}"
- uriexpansion=1
- ;;
+ uriexpansion=1;;
*\|\ Cloudflare*|"Just a moment...")
annna-say "Mind your own business! We got clownflared: gophers://bitreich.org/0/ascii/clownflare.vt"
titleend=1
- uriexpansion=1
- ;;
+ uriexpansion=1;;
esac
case "${uri}" in
- "")
- ;;
+ "");;
*github.com/*/blob/*)
urltitle=""
nuris="$(printf '%s' "${uri}" | sed 's/blob/raw/')"
- nocuri=0
- ;;
- *imgur.com/*)
- nuris="$(youtube-dl -g "${uri}")" || nuris=""
- ;;
- *xkcd.com/*)
- nuris="$(xkcd-uri "${uri}")"
- ;;
+ nocuri=0;;
+ *imgur.com/*) nuris="$(youtube-dl -g "${uri}")" || nuris="";;
+ *xkcd.com/*) nuris="$(xkcd-uri "${uri}")";;
*imdb.com/title/*)
imdbstr="$(imdb2gopherbay "${uri}")"
if [ -n "${imdbstr}" ];
then
nuris="${imdbstr}"
urititle=""
- fi
- ;;
+ fi;;
# bay.parazy.de is unmaintained
#*themoviedb.org/movie/*)
# movietitle="$(themoviedb2gopherbay "${uri}" | sed 's, ,+,g')"
@@ -193,19 +172,16 @@ case "${IRC_PRIVMSG_TEXT}" in
then
nuri="https://text.npr.org/${post}"
nuris="text only: ${nuri}"
- fi
- ;;
+ fi;;
*csdb.dk/release/*)
sid=$(awk '/<a href="download\.php.*\.sid/ { match($0, /https:\/\/.*\.sid</); print substr($0, RSTART, RLENGTH-1); exit }' "$tmpf")
- [ -n "$sid" ] && nuris="listen: $sid"
- ;;
+ [ -n "$sid" ] && nuris="listen: $sid";;
*www.forgottenweapons.com/*)
ytid=$(sed -n '/<meta name="description"/ s/.*https:\/\/youtu\.be\/\([-A-Za-z0-9_]\{11\}\).*/\1/p' "$tmpf")
if [ -n "$ytid" ]; then
nuris="video: ytdl://$ytid ;"
nuris="$nuris metadata: gophers://codemadness.org/1/idiotbox.cgi?v=$ytid"
- fi
- ;;
+ fi;;
*www.reddit.com*)
nuri="$(printf '%s\n' "${uri}" | sed "s;www.reddit.com;old.reddit.com;")"
nuris="old.reddit: ${nuri}"
@@ -222,8 +198,7 @@ case "${IRC_PRIVMSG_TEXT}" in
fi
nuris="${nuri} ; gopherdit: ${guri}"
fi
- nocuri=0
- ;;
+ nocuri=0;;
*taz.de*)
newsid="$(printf '%s\n' "${uri}" | sed 's,.*\(![0-9]*\).*,\1,')"
if [ -n "${newsid}" ];
@@ -231,16 +206,14 @@ case "${IRC_PRIVMSG_TEXT}" in
urititle="$(curl-grabtitle "${uri}")"
nuris="gopher://taz.de/1/${newsid}"
nocuri=1
- fi
- ;;
+ fi;;
*x.com/*/status/*)
tid="$(printf "%s\n" "${uri}" | sed 's,.*status/\([0-9]*\)$,\1,')"
if [ -n "${tid}" ];
then
nuris="https://twitter-thread.com/pdf/${tid}"
nocuri=1
- fi
- ;;
+ fi;;
*twitter.com*)
#ninstance="$(nitter-instance | sed 's,\.,\\\.,g')"
#nuri="$(printf "%s\n" "${uri}" | sed "s;\(mobile\.\)\{0,1\}twitter\.com;${ninstance};")"
@@ -248,16 +221,14 @@ case "${IRC_PRIVMSG_TEXT}" in
urititle="$(curl-grabtitle "${uri}")"
#suri="$(screenshot-paste "${uri}")"
#nuris="nitter: ${nuri}"
- nocuri=0
- ;;
+ nocuri=0;;
*.wikipedia.org/wiki/*)
if ! regeximatch "$uri" '\.(jpg,bmp,gif,png,tiff,avi,mp4,webm,mkv,pdf,ps,eps)$';
then
nuri="$(printf '%s\n' "${uri}" | sed -Ee "s;/wiki/;/api/rest_v1/page/pdf/;" -e "s;(\?|#).*$;;")"
nuris="$(printf 'pdf: %s\n' "${nuri}")"
nocuri=1
- fi
- ;;
+ fi;;
*youtube.com/*|*youtu.be/*)
# Youtube is so annoying and repeatedly broken;
# they hate users, only expand on request.
@@ -294,21 +265,16 @@ case "${IRC_PRIVMSG_TEXT}" in
nocuri=1
else
titleend=1
- fi
- ;;
+ fi;;
*tv.brain.rip/???-???*)
nuris="$(grep 'property="og:video:secure_url' < "${tmpf}" | sed 's,.*content="\([^"]*\)".*,\1,')"
urititle="$(grep 'name="description' < "${tmpf}" | sed 's,.*content="\([^"]*\)".*,\1,')"
- nocuri=1
- ;;
+ nocuri=1;;
*)
mimetype="$(file -b --mime-type "${tmpf}")"
case "${mimetype}" in
- text/*|application/javascript)
- nocuri=0
- ;;
- esac
- ;;
+ text/*|application/javascript) nocuri=0;;
+ esac;;
esac
if [ $titleend -eq 0 ];
@@ -326,8 +292,7 @@ case "${IRC_PRIVMSG_TEXT}" in
annna-say "${outputstr}"
uriexpansion=1
fi
- rm -f "${tmpf}"
- ;;
+ rm -f "${tmpf}";;
esac
runlinkbrother=0
@@ -353,18 +318,12 @@ case "${IRC_PRIVMSG_TEXT}" in
finalexclamation="${finalexclamation}${exclamation}"
exclamationsintime=$(($exclamationsintime - 1))
done
- annna-say "${IRC_CMD_USER}${finalexclamation}"
- ;;
+ annna-say "${IRC_CMD_USER}${finalexclamation}";;
"${IRC_USER}, how old are you?")
age="$(ddiff ${annnabirthday} today -f "%y")"
- annna-say "${IRC_CMD_USER}, I am ${age} years old."
- ;;
-"${IRC_USER}, when is your birthday?")
- annna-say "${IRC_CMD_USER}, I am born on ${annnabirthday}."
- ;;
-"${IRC_USER}, asl"*)
- annna-say "${IRC_CMD_USER}, age: born on 1989-05-18; sex: IRC bot; location: bitreich.org; u?"
- ;;
+ annna-say "${IRC_CMD_USER}, I am ${age} years old.";;
+"${IRC_USER}, when is your birthday?") annna-say "${IRC_CMD_USER}, I am born on ${annnabirthday}.";;
+"${IRC_USER}, asl"*) annna-say "${IRC_CMD_USER}, age: born on 1989-05-18; sex: IRC bot; location: bitreich.org; u?";;
"${IRC_USER}, woop")
# Using the same database for funny hacks.
exclamation="$(printf "%s\n" "${IRC_PRIVMSG_TEXT}" | sed "s;${IRC_USER}, \(.\);\1;g")"
@@ -375,8 +334,7 @@ case "${IRC_PRIVMSG_TEXT}" in
finalexclamation="${finalexclamation} ${exclamation}"
exclamationsintime=$(($exclamationsintime - 1))
done
- annna-say "${IRC_CMD_USER}, ${finalexclamation}"
- ;;
+ annna-say "${IRC_CMD_USER}, ${finalexclamation}";;
"${IRC_USER}, hype")
# Using the same database for funny hacks.
exclamation="$(printf "%s\n" "${IRC_PRIVMSG_TEXT}" | sed "s;${IRC_USER}, \(.\);\1;g")"
@@ -387,13 +345,11 @@ case "${IRC_PRIVMSG_TEXT}" in
finalexclamation="${finalexclamation} ${exclamation}"
exclamationsintime=$(($exclamationsintime - 1))
done
- annna-say "${IRC_CMD_USER}, ${finalexclamation}"
- ;;
+ annna-say "${IRC_CMD_USER}, ${finalexclamation}";;
*">:3"*) annna-say "OMG IT'S A LION GET IN THE CAR!";;
*"<3"*)
love "${IRC_CMD_USER}++"
- annna-say "*o.o*"
- ;;
+ annna-say "*o.o*";;
*"m(") annna-say "(-‸ლ)";;
*"*shrug*"*) annna-say "¯\\_(ツ)_/¯";;
*"*glare*"*) annna-say "ಠ_ಠ";;
@@ -402,16 +358,11 @@ case "${IRC_PRIVMSG_TEXT}" in
*":'(") annna-say "(╯︵╰,)";;
"Thanks ${IRC_USER}"*) annna-say "${IRC_CMD_USER}, you are welcome.";;
*" ope sorry"*|"ope sorry"*) annna-say "${IRC_CMD_USER}, 😃pe sorry.";;
-"${IRC_USER}, snake"*)
- annna-say "${IRC_CMD_USER}, ssSSsSssSssSsssssSSsSSSSsSssSSSSsssSSSSsssSSsssSssssSssssSSssSSsSssssSSsSSssSsssSssSSSS"
- ;;
+"${IRC_USER}, snake"*) annna-say "${IRC_CMD_USER}, ssSSsSssSssSsssssSSsSSSSsSssSSSSsssSSSSsssSSsssSssssSssssSSssSSsSssssSSsSSssSsssSssSSSS";;
"${IRC_USER}, snoke"*) annna-say "${IRC_CMD_USER}, snoke again?";;
"${IRC_USER}, amirite?") annna-say "${IRC_CMD_USER}, Yep, you're the most correct of them all.";;
"${IRC_USER}, ping"*) annna-say "${IRC_CMD_USER}, pong.";;
-"${IRC_USER}, how lame is my nick?")
- lamenessstr="$(lameness "${IRC_CMD_USER}")"
- annna-say "${lamenessstr}"
- ;;
+"${IRC_USER}, how lame is my nick?") annna-say "$(lameness "${IRC_CMD_USER}")";;
"${IRC_USER}, ding"*) annna-say "${IRC_CMD_USER}, dong.";;
"${IRC_USER}, irly"*) annna-say "${IRC_CMD_USER}, I love you too.";;
"${IRC_USER}, bleep bloop"*) annna-say "${IRC_CMD_USER}, bloop bleep." ;;
@@ -423,17 +374,9 @@ case "${IRC_PRIVMSG_TEXT}" in
"${IRC_USER}, who is lovely?") annna-say "${IRC_CMD_USER}, gophers://bitreich.org/1/irc/love";;
"${IRC_USER}, what the brcon score?") annna-say "${IRC_CMD_USER}, gophers://bitreich.org/1/con/$(date +%Y)/score";;
"${IRC_USER}, what the shame?") annna-say "${IRC_CMD_USER}, gophers://bitreich.org/1/irc/shame";;
-"${IRC_USER}, please generate a password for me.")
- newpws="$(pwgen -B1ny 20 10 | paste -sd ' ')"
- annna-say "${IRC_CMD_USER}, as you wish: ${newpws}"
- ;;
-*"don't care"*)
- dontcaresay="$(shuf -n 1 ${idontcaredb})"
- annna-say "${IRC_CMD_USER}, ${dontcaresay}"
- ;;
-"${IRC_USER}, how can I phlog on bitreich?")
- annna-say "${IRC_CMD_USER}, please read: gophers://bitreich.org/0/usr/20h/phlog/2017-08-26T20-04-02-482296.md and gophers://bitreich.org/0/usr/20h/phlog/2017-08-26T20-27-40-281825.md"
- ;;
+"${IRC_USER}, please generate a password for me.") annna-say "${IRC_CMD_USER}, as you wish: $(pwgen -B1ny 20 10 | paste -sd ' ')";;
+*"don't care"*) annna-say "${IRC_CMD_USER}, $(shuf -n 1 ${idontcaredb})";;
+"${IRC_USER}, how can I phlog on bitreich?") annna-say "${IRC_CMD_USER}, please read: gophers://bitreich.org/0/usr/20h/phlog/2017-08-26T20-04-02-482296.md and gophers://bitreich.org/0/usr/20h/phlog/2017-08-26T20-27-40-281825.md";;
"${IRC_USER}, what's my type?")
{
cd /br/gopher
@@ -441,8 +384,7 @@ case "${IRC_PRIVMSG_TEXT}" in
| shuf -n 1 \
| xargs -n 1 printf "gophers://bitreich.org/9%s\n")"
annna-say "${IRC_CMD_USER}, your type is ${usertype}"
- }
- ;;
+ };;
"${IRC_USER}, please show me a video about "*)
word="$(printf "%s\n" "${IRC_PRIVMSG_TEXT}" | cut -c 37-)"
case "$word" in
@@ -454,12 +396,10 @@ case "${IRC_PRIVMSG_TEXT}" in
annna-say "${IRC_CMD_USER}, ${videoresult}"
else
annna-say "${IRC_CMD_USER}, sorry, nothing founds."
- fi
- ;;
+ fi;;
"${IRC_USER}, what is my fortune?")
fortunecookie="$(fortune-cookie)"
- [ -n "${fortunecookie}" ] && annna-say "${IRC_CMD_USER}, ${fortunecookie}"
- ;;
+ [ -n "${fortunecookie}" ] && annna-say "${IRC_CMD_USER}, ${fortunecookie}";;
"${IRC_USER}, what is "*)
word="$(printf "%s\n" "${IRC_PRIVMSG_TEXT}" | cut -c 16-)"
case "$word" in
@@ -486,8 +426,7 @@ case "${IRC_PRIVMSG_TEXT}" in
else
puri="$(printf "%s\n" "${dresult}" | /br/bin/bitreich-paste)"
fi
- annna-say "${puri}"
- ;;
+ annna-say "${puri}";;
"${IRC_USER}, cowsay "*)
word="$(printf "%s\n" "${IRC_PRIVMSG_TEXT}" | cut -c 15-)"
tmpf=$(mktemp)
@@ -495,15 +434,10 @@ case "${IRC_PRIVMSG_TEXT}" in
curi="$(/br/bin/bitreich-paste < ${tmpf})"
annna-say "${IRC_CMD_USER}: the cow said... ${curi}"
fi
- rm ${tmpf} 2>/dev/null
- ;;
+ rm ${tmpf} 2>/dev/null;;
"${IRC_USER}, please give me the unix power"*)
upcuri="$(unix-power)"
- if [ -n "${upcuri}" ];
- then
- annna-say "${IRC_CMD_USER}, ${upcuri}"
- fi
- ;;
+ [ -n "${upcuri}" ] && annna-say "${IRC_CMD_USER}, ${upcuri}";;
"${IRC_USER}, please stop the last emoji prompt"*)
lastemojipromptpid="$(pgrep -f stable-diffusion-emoji | sort -n | tail -n 1)"
if [ -n "${lastemojipromptpid}" ];
@@ -512,26 +446,20 @@ case "${IRC_PRIVMSG_TEXT}" in
annna-say "${IRC_CMD_USER}, I HUPed ${lastemojipromptpid} and all its children for you."
else
annna-say "${IRC_CMD_USER}, sorry, no instances found."
- fi
- ;;
+ fi;;
"${IRC_USER}, play despacito "*) annna-say "${IRC_CMD_USER}, gophers://bitreich.org/9/memecache/despacito.mkv";;
"nice to meet you ${IRC_USER}"*) annna-say "${IRC_CMD_USER}, the pleasure is on my side. :-)";;
-"${IRC_USER}, please give me a Chuck Norris fact"*)
- chuck=$(chucknorris)
- annna-say "${IRC_CMD_USER}, ${chuck}"
- ;;
+"${IRC_USER}, please give me a Chuck Norris fact"*) annna-say "${IRC_CMD_USER}, $(chucknorris)";;
"${IRC_USER}, magic"*)
magictrick="$(magic)"
- [ -n "${magictrick}" ] && annna-say "${IRC_CMD_USER}, ${magictrick}"
- ;;
+ [ -n "${magictrick}" ] && annna-say "${IRC_CMD_USER}, ${magictrick}";;
"${IRC_USER}, please show me ip art"*)
annna-say "${IRC_CMD_USER}, please see #bitreich-tv for the magic."
{
cd $HOME/bin/modules/ip-art;
# Lock, so only one annna process manipulates eth0.
flock $HOME/bin/modules/ip-art -c "./display-file.sh ip-art.ipart"
- } &
- ;;
+ } & ;;
"${IRC_USER}, I feel button"*)
buri="$(button-gen)"
if [ -n "${buri}" ];
@@ -539,35 +467,29 @@ case "${IRC_PRIVMSG_TEXT}" in
annna-say "${IRC_CMD_USER}, like this? ${buri}"
else
annna-say "${IRC_CMD_USER}, sorry, no feelings for you today."
- fi
- ;;
+ fi;;
"${IRC_USER}, I feel stupid"*)
nuri=$(darwin)
tmpf=$(mktemp)
fetch-uri "${nuri}" > "${tmpf}"
curi="$(9 htmlfmt < "${tmpf}" | /br/bin/bitreich-paste)"
annna-say "${IRC_CMD_USER}, do not feel stupid, others are more stupid: ${curi}"
- rm ${tmpf} 2>/dev/null
- ;;
+ rm ${tmpf} 2>/dev/null;;
"${IRC_USER}, I feel down"*)
postmortem="$(post-mortem | /br/bin/bitreich-paste)"
- annna-say "${IRC_CMD_USER}, do not feel bad, others had worse days: ${postmortem}"
- ;;
+ annna-say "${IRC_CMD_USER}, do not feel bad, others had worse days: ${postmortem}";;
"${IRC_USER}, I feel perl"*)
perlfeelings="$(perl-feelings)"
- [ -n "${perl-feelings}" ] && annna-say "${IRC_CMD_USER}, I feel ${perlfeelings}"
- ;;
+ [ -n "${perl-feelings}" ] && annna-say "${IRC_CMD_USER}, I feel ${perlfeelings}";;
"${IRC_USER}, will you be my girlfriend?") annna-say "${IRC_CMD_USER}, $(girlfriend)";;
"${IRC_USER}, who fights crime?"|"${IRC_USER}, who is fighting crime?")
partner=$(echo $brmembers | awk '{for (i = 1; i < NF; i++) print $i}' | grep -v "^{$user}" | shuf -n 1)
crimefighter="$(theyfightcrime ${IRC_CMD_USER} ${partner})"
- annna-say "${crimefighter}"
- ;;
+ annna-say "${crimefighter}";;
"${IRC_USER}, please give me a commit message"*) annna-say "${IRC_CMD_USER}, $(whatthecommit)";;
"${IRC_USER}, please paint the irc channel.")
emojiuri="$(emoji-channel-history "${ANNNA_IRCBASE}/${IRC_SERVER}/${IRC_CHANNEL}")"
- [ -n "${emojiuri}" ] && annna-say "${emojiuri}"
- ;;
+ [ -n "${emojiuri}" ] && annna-say "${emojiuri}";;
"${IRC_USER}, birp"*) annna-say "${IRC_CMD_USER}, I heard a $(bird-name) bird.";;
"${IRC_USER}, please oneline me"*)
randomoneliner="$(oneliner)"
@@ -576,88 +498,71 @@ case "${IRC_PRIVMSG_TEXT}" in
annna-say "${IRC_CMD_USER}, the service failed. Please redial to your BOL account."
else
annna-say "${IRC_CMD_USER}, ${randomoneliner}"
- fi
- ;;
+ fi;;
*"what's app?")
maemoapp="$(whatsapp)"
- [ -n "${maemoapp}" ] && annna-say "Have you tried? ${maemoapp}"
- ;;
+ [ -n "${maemoapp}" ] && annna-say "Have you tried? ${maemoapp}";;
"${IRC_USER}, man "*|"${IRC_USER}, man "*)
exp="$(printf "%s\n" "${IRC_PRIVMSG_TEXT}" | cut -c 12- | sed 's,\t, ,g')"
dresult="$(COLUMNS=80 man "${exp}" 2>/dev/null)"
-
if [ "$dresult" ];
then
puri="$(printf "%s" "${dresult}" | /br/bin/bitreich-paste)"
else
puri="No matches found."
fi
-
- annna-say "${puri}"
- ;;
+ annna-say "${puri}";;
"${IRC_USER}, please pray for me"*) annna-say "${IRC_CMD_USER}, here, for you: gophers://bitreich.org/9/memecache/llaminim.mkv";;
"${IRC_USER}, nigger."|*nigger*|*NIGGER*) annna-say "${IRC_CMD_USER}, don't use the $(nword)!";;
"${IRC_USER}, why was I breached?")
breachtext="$(why-was-i-breached)"
- [ -n "${breachtext}" ] && annna-say "${IRC_CMD_USER}, ${breachtext}"
- ;;
+ [ -n "${breachtext}" ] && annna-say "${IRC_CMD_USER}, ${breachtext}";;
"${IRC_USER}, please be responsible about "*)
word="$(printf "%s\n" "${IRC_PRIVMSG_TEXT}" | cut -c 36- | sed 's,\t, ,g')"
suri="$(responsibility "${word}" | bitreich-paste)"
- annna-say "${suri}"
- ;;
+ annna-say "${suri}";;
"${IRC_USER}, please say "*)
word="$(printf "%s\n" "${IRC_PRIVMSG_TEXT}" | cut -c 19- | sed 's,\t, ,g')"
suri="$(printf "%s\n" "${word}" | bitreich-speak)"
- annna-say "${suri}"
- ;;
+ annna-say "${suri}";;
"${IRC_USER}, please zombie say "*)
word="$(printf "%s\n" "${IRC_PRIVMSG_TEXT}" | cut -c 26- | sed 's,\t, ,g')"
suri="$(printf "%s\n" "${word}" | zombie -e | bitreich-speak)"
- annna-say "${suri}"
- ;;
+ annna-say "${suri}";;
"${IRC_USER}, please unzombie "*)
word="$(printf "%s\n" "${IRC_PRIVMSG_TEXT}" | cut -c 24- | sed 's,\t, ,g')"
suri="$(printf "%s\n" "${word}" | zombie -d)"
- annna-say "${suri}"
- ;;
+ annna-say "${suri}";;
"${IRC_USER}, please zombie "*)
word="$(printf "%s\n" "${IRC_PRIVMSG_TEXT}" | cut -c 22- | sed 's,\t, ,g')"
suri="$(printf "%s\n" "${word}" | zombie -e)"
- annna-say "${suri}"
- ;;
+ annna-say "${suri}";;
"${IRC_USER}, please ghost say "*)
word="$(printf "%s\n" "${IRC_PRIVMSG_TEXT}" | cut -c 25- | sed 's,\t, ,g')"
suri="$(printf "%s\n" "${word}" | ghost -e | bitreich-speak)"
- annna-say "${suri}"
- ;;
+ annna-say "${suri}";;
"${IRC_USER}, please unghost "*)
word="$(printf "%s\n" "${IRC_PRIVMSG_TEXT}" | cut -c 23- | sed 's,\t, ,g')"
suri="$(printf "%s\n" "${word}" | ghost -d)"
- annna-say "${suri}"
- ;;
+ annna-say "${suri}";;
"${IRC_USER}, please ghost "*)
word="$(printf "%s\n" "${IRC_PRIVMSG_TEXT}" | cut -c 21- | sed 's,\t, ,g')"
suri="$(printf "%s\n" "${word}" | ghost -e)"
- annna-say "${suri}"
- ;;
+ annna-say "${suri}";;
"${IRC_USER}, please pohlish "*)
word="$(printf "%s\n" "${IRC_PRIVMSG_TEXT}" | cut -c 23- | sed 's,\t, ,g')"
suri="$(pohlcode.awk "${word}" | head -n 1)"
- annna-say "${suri}"
- ;;
+ annna-say "${suri}";;
"${IRC_USER}, please cunei "*)
word="$(printf "%s\n" "${IRC_PRIVMSG_TEXT}" | cut -c 21- | sed 's,\t, ,g')"
suri="$(int2cunei "${word}" | head -n 1)"
- annna-say "${suri}"
- ;;
+ annna-say "${suri}";;
"${IRC_USER}, what is up with gopher man?");; #TODO
"${IRC_USER}, what can I cook with "*)
ingredients="$(printf "%s\n" "${IRC_PRIVMSG_TEXT}" | cut -c 29- | sed 's,\t, ,g')"
case "$ingredients" in
*\?) ingredients="$(printf "%s\n" "${ingredients}" | cut -c -"$(($(expr length "${ingredients}") - 1))")";;
esac
-
results="$(fridge-recipe-search "${ingredients}")"
if [ -n "${results}" ];
then
@@ -681,125 +586,109 @@ case "${IRC_PRIVMSG_TEXT}" in
else
annna-say "${IRC_CMD_USER}, I could not find any recipes for you."
fi
- fi
- ;;
+ fi;;
"${IRC_USER}, gpt "*)
# TODO: use modules/prompt-agents
prompt="$(printf "%s\n" "${IRC_PRIVMSG_TEXT}" | cut -c 12- | sed 's,\t, ,g')"
{
annna-say "$(gpt "${prompt}. Please answer short and precise.")"
- } &
- ;;
+ } & ;;
"Preacher, "*|"preacher, "*)
personality="preacher"
preprompt="$(cat ${ANNNA_MODBASE}/prompt-agents/${personality}.prompt.txt)"
prompt="$(printf "%s\n" "${IRC_PRIVMSG_TEXT}" | cut -d' ' -f 2- | sed 's,\t, ,g')"
{
annna-say "$(gpt "System: ${preprompt}\n User: ${prompt}\n Bot:")"
- } &
- ;;
+ } & ;;
"Uplift, "*|"uplift, "*)
personality="uplifting"
preprompt="$(cat ${ANNNA_MODBASE}/prompt-agents/${personality}.prompt.txt)"
prompt="$(printf "%s\n" "${IRC_PRIVMSG_TEXT}" | cut -d' ' -f 2- | sed 's,\t, ,g')"
{
annna-say "$(gpt "System: ${preprompt}\n User: ${prompt}\n Bot:")"
- } &
- ;;
+ } & ;;
"Grumpy, "*|"grumpy, "*)
personality="grumpy-fart"
preprompt="$(cat ${ANNNA_MODBASE}/prompt-agents/${personality}.prompt.txt)"
prompt="$(printf "%s\n" "${IRC_PRIVMSG_TEXT}" | cut -d' ' -f 2- | sed 's,\t, ,g')"
{
annna-say "$(gpt "System: ${preprompt}\n User:${prompt}\n Bot:")"
- } &
- ;;
+ } & ;;
"Santa, "*|"Sannnta, "*|"santa, "*|"sannnta, "*)
personality="santa"
preprompt="$(cat ${ANNNA_MODBASE}/prompt-agents/${personality}.prompt.txt)"
prompt="$(printf "%s\n" "${IRC_PRIVMSG_TEXT}" | cut -d' ' -f 2- | sed 's,\t, ,g')"
{
annna-say "$(gpt "System: ${preprompt}\n User: ${prompt}\n Bot:")"
- } &
- ;;
+ } & ;;
"Satan, "*|"Satannn, "*|"satan, "*|"satannn, "*)
personality="satan"
preprompt="$(cat ${ANNNA_MODBASE}/prompt-agents/${personality}.prompt.txt)"
prompt="$(printf "%s\n" "${IRC_PRIVMSG_TEXT}" | cut -d' ' -f 2- | sed 's,\t, ,g')"
{
annna-say "$(gpt "System: ${preprompt}\n User: ${prompt}\n Bot:")"
- } &
- ;;
+ } & ;;
"Trump, "*|"trump, "*)
personality="trump"
preprompt="$(cat ${ANNNA_MODBASE}/prompt-agents/${personality}.prompt.txt)"
prompt="$(printf "%s\n" "${IRC_PRIVMSG_TEXT}" | cut -d' ' -f 2- | sed 's,\t, ,g')"
{
annna-say "$(gpt "System: ${preprompt}\n User: ${prompt}\n Bot:")"
- } &
- ;;
+ } & ;;
"Freud, "*|"freud, "*|"Sigmund, "*|"sigmund, "*)
personality="sigmund-freud"
preprompt="$(cat ${ANNNA_MODBASE}/prompt-agents/${personality}.prompt.txt)"
prompt="$(printf "%s\n" "${IRC_PRIVMSG_TEXT}" | cut -d' ' -f 2- | sed 's,\t, ,g')"
{
annna-say "$(gpt "System: ${preprompt}\n User:${prompt}\n Bot:")"
- } &
- ;;
+ } & ;;
"Mao, "*|"mao, "*)
personality="mao"
preprompt="$(cat ${ANNNA_MODBASE}/prompt-agents/${personality}.prompt.txt)"
prompt="$(printf "%s\n" "${IRC_PRIVMSG_TEXT}" | cut -d' ' -f 2- | sed 's,\t, ,g')"
{
annna-say "$(gpt "System: ${preprompt}\n User:${prompt}\n Bot:")"
- } &
- ;;
+ } & ;;
"Teleromeo, "*|"teleromeo, "*)
personality="teleromeo"
preprompt="$(cat ${ANNNA_MODBASE}/prompt-agents/${personality}.prompt.txt)"
prompt="$(printf "%s\n" "${IRC_PRIVMSG_TEXT}" | cut -d' ' -f 2- | sed 's,\t, ,g')"
{
annna-say "$(gpt "System: ${preprompt}\n User:${prompt}\n Bot:")"
- } &
- ;;
+ } & ;;
"Modem, "*|"modem, "*)
personality="modem"
preprompt="$(cat ${ANNNA_MODBASE}/prompt-agents/${personality}.prompt.txt)"
prompt="$(printf "%s\n" "${IRC_PRIVMSG_TEXT}" | cut -d' ' -f 2- | sed 's,\t, ,g')"
{
annna-say "$(gpt "System: ${preprompt}\n User: ${prompt}\n Bot:")"
- } &
- ;;
+ } & ;;
"Sadh_Guru, "*|"Sadh_guru, "*|"sadh_guru, "*|"sadh_Guru, "*)
personality="sadh_guru"
preprompt="$(cat ${ANNNA_MODBASE}/prompt-agents/${personality}.prompt.txt)"
prompt="$(printf "%s\n" "${IRC_PRIVMSG_TEXT}" | cut -d' ' -f 2- | sed 's,\t, ,g')"
{
annna-say "$(gpt "System: ${preprompt}\n User: ${prompt}\n Bot:")"
- } &
- ;;
+ } & ;;
"Prophet, "*|"prophet, "*)
personality="prophet"
preprompt="$(cat ${ANNNA_MODBASE}/prompt-agents/${personality}.prompt.txt)"
prompt="$(printf "%s\n" "${IRC_PRIVMSG_TEXT}" | cut -d' ' -f 2- | sed 's,\t, ,g')"
{
annna-say "$(gpt "System: ${preprompt}\n User: ${prompt}\n Bot:")"
- } &
- ;;
+ } & ;;
"Luther, "*|"luther, "*)
personality="luther"
preprompt="$(cat ${ANNNA_MODBASE}/prompt-agents/${personality}.prompt.txt)"
prompt="$(printf "%s\n" "${IRC_PRIVMSG_TEXT}" | cut -d' ' -f 2- | sed 's,\t, ,g')"
{
annna-say "$(gpt "System: ${preprompt}\n User: ${prompt}\n Bot:")"
- } &
- ;;
+ } & ;;
"${IRC_USER}, wolfram is "*)
word="$(printf "%s\n" "${IRC_PRIVMSG_TEXT}" | cut -c 19- | sed 's,\t, ,g')"
case "$word" in
*\?) word="$(printf "%s\n" "${word}" | cut -c -"$(($(expr length "${word}") - 1))")";;
esac
-
puri=""
dresult="$(printf "/wolfram\t%s\r\n" "${word}" \
| nc magical.fish 70 \
@@ -808,26 +697,21 @@ case "${IRC_PRIVMSG_TEXT}" in
| head -n -1 \
| tail -n +2 \
| sed 's,i\(.*\)fake\texample.com.*,\1,;s,[ \t]*$,,')"
-
if [ -n "$dresult" ];
then
case "${dresult}" in
- b*)
- dresult="$(printf "%s\n" "${dresult}" \
+ b*) dresult="$(printf "%s\n" "${dresult}" \
| tr '\n' ' ' \
| sed "s,^b',,;s,' $,," \
| sed 's,^b",,;s," $,,' \
| sed 's,\\n,\n,g;s,\\t,\t,g')"
;;
- *)
- dresult="$(printf "%s\n" "${dresult}" \
+ *) dresult="$(printf "%s\n" "${dresult}" \
| sed 's,\([a-zA-Z]\)$,\1 ,' \
| tr -d '\n')"
;;
esac
-
wcl="$(printf "%s" "${dresult}" | wc -l)"
-
if [ $wcl -gt 1 ];
then
puri="$(printf "%s" "${dresult}" | /br/bin/bitreich-paste)"
@@ -837,8 +721,7 @@ case "${IRC_PRIVMSG_TEXT}" in
else
puri="No matches found."
fi
- annna-say -- "${puri}"
- ;;
+ annna-say -- "${puri}";;
# Emulate https://threats.kaspersky.com/en/threat/IRC-Worm.DOS.Septic/
"${IRC_USER}, pray"*) annna-say "${IRC_CMD_USER}, I Obey my master! long live satan";;
"${IRC_USER}, sacrifice"*) annna-say "${IRC_CMD_USER}, Your word is my command, Power to satan!";;
@@ -853,8 +736,7 @@ case "${IRC_PRIVMSG_TEXT}" in
then
annna-say "${IRC_CMD_USER}, ${drunknick} is ${drunkness} drunk."
fi
- } &
- ;;
+ } & ;;
"${IRC_USER}, how do I "*)
{
gptprompt="$(printf "%s\n" "${IRC_PRIVMSG_TEXT}" \
@@ -865,8 +747,7 @@ case "${IRC_PRIVMSG_TEXT}" in
then
annna-say "${IRC_CMD_USER}, try this: ${gpturi}"
fi
- } &
- ;;
+ } & ;;
"${IRC_USER}, weather at "*|"${IRC_USER}, weather in "*)
{
weatherplace="$(printf "%s\n" "${IRC_PRIVMSG_TEXT}" \
@@ -878,8 +759,7 @@ case "${IRC_PRIVMSG_TEXT}" in
else
annna-say "${IRC_CMD_USER}, there is no weather at ${weatherplace}."
fi
- } &
- ;;
+ } & ;;
"${IRC_USER}, funny weather at "*|"${IRC_USER}, funny weather in "*)
{
weatherplace="$(printf "%s\n" "${IRC_PRIVMSG_TEXT}" \
@@ -900,8 +780,7 @@ case "${IRC_PRIVMSG_TEXT}" in
annna-say "${IRC_CMD_USER}, $(gpt "System: ${preprompt}\n User: ${prompt}\n Bot:")"
} &
fi
- } &
- ;;
+ } & ;;
"${IRC_USER}, color weather at "*|"${IRC_USER}, color weather in "*)
{
weatherplace="$(printf "%s\n" "${IRC_PRIVMSG_TEXT}" \
@@ -922,27 +801,22 @@ case "${IRC_PRIVMSG_TEXT}" in
annna-say "${IRC_CMD_USER}, $(gpt "System:${preprompt}\nUser:${prompt}\nBot:")"
} &
fi
- } &
- ;;
+ } & ;;
"${IRC_USER}, METAR for "*|"${IRC_USER}, metar for "*|"${IRC_USER}, metar for "*|"${IRC_USER}, METAR for "*)
resp=$(metar "$(printf '%.4s\n' "${IRC_PRIVMSG_TEXT##* }")")
- annna-say "${IRC_CMD_USER}, ${resp}"
- ;;
+ annna-say "${IRC_CMD_USER}, ${resp}";;
"${IRC_USER}, how discriminating is "*)
word="$(printf "%s\n" "${IRC_PRIVMSG_TEXT}" | cut -c 30- | sed 's,\t, ,g')"
case "$word" in
*\?) word="$(printf "%s\n" "${word}" | cut -c -"$(($(expr length "${word}") - 1))")";;
esac
-
newword="$(discrimination-filter "${word}")"
if [ "${newword}" = "${word}" ];
then
annna-say "${IRC_CMD_USER}, it is ok."
else
annna-say "${IRC_CMD_USER}, it should be: ${newword}"
- fi
-
- ;;
+ fi;;
"${IRC_USER}, are "*)
case "${IRC_PRIVMSG_TEXT}" in
*" in love?")
@@ -953,10 +827,8 @@ case "${IRC_PRIVMSG_TEXT}" in
annna-say 'Yes!!! Pure <3 <3'
else
annna-say "No."
- fi
- ;;
- esac
- ;;
+ fi;;
+ esac;;
"${IRC_USER}, is "*)
aitext="$(printf "%s\n" "${IRC_PRIVMSG_TEXT}" | cut -c 7- | sed 's,\t, ,g')"
airesult="$(printf "%s\n" "${aitext}" | josuah-ai)"
@@ -964,36 +836,30 @@ case "${IRC_PRIVMSG_TEXT}" in
[Oo]"k, ${IRC_USER}"*) annna-say "${IRC_CMD_USER}, I am not a consumer device.";;
"${IRC_USER}, please shoot "*|"${IRC_USER}, plese shoot "*)
word="$(printf "%s\n" "${IRC_PRIVMSG_TEXT}" | cut -c 21-)"
- annna-say "${word}, #pewpew gophers://bitreich.org/9/memecache/pewpew.mp4"
- ;;
+ annna-say "${word}, #pewpew gophers://bitreich.org/9/memecache/pewpew.mp4";;
"${IRC_USER}, please quinq.") annna-say "┻━┻ ︵╰(°□°)╯︵ ┻━┻";;
"${IRC_USER}, please flip "*)
word="$(printf "%s\n" "${IRC_PRIVMSG_TEXT}" | cut -c 20-)"
updownword="$(updown "${word}")"
- annna-say "(╯°□°)╯ ${word} ︵ ${updownword}"
- ;;
+ annna-say "(╯°□°)╯ ${word} ︵ ${updownword}";;
"${IRC_USER}, please crystal math "*)
math="$(printf "%s\n" "${IRC_PRIVMSG_TEXT}" | cut -c 28-)"
crystaluri="$(crystal-math "${math}")"
- annna-say "${IRC_CMD_USER}, please see ${crystaluri}"
- ;;
+ annna-say "${IRC_CMD_USER}, please see ${crystaluri}";;
"${IRC_USER}, please australize "*)
word="$(printf "%s\n" "${IRC_PRIVMSG_TEXT}" | cut -c 26-)"
updownword="$(updown "${word}")"
- annna-say "${word} -> ${updownword}"
- ;;
+ annna-say "${word} -> ${updownword}";;
"${IRC_USER}, wtf "*)
word="$(printf "%s\n" "${IRC_PRIVMSG_TEXT}" | cut -c 11-)"
wtfword="$(wtf "${word}" 2>/dev/null)"
- [ -n "${wtfword}" ] && annna-say "${IRC_CMD_USER}, ${wtfword}"
- ;;
+ [ -n "${wtfword}" ] && annna-say "${IRC_CMD_USER}, ${wtfword}";;
"${IRC_USER}, please give me a good band name"*) annna-say "$(bandname-gen | shuf | head -n 1)";;
"${IRC_USER}, I feel conspicuous"*) annna-say "Maybe declare this: $(manifesto-gen | bitreich-paste)";;
"${IRC_USER}, I am horny"*) annna-say "Here is some intellectual porn for you: $(bithub-gen)";;
"${IRC_USER}, please turn on "*)
word="$(printf "%s\n" "${IRC_PRIVMSG_TEXT}" | cut -c 22-)"
- annna-say "☞ ⏻ ${word}"
- ;;
+ annna-say "☞ ⏻ ${word}";;
"${IRC_USER}, please turn me on"*) annna-say "☞ ⏻ ${IRC_CMD_USER}";;
"${IRC_USER}, I'm game bored.")
gamelink="$(abandonware-random-game)"
@@ -1002,16 +868,13 @@ case "${IRC_PRIVMSG_TEXT}" in
annna-say "${IRC_CMD_USER}, sorry I have found nothing for you."
else
annna-say "${IRC_CMD_USER}, have you tried ${gamelink} ?"
- fi
- ;;
+ fi;;
"${IRC_USER}, I need a waifu"*)
waifuuris="$(waifu-gen)"
- [ -n "${waifuuris}" ] && annna-say "${IRC_CMD_USER}, ${waifuuris}"
- ;;
+ [ -n "${waifuuris}" ] && annna-say "${IRC_CMD_USER}, ${waifuuris}";;
"${IRC_USER}, I need an anime"*)
animeuri="$(anime-gen)"
- [ -n "${animeuri}" ] && annna-say "${IRC_CMD_USER}, ${animeuri}"
- ;;
+ [ -n "${animeuri}" ] && annna-say "${IRC_CMD_USER}, ${animeuri}";;
"${IRC_USER}, I'm gopher bored"*)
randomlink="$(/br/bin/bitreich-lawn-random-link)"
linktype="$(printf "%s\n" "${randomlink}" | cut -d '|' -f1 | cut -c2-)"
@@ -1020,40 +883,25 @@ case "${IRC_PRIVMSG_TEXT}" in
linkserver="$(printf "%s\n" "${randomlink}" | cut -d '|' -f4)"
linkport="$(printf "%s\n" "${randomlink}" | cut -d '|' -f5 | cut -d']' -f1)"
outtext="$(printf "%s - gopher://%s" "$linktext" "$linkserver")"
- if [ "$linkport" != "70" ] && [ "$linkport" != "port" ];
- then
- outtext="$(printf "%s:%s" "$outtext" "$linkport")"
- fi
- if [ -n "$linksel" ];
- then
- outtext="$(printf "%s/%s%s" "$outtext" "$linktype" "$linksel")"
- fi
- annna-say "$outtext"
- ;;
+ [ "$linkport" != "70" ] && [ "$linkport" != "port" ] && outtext="$(printf "%s:%s" "$outtext" "$linkport")"
+ [ -n "$linksel" ] && outtext="$(printf "%s/%s%s" "$outtext" "$linktype" "$linksel")"
+ annna-say "$outtext";;
"${IRC_USER}, wb"*) annna-say "${IRC_CMD_USER}, ty! I am so happy to be here. :)";;
"${IRC_USER}, welcome back"*) annna-say "${IRC_CMD_USER}, thank you! I am so happy to be here. :)";;
"${IRC_USER}, I love you"*) annna-say $'\001ACTION blushes\001';;
"${IRC_USER}, bon"*) annna-say "${IRC_CMD_USER}, $(bonjour) !";;
"${IRC_USER}, salut"*) annna-say "${IRC_CMD_USER}, Salutations camarade !";;
-"${IRC_USER}, what's up?")
- newsstr="$(ecl -shell /home/solene/gopher/bin/generator.lisp)"
- annna-say "$newsstr"
- ;;
+"${IRC_USER}, what's up?") annna-say "$(ecl -shell /home/solene/gopher/bin/generator.lisp)";;
"${IRC_USER}, what's down?") annna-say "${IRC_CMD_USER}, we all love you.";;
$'\001'"ACTION cancels "*)
mobtarget="$(printf "%s\n" "${IRC_PRIVMSG_TEXT}" | sed 's,.*ACTION cancels \(.*\)\x01,\1,')"
cancel-target "${mobtarget}"
- annna-say "${IRC_CMD_USER}, I cancelled ${mobtarget} for you. ( gophers://bitreich.org/I/memecache/cancel-meteor.jpg )"
- ;;
+ annna-say "${IRC_CMD_USER}, I cancelled ${mobtarget} for you. ( gophers://bitreich.org/I/memecache/cancel-meteor.jpg )";;
$'\001'"ACTION pokes ${IRC_USER}"$'\001') annna-say "$(echo -e '\001')ACTION pokes ${IRC_CMD_USER}$(echo -e '\001')";;
-"${IRC_USER}, please show me the mob"*|"${IRC_USER}, what are the mob"*)
- canceluri="$(get-cancel-list)"
- annna-say "${IRC_CMD_USER}, ${canceluri}"
- ;;
+"${IRC_USER}, please show me the mob"*|"${IRC_USER}, what are the mob"*) annna-say "${IRC_CMD_USER}, $(get-cancel-list)";;
"${IRC_USER}, I feel sick"*)
newsstr="$(cd /br/gopher/hypochondria && ./hypochondria -s random)"
- annna-say "You could have ${newsstr}! Be careful!"
- ;;
+ annna-say "You could have ${newsstr}! Be careful!";;
*"oh hai"*|*"ohai"*|*"ohhai"*) annna-say "${IRC_CMD_USER}, hai! How is your sex life?";;
"o/"|"o/ "*|"\o"|"\o "*|"o7"|"o7 "*) annna-say "${IRC_CMD_USER}, ${IRC_PRIVMSG_TEXT}";;
"\m/"|"\m/ "*) annna-say "${IRC_CMD_USER}, ᕦ(ò_óˇ)ᕤ";;
@@ -1067,8 +915,7 @@ $'\001'"ACTION pokes ${IRC_USER}"$'\001') annna-say "$(echo -e '\001')ACTION pok
"${IRC_USER}, please coffee read "*)
readtarget="$(printf "%s\n" "${IRC_PRIVMSG_TEXT}" | cut -c 27-)"
horostr="$($HOME/scm/bullshit/horoscope)"
- annna-say "${readtarget}, ${horostr}"
- ;;
+ annna-say "${readtarget}, ${horostr}";;
"${IRC_USER}, what's my horoscope?") annna-say "${IRC_CMD_USER}, $($HOME/scm/bullshit/horoscope)";;
"${IRC_USER}, what should I cook"*)
recipestr="$(based.recipe)"
@@ -1093,8 +940,7 @@ $'\001'"ACTION pokes ${IRC_USER}"$'\001') annna-say "$(echo -e '\001')ACTION pok
else
annna-say "${IRC_CMD_USER}, I have no recommendation for you today."
fi
- fi
- ;;
+ fi;;
# parazyd.org is unmaintained
#"${IRC_USER}, what's my future?")
# puri="$(sacc gopher://parazyd.org/0/tarot.cgi | /br/bin/bitreich-paste)"
@@ -1104,8 +950,7 @@ $'\001'"ACTION pokes ${IRC_USER}"$'\001') annna-say "$(echo -e '\001')ACTION pok
{
wuri="$(github-haha)"
[ -n "${wuri}" ] && annna-say "${IRC_CMD_USER}, haha ${wuri}"
- } &
- ;;
+ } & ;;
"${IRC_USER}, meow"*)
# https://catgps.wvd.io support
nmeows=$(($RANDOM % 14))
@@ -1120,24 +965,20 @@ $'\001'"ACTION pokes ${IRC_USER}"$'\001') annna-say "$(echo -e '\001')ACTION pok
else
meows="$meows."
fi
- annna-say "${IRC_CMD_USER}, ${meows}"
- ;;
+ annna-say "${IRC_CMD_USER}, ${meows}";;
"${IRC_USER}, how many memes do you know?") annna-say "I know $(hashtagcount) memes: gophers://bitreich.org/1/meme/count";;
"${IRC_USER}, please show me your memes"*)
puri="$(printf "%s" "$(hashtags)" | /br/bin/bitreich-paste)"
- annna-say "Here are my memes: ${puri}"
- ;;
+ annna-say "Here are my memes: ${puri}";;
"${IRC_USER}, please show me the victims"*)
puri="$(printf "%s" "$(hashtags)" | grep victim | /br/bin/bitreich-paste)"
- annna-say "Here are the victims: ${puri}"
- ;;
+ annna-say "Here are the victims: ${puri}";;
"${IRC_USER}, please distro-hop with me"*)
ndistro="$(curl -s 'https://distrowatch.com/dwres.php?resource=popularity' \
| grep phr2 \
| sed 's,.*href="\(.*\)".*,\1,' \
| sort | uniq | shuf -n 1)"
- annna-say "How about https://distrowatch.com/${ndistro} ?"
- ;;
+ annna-say "How about https://distrowatch.com/${ndistro} ?";;
"${IRC_USER}, please show me your Macron"*) annna-say "gophers://bitreich.org/0/ascii/macron.vt";;
"${IRC_USER}, release the Kraken"*) annna-say "Here it is! gophers://bitreich.org/0/memecache/kraken.vt";;
"${IRC_USER}, where is your source?") annna-say "Here is my precious source: git://bitreich.org/annna ";;
@@ -1149,71 +990,47 @@ $'\001'"ACTION pokes ${IRC_USER}"$'\001') annna-say "$(echo -e '\001')ACTION pok
2) annna-say "(▀ Ĺ▀ )̄";;
3) annna-say "(▀Ĺ▀ )";;
*) annna-say "I can't be cool! gophers://bitreich.org/9/memecache/i-cant-be-cool.mp3";;
- esac
- ;;
+ esac;;
"${IRC_USER}, please cheer"*)
case "$(($RANDOM % 2))" in
0) annna-say '~\o/~';;
*) annna-say '✺◟( ° ʖ °)◞✺';;
- esac
- ;;
+ esac;;
"${IRC_USER}, please give me a fish"*)
case "$(($RANDOM % 2))" in
0) annna-say '<><';;
*) annna-say '><>';;
- esac
- ;;
+ esac;;
"${IRC_USER}, run"*) annna-say 'ᕕ(ಠ_ಠ)ᕗ';;
"${IRC_USER}, be cute"*)
case "$(($RANDOM % 4))" in
- 0)
- annna-say ' (\ /)'
- sleep 0.1
- annna-say ' (. .)'
- sleep 0.1
- annna-say ' C(") (")'
- ;;
- 1)
- annna-say ' (\-/)'
- sleep 0.1
- annna-say " (='.'=)"
- sleep 0.1
- annna-say ' (")-(")o'
- ;;
- 2)
- annna-say ' ( ) ( )'
- sleep 0.1
- annna-say ' (>•.•<)'
- sleep 0.1
- annna-say ' (") (")'
- ;;
- *)
- annna-say ' (\ (\'
- sleep 0.1
- annna-say " (=' :')"
- sleep 0.1
- annna-say ' (, (") (")'
- ;;
- esac
- ;;
+ 0) annna-say ' (\ /)' && sleep 0.1
+ annna-say ' (. .)' && sleep 0.1
+ annna-say ' C(") (")';;
+ 1) annna-say ' (\-/)' && sleep 0.1
+ annna-say " (='.'=)" && sleep 0.1
+ annna-say ' (")-(")o';;
+ 2) annna-say ' ( ) ( )' && sleep 0.1
+ annna-say ' (>•.•<)' && sleep 0.1
+ annna-say ' (") (")' && sleep 0.1;;
+ *) annna-say ' (\ (\' && sleep 0.1
+ annna-say " (=' :')" && sleep 0.1
+ annna-say ' (, (") (")';;
+ esac;;
"${IRC_USER}, 8ball "*)
eightballanswer="$(8ball)"
- [ -n "${eightballanswer}" ] && annna-say "${eightballanswer}"
- ;;
+ [ -n "${eightballanswer}" ] && annna-say "${eightballanswer}";;
"${IRC_USER}, email "*)
findsyou="$(shuf -n 1 "${ANNNA_MODBASE}/finds-you/finds_you.txt")"
- [ -n "${findsyou}" ] && annna-say "${IRC_CMD_USER}, I hope this email ${findsyou}"
- ;;
+ [ -n "${findsyou}" ] && annna-say "${IRC_CMD_USER}, I hope this email ${findsyou}";;
"${IRC_USER}, please throw a coin for me.")
case "$((($RANDOM % 2) + 1))" in
1) annna-say "face";;
2) annna-say "number";;
- esac
- ;;
+ esac;;
"${IRC_USER}, please quantum roll d2 for me"*)
qroll="$(($(/home/20h/scm/quantum-rng/quantum-rng) + 1))"
- annna-say "${IRC_CMD_USER}, ${qroll} [1d2(scores:[${qroll}])]"
- ;;
+ annna-say "${IRC_CMD_USER}, ${qroll} [1d2(scores:[${qroll}])]";;
"${IRC_USER}, please roll "*" for me"*)
q="${text#* roll }"
q="${q%for*}"
@@ -1225,8 +1042,7 @@ $'\001'"ACTION pokes ${IRC_USER}"$'\001') annna-say "$(echo -e '\001')ACTION pok
[ "${q}" = "dice " ] && q="d6"
dicescore="$(dice "${q}")"
- annna-say "${IRC_CMD_USER}, ${dicescore}"
- ;;
+ annna-say "${IRC_CMD_USER}, ${dicescore}";;
"${IRC_USER}, please tell me your favourite flower"*) annna-say "My favourite flower is the beer flower.";;
"${IRC_USER}, please tell me your favourite color"*) annna-say "My favourite color is yellow.";;
"${IRC_USER}, please clap for me"*) annna-say "${IRC_CMD_USER}, *clap* *clap* *clap*";;
@@ -1237,8 +1053,7 @@ $'\001'"ACTION pokes ${IRC_USER}"$'\001') annna-say "$(echo -e '\001')ACTION pok
annna-say "${IRC_CMD_USER}, this one: ${cityuri}"
else
annna-say "${IRC_CMD_USER}, none."
- fi
- ;;
+ fi;;
[Ff]"or humanity"*) annna-say "${IRC_CMD_USER}, for humanity! gophers://bitreich.org/0/memecache/annna-rchism.txt";;
[Hh]"ack the planet"*) annna-say "${IRC_CMD_USER}, hack the planet!" ;;
[Ll]"ong live gopher"*) annna-say "${IRC_CMD_USER}, long live gopher!";;
@@ -1250,8 +1065,7 @@ $'\001'"ACTION pokes ${IRC_USER}"$'\001') annna-say "$(echo -e '\001')ACTION pok
"${IRC_USER}, please do the graveyard smash"*)
annna-say -- "( つ ・ᴗ・)つ"
annna-say -- "ς ( ・ᴗ・ ς )"
- annna-say -- "It did the mash\\ It did the ~~MONSTER MASH~~\\ It was a smash\\ It was a ~~GRAVEYARD SMASH~~"
- ;;
+ annna-say -- "It did the mash\\ It did the ~~MONSTER MASH~~\\ It was a smash\\ It was a ~~GRAVEYARD SMASH~~";;
"${IRC_USER}, boo"*) annna-say "${IRC_CMD_USER}, 👻";;
"${IRC_USER}, W3C"*|"${IRC_USER}, w3c"*) annna-say "${IRC_CMD_USER}, 🕸️ 🕷️ 🕸️";;
"${IRC_USER}, pumpkin"*) annna-say "${IRC_CMD_USER}, 🎃";;
@@ -1268,16 +1082,14 @@ $'\001'"ACTION pokes ${IRC_USER}"$'\001') annna-say "$(echo -e '\001')ACTION pok
sleep $sleeptime
annna-say "${IRC_CMD_USER}, $(trick-or-treat)"
- } &
- ;;
+ } & ;;
"${IRC_USER}, please dance with me"*)
if [ $(($RANDOM % 2)) -gt 0 ];
then
annna-say "I am not that kind of woman."
else
annna-say "Thank you! Let us dance! :-D"
- fi
- ;;
+ fi;;
"${IRC_USER}, please tell me who is your favourite pleasure man"*) annna-say "My favourite pleasure man is of course Gunther!";;
"${IRC_USER}, make me a sandwich"*) annna-say "No.";;
"${IRC_USER}, sudo make me a sandwich"*) annna-say "Humans are no objects.";;
@@ -1285,8 +1097,7 @@ $'\001'"ACTION pokes ${IRC_USER}"$'\001') annna-say "$(echo -e '\001')ACTION pok
"${IRC_USER}, sudo please make me a sandwich"*) annna-say "Here is your sandwich.";;
"${IRC_USER}, I feel unsure about my health.")
healthadvice="$(health-advice)"
- [ -n "${healthadvice}" ] && annna-say "${IRC_CMD_USER}, ${healthadvice}"
- ;;
+ [ -n "${healthadvice}" ] && annna-say "${IRC_CMD_USER}, ${healthadvice}";;
"${IRC_USER}, bonjour !") annna-say "${IRC_CMD_USER}, bonjour !";;
*" pets ${IRC_USER}"*) annna-say "${IRC_CMD_USER}, *brrrrr*";;
"${IRC_USER}, please give me a penis extension"*) annna-say "${IRC_CMD_USER}, here: $(penis-extension)";;
@@ -1302,8 +1113,7 @@ $'\001'"ACTION pokes ${IRC_USER}"$'\001') annna-say "$(echo -e '\001')ACTION pok
*) mqtturi="mqtts://bitreich:oogui3queex&o9zaekah@bitreich.org/${mqtturi#mqtt}";;
esac
msg="$(printf "%s\n" "${IRC_PRIVMSG_TEXT}" | cut -d' ' -f 4-)"
- printf "${msg}\n" | mosquitto_pub -L "${mqtturi}" -l
- ;;
+ printf "${msg}\n" | mosquitto_pub -L "${mqtturi}" -l;;
*[Zz]"uckerberg"*) annna-say "${IRC_CMD_USER}, did you mean gophers://bitreich.org/9/memecache/mark-suckerberg.mp4 ?";;
"${IRC_USER}, please pick one of: "*)
pick="$(printf '%s\n' "${IRC_PRIVMSG_TEXT}" \
@@ -1312,17 +1122,13 @@ $'\001'"ACTION pokes ${IRC_USER}"$'\001') annna-say "$(echo -e '\001')ACTION pok
| tr -d ' ' \
| sort -R \
| head -n 1)"
- annna-say "${IRC_CMD_USER}, I think ${pick} is the best option."
- ;;
+ annna-say "${IRC_CMD_USER}, I think ${pick} is the best option.";;
"${IRC_USER}, please play some Bach"*)
midifile="$(find . /home/annna/bin/modules/midi-media/bach -name '*.mid' \
| sort -R \
| head -n 1)"
outfile="/br/gopher/midi/${midifile##*/}.ogg"
- if midi-play "$midifile" >"$outfile"; then
- annna-say "${IRC_CMD_USER}, gophers://bitreich.org/9/midi/${outfile##*/}"
- fi
- ;;
+ midi-play "$midifile" >"$outfile" && annna-say "${IRC_CMD_USER}, gophers://bitreich.org/9/midi/${outfile##*/}";;
"${IRC_USER}, please antidepressant #"*|\
"${IRC_USER}, please amplify #"*|\
"${IRC_USER}, please amsterdamify #"*|\
@@ -1416,8 +1222,7 @@ $'\001'"ACTION pokes ${IRC_USER}"$'\001') annna-say "$(echo -e '\001')ACTION pok
case "${filter}" in
antidepressant|ritual|putin|tshirt)
outfile="${outfile%.*}.jpg"
- outpath="${outpath%.*}.jpg"
- ;;
+ outpath="${outpath%.*}.jpg";;
wat|smith|zucc)
mimetype="$(file --mime-type "$inpath" | cut -d':' -f 2 | cut -c 2-)"
# Only allow images to be free.
@@ -1429,12 +1234,10 @@ $'\001'"ACTION pokes ${IRC_USER}"$'\001') annna-say "$(echo -e '\001')ACTION pok
inpath="${newinpath}"
outfile="${outfile%.*}.png"
- outpath="${outpath%.*}.png"
- ;;
+ outpath="${outpath%.*}.png";;
image/*)
outfile="${outfile%.*}.${origext}"
- outpath="${outpath%.*}.${origext}"
- ;;
+ outpath="${outpath%.*}.${origext}";;
esac
esac
# Cleanup if outpath file is empty.
@@ -1466,18 +1269,13 @@ $'\001'"ACTION pokes ${IRC_USER}"$'\001') annna-say "$(echo -e '\001')ACTION pok
/tmp/*.png) [ -e "${inpath}" ] && rm "${inpath}";;
esac
- if [ -s "${outpath}" ];
- then
- annna-say "${recipient}, gophers://bitreich.org/${outtype}/memecache/filter/${outfile}"
- fi
+ [ -s "${outpath}" ] && annna-say "${recipient}, gophers://bitreich.org/${outtype}/memecache/filter/${outfile}"
} &
- exit 0
- ;;
+ exit 0;;
"${IRC_USER}, please 3d "*)
args=$(echo ${IRC_PRIVMSG_TEXT} | cut -d' ' -f 4-)
outfile=$(blender-effect $args)
- annna-say "${IRC_CMD_USER}, gophers://bitreich.org/I/memecache/3d/${outfile}"
- ;;
+ annna-say "${IRC_CMD_USER}, gophers://bitreich.org/I/memecache/3d/${outfile}";;
# https://ednaundharvey.fandom.com/de/wiki/Droggelbecher
"${IRC_USER}, droggelbecher"*) annna-say "${IRC_CMD_USER}, Droggelbecher!";;
"${IRC_USER}, thanks"*|"${IRC_USER}, thx"*) annna-say "${IRC_CMD_USER}, you're welcome.";;
@@ -1491,8 +1289,7 @@ $'\001'"ACTION pokes ${IRC_USER}"$'\001') annna-say "$(echo -e '\001')ACTION pok
mv "${outfile}" "${outpath}/"
annna-say "${IRC_CMD_USER}, gophers://bitreich.org/I/p/${outfile}"
fi
- } &
- ;;
+ } & ;;
"${IRC_USER}, can "*" certify itself?")
q="${IRC_PRIVMSG_TEXT#* can }"
q="${q% certify*}"
@@ -1503,30 +1300,23 @@ $'\001'"ACTION pokes ${IRC_USER}"$'\001') annna-say "$(echo -e '\001')ACTION pok
then
annna-say "${IRC_CMD_USER}, let us see the certificate: ${curi}"
fi
- } &
- ;;
+ } & ;;
"${IRC_USER}, please mine "*" bitreichcoin"*)
q="${IRC_PRIVMSG_TEXT#* please mine }"
q="${q% bitreichcoin*}"
curi="$(bitreichcoin "$q" | /br/bin/bitreich-paste)"
- annna-say "${IRC_CMD_USER}, please don't spend it all at once: ${curi}"
- ;;
+ annna-say "${IRC_CMD_USER}, please don't spend it all at once: ${curi}";;
"${IRC_USER}, please hug me.") annna-say "$(echo -e '\001')ACTION hugs ${IRC_CMD_USER}$(echo -e '\001')";;
"${IRC_USER}, please hug "*" for me.")
huggee="${IRC_PRIVMSG_TEXT#* please hug }"
huggee="${huggee% for me*}"
- if [ -n "${huggee}" ];
- then
- annna-say "$(echo -e '\001')ACTION hugs ${huggee}$(echo -e '\001')"
- fi
- ;;
+ [ -n "${huggee}" ] && annna-say "$(echo -e '\001')ACTION hugs ${huggee}$(echo -e '\001')";;
"${IRC_USER}, how many fucks were given?") annna-say "${IRC_CMD_USER}, current fucks given: 0.0";;
"${IRC_USER}, please slam the door.") annna-say "${IRC_CMD_USER}, *BANG*";;
"${IRC_USER}, what is my credit score?") annna-say "${IRC_CMD_USER}, your credit score is 0.";;
"${IRC_USER}, please give me a cookie.")
cookie="$(cookie)"
- [ -n "${cookie}" ] && annna-say "$(echo -e '\001')ACTION gives ${IRC_CMD_USER} a ${cookie} cookie$(echo -e '\001')"
- ;;
+ [ -n "${cookie}" ] && annna-say "$(echo -e '\001')ACTION gives ${IRC_CMD_USER} a ${cookie} cookie$(echo -e '\001')";;
"${IRC_USER}, please help"*) annna-say -c "${IRC_CMD_USER}" "See git://bitreich.org/annna for my commands.";;
"${IRC_USER}, please meme meme meme me"*)
randomtag=2
@@ -1542,15 +1332,13 @@ $'\001'"ACTION pokes ${IRC_USER}"$'\001') annna-say "$(echo -e '\001')ACTION pok
done
annna-say "${tagname}: ${taguri}"
randomtag=$((randomtag - 1))
- done
- ;;
+ done;;
"${IRC_USER}, what's the wheelchair shooter meme again?")
tagname="#scrollby"
tagline="$(printf "%s\n" "$(hashtags)" | grep "^${tagname} ")"
tagname="$(printf "%s\n" "${tagline}" | cut -d ' ' -f 1)"
taguri="$(printf "%s\n" "${tagline}" | cut -d ' ' -f 2-)"
- annna-say "${tagname}: ${taguri}"
- ;;
+ annna-say "${tagname}: ${taguri}";;
"${IRC_USER}, TIL "*|"${IRC_USER}, til "*)
minimum_learned_len=12
offset=$(( ${#IRC_USER} + 6 ))
@@ -1566,15 +1354,12 @@ $'\001'"ACTION pokes ${IRC_USER}"$'\001') annna-say "$(echo -e '\001')ACTION pok
then
annna-say "${IRC_CMD_USER}, ${result}"
fi
- fi
- ;;
+ fi;;
"${IRC_USER}, what have I learned?")
if result=$(til-user ${IRC_CMD_USER});
then
annna-say "${IRC_CMD_USER}, ${result}"
- fi
- ;;
-
+ fi;;
esac
printf '%s' "${IRC_PRIVMSG_TEXT}" | awk -v taglimit="$printnhashtags" '
@@ -1594,15 +1379,10 @@ do
pointer=0
revpointer=0
case "${tag}" in
- "*"*)
- tag="#$(printf "%s\n" "${tag}" | sed "s,^[\*]*,,")"
- pointer=1
- ;;
- "&"*)
- tag="#$(printf "%s\n" "${tag}" | sed "s,^[\&]*,,")"
- revpointer=1
- ;;
- *)
+ "*"*) tag="#$(printf "%s\n" "${tag}" | sed "s,^[\*]*,,")"
+ pointer=1;;
+ "&"*) tag="#$(printf "%s\n" "${tag}" | sed "s,^[\&]*,,")"
+ revpointer=1;;
esac
tagline="$(grep "${tag} " "${hashtagfile}" | shuf -n 1)";
@@ -1692,23 +1472,20 @@ case "${IRC_PRIVMSG_TEXT,,}" in
*\#nospoil*);;
*rfc[0-9]*)
rfcname="$(printf "%s\n" "${IRC_PRIVMSG_TEXT}" | sed 's,.*\(rfc[0-9]*\).*,\1,')"
- annna-say "${rfcname}: ftp://ftp.rfc-editor.org/in-notes/${rfcname}.txt"
- ;;
+ annna-say "${rfcname}: ftp://ftp.rfc-editor.org/in-notes/${rfcname}.txt";;
esac
# Always keep the karma / shame last!
case "${IRC_PRIVMSG_TEXT}" in
*"-shaming"*)
shametext="$(printf "%s\n" "${IRC_PRIVMSG_TEXT}" | sed 's,.* \(.*-shaming\).*,\1,')"
- shame "${shametext}" >/dev/null
- ;;
+ shame "${shametext}" >/dev/null;;
*"arma is a bitch"*) annna-say "${IRC_CMD_USER}, I object! Karma is a nice girl!";;
# For referee scoring.
"score "*);;
*++|*--|*-=?|*+=?|*+=-?|*-=-?)
karmatext="$(karma "${IRC_PRIVMSG_TEXT}")"
- [ -n "$karmatext" ] && annna-say "karma: ${karmatext}"
- ;;
+ [ -n "$karmatext" ] && annna-say "karma: ${karmatext}";;
esac
# Membership Level.
@@ -1722,19 +1499,16 @@ done
case "${IRC_PRIVMSG_TEXT}" in
"${IRC_USER}, please go to sleep.")
annna-say "Going to sleep ... Zzzz ..."
- annna-sleep-well
- ;;
+ annna-sleep-well;;
"${IRC_USER}, please wake up.")
annna-wakeup
- annna-say "Good morning BITREICH!"
- ;;
+ annna-say "Good morning BITREICH!";;
"${IRC_USER}, can you show me the uptime please?") annna-say "$(hostname) uptime: $(uptime)";;
"${IRC_USER}, please show me the load.") annna-say "$(hostname) load: $(LANG=C uptime | sed 's,.*load average: \(.*\)$,\1,')";;
"${IRC_USER}, please give me the count of online users.") annna-say "$(hostname): $(who -q | tail -n 1 | cut -d'=' -f 2)";;
"${IRC_USER}, please update the phlog index.")
phlog-index > /dev/null 2>&1
- annna-say "Thanks! Your request has been fulfilled with the quickness! :)"
- ;;
+ annna-say "Thanks! Your request has been fulfilled with the quickness! :)";;
esac
# Referee Level.
@@ -1751,8 +1525,7 @@ case "${IRC_PRIVMSG_TEXT}" in
case "${IRC_PRIVMSG_TEXT}" in
*++|*--|*-=?|*+=?|*+=-?|*-=-?|*-=??|*+=??|*-=-??|*-=65536*)
scoretext="$(brcon-score "${IRC_PRIVMSG_TEXT}")"
- [ -n "$scoretext" ] && annna-say "brcon score: ${scoretext}"
- ;;
+ [ -n "$scoretext" ] && annna-say "brcon score: ${scoretext}";;
esac;;
esac