Introduction
Introduction Statistics Contact Development Disclaimer Help
annna-message-common - annna - Annna the nice friendly bot.
git clone git://bitreich.org/annna/ git://enlrupgkhuxnvlhsf6lc3fziv5h2hhfrinws6…
Log
Files
Refs
Tags
README
---
annna-message-common (64361B)
---
1 #!/bin/bash
2
3 export PATH="/br/bin:$PATH"
4
5 cfgbase="$(pwd)"
6 ircbase="$(cat ${cfgbase}/ircbase)"
7 modbase="$(cat ${cfgbase}/modbase)"
8 hashtagfile="${modbase}/hashtags/hashtags.txt"
9 idontcaredb="${modbase}/i-dont-care/i-dont-care.txt"
10 printnhashtags=2
11 brmembers="__20h__ Evil_Bob chripo posativ quinq stateless solene josuah…
12 referees="__20h__"
13 ignorednicks="eidolon"
14 linkbrotherchannels="#bitreich-con"
15
16 server="$1"
17 ircuser="$(cat ${cfgbase}/${server}/ircuser)"
18 channel="$2"
19 user="$3"
20 text="$4"
21 annnasumerian="𒈹"
22 annnabirthday="1989-05-18"
23
24 hashtags() {
25 cat ${hashtagfile} 2>/dev/null
26 }
27
28 hashtagcount() {
29 int2bit "$(curl -s gophers://bitreich.org/1/meme/count \
30 | grep total \
31 | head -n 1 \
32 | sed 's,.*total on .*: \([0-9]*\)),\1,')"
33 }
34
35 regeximatch() {
36 printf '%s' "$1" | grep -i -E -q "$2"
37 }
38
39 #printf "%s %s %s %s\n" "${0##*/}" "${channel}" "${user}" "${text}"
40
41 [ "$user" = "${ircuser}" ] && exit 0
42
43 isignored=0
44 for ignorednick in $ignorednicks;
45 do
46 [ "$user" = "$ignorednick" ] && isignored=1
47 done
48 [ $isignored -eq 1 ] && exit
49
50 # Flag, if some expansion of some URI happened.
51 uriexpansion=0
52 # Do not spoil at all.
53 nospoil=0
54 # Enforce spoiling in case of hard nospoil filter.
55 dospoil=0
56 # Expand meme hashtag and show recommendations.
57 doexpand=0
58
59 case "${text}" in
60 *\#nospoil*)
61 nospoil=1
62 ;;
63 *\#expand*)
64 doexpand=1
65 ;;
66 *::*::*)
67 if [ $(pgrep -f stable-diffusion-emoji 2>/dev/null | wc -l) -gt …
68 then
69 annna-say -s "${server}" -c "${channel}" "${user}, sorry…
70 else
71 {
72 query=${text#**::} query=${query%%::*}
73 emojiuri="$(stable-diffusion-emoji "${query}")"
74 if [ -n "${emojiuri}" ];
75 then
76 if [ -n "${user}" ] && [ "${user}" != "a…
77 then
78 annna-say -s "${server}" -c "${c…
79 else
80 annna-say -s "${server}" -c "${c…
81 fi
82 fi
83 } &
84 fi
85 ;;
86 *http*://*|*ytdl://*)
87 case "${text}" in
88 *"#spoil"*)
89 dospoil=1
90 ;;
91 esac
92
93 case "${text}" in
94 *http*://*)
95 uri="$(printf "%s\n" "${text}" \
96 | sed -n '/.*\(https\{0,1\}:\/\/[^ ]\{1,\}\).*/s…
97 ;;
98 *ytdl://*)
99 ytid="$(printf "%s\n" "${text}" \
100 | sed -n '/.*ytdl:\/\/\([^ ]\{1,\}\).*/s//\1/p')"
101 uri="$(printf "https://www.youtube.com/watch?v=%s" "${yt…
102 ;;
103 esac
104
105 # Set below and annna will concatenate at the end.
106 # HTML title.
107 urititle=""
108 # Subtitle URI.
109 sturi=""
110 # Replacement URI.
111 nuri=""
112 # Replacement URI display string.
113 nuris=""
114 # html2text content.
115 curi=""
116 # Set to 0, if some URI content should be shown.
117 nocuri=1
118 # Screenshot.
119 suri=""
120
121 # titleend=1 will not output any further.
122 titleend=0
123 outputstr=""
124
125 if is-invidious-instance "${uri}";
126 then
127 host="$(printf "%s\n" "${uri}" \
128 | sed 's,.*://\([^/]*\).*,\1,')"
129 if [ -n "${host}" ];
130 then
131 uri="$(printf "%s\n" "${uri}" \
132 | sed "s,${host},youtube.com,")"
133 fi
134 fi
135
136 tmpf=$(mktemp)
137 fetch-uri "${uri}" > "${tmpf}"
138 if [ ! -s "${tmpf}" ];
139 then
140 archiveorguri="$(archiveorg-uri "${uri}")"
141 if [ -n "${archiveorguri}" ];
142 then
143 sarchiveorguri="$(bitreich-uri-shortener "${arch…
144 nuris="archive: ${sarchiveorguri}"
145 fetch-uri "${archiveorguri}" > "${tmpf}"
146 fi
147 fi
148 [ -s "${tmpf}" ] && urititle="$(grabtitle < "${tmpf}")"
149
150 case "${urititle}" in
151 "")
152 ;;
153 *Gunther*|*GUNTHER*|*Günther*|*GÜNTHER*)
154 annna-say -s "${server}" -c "${channel}" "Oh Günther! �…
155 uriexpansion=1
156 ;;
157 *\|\ Cloudflare*|"Just a moment...")
158 annna-say -s "${server}" -c "${channel}" "Mind your own …
159 titleend=1
160 uriexpansion=1
161 ;;
162 esac
163
164 case "${uri}" in
165 "")
166 ;;
167 *github.com/*/blob/*)
168 urltitle=""
169 nuris="$(printf '%s' "${uri}" | sed 's/blob/raw/')"
170 nocuri=0
171 ;;
172 *imgur.com/*)
173 nuris="$(youtube-dl -g "${uri}")" || nuris=""
174 ;;
175 *xkcd.com/*)
176 nuris="$(xkcd-uri "${uri}")"
177 ;;
178 *imdb.com/title/*)
179 imdbstr="$(imdb2gopherbay "${uri}")"
180 if [ -n "${imdbstr}" ];
181 then
182 nuris="${imdbstr}"
183 urititle=""
184 fi
185 ;;
186 # bay.parazy.de is unmaintained
187 #*themoviedb.org/movie/*)
188 # movietitle="$(themoviedb2gopherbay "${uri}" | sed 's, ,…
189 # if [ -n "${movietitle}" ];
190 # then
191 # nuris="gophers://bay.parazy.de:666/1/q.dcgi?${m…
192 # fi
193 # ;;
194 *lichess.org/????????|*lichess.org/????????/|*lichess.org/??????…
195 nuris="$(printf "%s\n" "${uri}" \
196 | sed 's,https://lichess.org\(/[^ ]*\)$,\1,; s,^…
197 ;;
198 *npr.org/*)
199 post="$(printf '%s\n' "${uri}" | sed -n 's@.*/\([0-9]\{1…
200 if [ -n "${post}" ];
201 then
202 nuri="https://text.npr.org/${post}"
203 nuris="text only: ${nuri}"
204 fi
205 ;;
206 *csdb.dk/release/*)
207 sid=$(awk '/<a href="download\.php.*\.sid/ { match($0, /…
208 [ -n "$sid" ] && nuris="listen: $sid"
209 ;;
210 *www.forgottenweapons.com/*)
211 ytid=$(sed -n '/<meta name="description"/ s/.*https:\/\/…
212 if [ -n "$ytid" ]; then
213 nuris="video: ytdl://$ytid ;"
214 nuris="$nuris metadata: gophers://codemadness.or…
215 fi
216 ;;
217 *www.reddit.com*)
218 nuri="$(printf '%s\n' "${uri}" | sed "s;www.reddit.com;o…
219 nuris="old.reddit: ${nuri}"
220 fetch-uri "${nuri}" > "${tmpf}"
221 if [ -n "${uri#*www.reddit.com/r/*}" ];
222 then
223 subreddit="$(printf '%s\n' "${uri}" | cut -d / -…
224 post="$(printf '%s\n' "${uri}" | cut -d / -f 7)"
225 if [ -n "${post}" ];
226 then
227 guri="gopher://gopherddit.com/1/cgi-bin/…
228 else
229 guri="gopher://gopherddit.com/1/cgi-bin/…
230 fi
231 nuris="${nuri} ; gopherdit: ${guri}"
232 fi
233 nocuri=0
234 ;;
235 *taz.de*)
236 newsid="$(printf '%s\n' "${uri}" | sed 's,.*\(![0-9]*\).…
237 if [ -n "${newsid}" ];
238 then
239 urititle="$(curl-grabtitle "${uri}")"
240 nuris="gopher://taz.de/1/${newsid}"
241 nocuri=1
242 fi
243 ;;
244 *twitter.com*)
245 #ninstance="$(nitter-instance | sed 's,\.,\\\.,g')"
246 #nuri="$(printf "%s\n" "${uri}" | sed "s;\(mobile\.\)\{0…
247 fetch-uri "${uri}" > "${tmpf}"
248 urititle="$(curl-grabtitle "${uri}")"
249 #suri="$(screenshot-paste "${uri}")"
250 #nuris="nitter: ${nuri}"
251 nocuri=0
252 ;;
253 *.wikipedia.org/wiki/*)
254 if ! regeximatch "$uri" '\.(jpg,bmp,gif,png,tiff,avi,mp4…
255 then
256 nuri="$(printf '%s\n' "${uri}" | sed -e "s;/wiki…
257 nuris="$(printf 'pdf: %s\n' "${nuri}")"
258 nocuri=1
259 fi
260 ;;
261 *youtube.com/*|*youtu.be/*)
262 # Youtube is so annoying and repeatedly broken;
263 # they hate users, only expand on request.
264 if [ $dospoil -eq 1 ];
265 then
266 if [ -z "${uri##*youtu.be/*}" ] \
267 || [ -z "${uri##*/watch?v=*}" ] \
268 || [ -z "${uri##*/embed/*}" ] \
269 || [ -z "${uri##*/shorts/*}" ];
270 then
271 ytid="${uri#http*://*/watch?v=}"
272 ytid="${ytid##*embed/}"
273 ytid="${ytid##*shorts/}"
274 ytid="${ytid##*youtu.be/}"
275 ytid="${ytid%%\?*}"
276 ytid="${ytid%%&*}"
277 nuri="$(get-invidious-instance)/watch?v=…
278 ytt="$(printf '%s\n' "${uri}" | sed -n '…
279 [ -n "${ytt}" ] && nuri="${nuri}&t=${ytt…
280 else
281 ytid=""
282 nuri="$(get-invidious-instance)/${uri#ht…
283 fi
284 fetch-uri "${nuri}" > "${tmpf}"
285 urititle="$(curl-grabtitle "${nuri}")"
286 nuris="invidious: ${nuri}"
287 if [ -n "${ytid}" ];
288 then
289 sturi="$(subtitle-paste "${uri}")"
290 nuris="${nuris} ; metadata: gophers://co…
291 fi
292 # If there was no title found, do not display.
293 [ -z "${urititle}" ] && titleend=1
294 nocuri=1
295 else
296 titleend=1
297 fi
298 ;;
299 *tv.brain.rip/???-???*)
300 nuris="$(grep 'property="og:video:secure_url' < "${tmpf}…
301 urititle="$(grep 'name="description' < "${tmpf}" | sed '…
302 nocuri=1
303 ;;
304 *)
305 mimetype="$(file -b --mime-type "${tmpf}")"
306 case "${mimetype}" in
307 text/*|application/javascript)
308 nocuri=0
309 ;;
310 esac
311 ;;
312 esac
313
314 if [ $titleend -eq 0 ];
315 then
316 if [ $nocuri -eq 0 ];
317 then
318 [ -z "${curi}" ] && curi="$(html2text < "${tmpf}…
319 outputstr="${outputstr} content: ${curi} ;"
320 fi
321
322 [ -n "${nuris}" ] && outputstr="${outputstr} ${nuris} ;"
323 [ -n "${urititle}" ] && outputstr="${outputstr} title: $…
324 [ -n "${suri}" ] && outputstr="${outputstr} screen: ${su…
325 [ -n "${sturi}" ] && outputstr="${outputstr} subtitles: …
326 annna-say -s "${server}" -c "${channel}" "${outputstr}"
327 uriexpansion=1
328 fi
329 rm -f "${tmpf}"
330 ;;
331 esac
332
333 runlinkbrother=0
334 for linkbrotherchannel in $linkbrotherchannels;
335 do
336 [ "$channel" = "$linkbrotherchannel" ] && runlinkbrother=1
337 done
338 if [ $runlinkbrother -eq 1 ] && [ $nospoil -eq 0 ];
339 then
340 critique=$($modbase/linkbrother/linkbrother.sh "$modbase/linkbro…
341 if [ "$critique" ]; then
342 annna-say -s "${server}" -c "${channel}" "$critique"
343 fi
344 fi
345
346 case "${text}" in
347 "${ircuser}"?)
348 exclamation="$(printf "%s\n" "${text}" | sed "s,${ircuser}\(.\),…
349 exclamationsintime=$(exclamatio "${user}")
350 finalexclamation="${exclamation}"
351 while [ $exclamationsintime -gt 1 ];
352 do
353 finalexclamation="${finalexclamation}${exclamation}"
354 exclamationsintime=$(($exclamationsintime - 1))
355 done
356 annna-say -s "${server}" -c "${channel}" "${user}${finalexclamat…
357 ;;
358 "${ircuser}, how old are you?")
359 age="$(ddiff ${annnabirthday} today -f "%y")"
360 annna-say -s "${server}" -c "${channel}" "${user}, I am ${age} y…
361 ;;
362 "${ircuser}, when is your birthday?")
363 annna-say -s "${server}" -c "${channel}" "${user}, I am born on …
364 ;;
365 "${ircuser}, asl"*)
366 annna-say -s "${server}" -c "${channel}" "${user}, age: born on …
367 ;;
368 "${ircuser}, woop")
369 # Using the same database for funny hacks.
370 exclamation="$(printf "%s\n" "${text}" | sed "s;${ircuser}, \(.\…
371 exclamationsintime=$(exclamatio "${user}")
372 finalexclamation="${exclamation}"
373 while [ $exclamationsintime -gt 1 ];
374 do
375 finalexclamation="${finalexclamation} ${exclamation}"
376 exclamationsintime=$(($exclamationsintime - 1))
377 done
378 annna-say -s "${server}" -c "${channel}" "${user}, ${finalexclam…
379 ;;
380 "${ircuser}, hype")
381 # Using the same database for funny hacks.
382 exclamation="$(printf "%s\n" "${text}" | sed "s;${ircuser}, \(.\…
383 exclamationsintime=$(exclamatio "${user}")
384 finalexclamation="${exclamation}"
385 while [ $exclamationsintime -gt 1 ];
386 do
387 finalexclamation="${finalexclamation} ${exclamation}"
388 exclamationsintime=$(($exclamationsintime - 1))
389 done
390 annna-say -s "${server}" -c "${channel}" "${user}, ${finalexclam…
391 ;;
392 *">:3"*)
393 annna-say -s "${server}" -c "${channel}" "OMG IT'S A LION GET IN…
394 ;;
395 *"<3"*)
396 love "${user}++"
397 annna-say -s "${server}" -c "${channel}" "*o.o*"
398 ;;
399 *"m(")
400 annna-say -s "${server}" -c "${channel}" "(-‸ლ)"
401 ;;
402 *"*shrug*"*)
403 annna-say -s "${server}" -c "${channel}" "¯\\_(ツ)_/¯"
404 ;;
405 *"*glare*"*)
406 annna-say -s "${server}" -c "${channel}" "ಠ_ಠ"
407 ;;
408 *"*finger*"*)
409 annna-say -s "${server}" -c "${channel}" "╭∩╮(ಠ_ಠ)╭�…
410 ;;
411 *"*yolo*"*)
412 annna-say -s "${server}" -c "${channel}" "Yᵒᵘ Oᶰˡʸ Lᶤ�…
413 ;;
414 *":'(")
415 annna-say -s "${server}" -c "${channel}" "(╯︵╰,)"
416 ;;
417 "Thanks ${ircuser}"*)
418 annna-say -s "${server}" -c "${channel}" "${user}, you are welco…
419 ;;
420 *" ope sorry"*|"ope sorry"*)
421 annna-say -s "${server}" -c "${channel}" "${user}, 😃pe sorry."
422 ;;
423 "${ircuser}, snake.")
424 annna-say -s "${server}" -c "${channel}" "${user}, ssSSsSssSssSs…
425 ;;
426 "${ircuser}, snoke.")
427 annna-say -s "${server}" -c "${channel}" "${user}, snoke again?"
428 ;;
429 "${ircuser}, amirite?")
430 annna-say -s "${server}" -c "${channel}" "${user}, Yep, you're t…
431 ;;
432 "${ircuser}, ping.")
433 annna-say -s "${server}" -c "${channel}" "${user}, pong."
434 ;;
435 "${ircuser}, how lame is my nick?")
436 lamenessstr="$(lameness "${user}")"
437 annna-say -s "${server}" -c "${channel}" "${lamenessstr}"
438 ;;
439 "${ircuser}, ding.")
440 annna-say -s "${server}" -c "${channel}" "${user}, dong."
441 ;;
442 "${ircuser}, irly"*)
443 annna-say -s "${server}" -c "${channel}" "${user}, I love you to…
444 ;;
445 "${ircuser}, bleep bloop.")
446 annna-say -s "${server}" -c "${channel}" "${user}, bloop bleep."
447 ;;
448 "${ircuser}, snare.")
449 annna-say -s "${server}" -c "${channel}" "${user}, not snare aga…
450 ;;
451 "${ircuser}, I am mad.")
452 annna-say -s "${server}" -c "${channel}" "${user}, we have a MAD…
453 ;;
454 "${ircuser}, I am holy.")
455 annna-say -s "${server}" -c "${channel}" "${user}, Holy shit thi…
456 ;;
457 "${ircuser}, please compliment me.")
458 annna-say -s "${server}" -c "${channel}" "${user}, you rock!"
459 ;;
460 "${ircuser}, what the karma?")
461 annna-say -s "${server}" -c "${channel}" "${user}, gophers://bit…
462 ;;
463 "${ircuser}, who is lovely?")
464 annna-say -s "${server}" -c "${channel}" "${user}, gophers://bit…
465 ;;
466 "${ircuser}, what the brcon score?")
467 annna-say -s "${server}" -c "${channel}" "${user}, gophers://bit…
468 ;;
469 "${ircuser}, what the shame?")
470 annna-say -s "${server}" -c "${channel}" "${user}, gophers://bit…
471 ;;
472 "${ircuser}, please generate a password for me.")
473 newpws="$(pwgen -B1ny 20 10 | paste -sd ' ')"
474 annna-say -s "${server}" -c "${channel}" "${user}, as you wish: …
475 ;;
476 *"don't care"*)
477 dontcaresay="$(shuf -n 1 ${idontcaredb})"
478 annna-say -s "${server}" -c "${channel}" "${user}, ${dontcaresay…
479 ;;
480 "${ircuser}, how can I phlog on bitreich?")
481 annna-say -s "${server}" -c "${channel}" "${user}, please read: …
482 ;;
483 "${ircuser}, what's my type?")
484 {
485 cd /br/gopher
486 usertype="$(find memecache/type-?.png -type f \
487 | shuf -n 1 \
488 | xargs -n 1 printf "gophers://bitreich.org/9%s\…
489 annna-say -s "${server}" -c "${channel}" "${user}, your …
490 }
491 ;;
492 "${ircuser}, please show me a video about "*)
493 word="$(printf "%s\n" "${text}" | cut -c 37-)"
494 case "$word" in
495 *\?)
496 word="$(printf "%s\n" "${word}" | cut -c -"$((${#word} -…
497 ;;
498 esac
499 videoresult="$(idiotbox-roulette "${word}")"
500 if [ -n "${videoresult}" ];
501 then
502 annna-say -s "${server}" -c "${channel}" "${user}, ${vid…
503 else
504 annna-say -s "${server}" -c "${channel}" "${user}, sorry…
505 fi
506 ;;
507 "${ircuser}, what is my fortune?")
508 fortunecookie="$(fortune-cookie)"
509 if [ -n "${fortunecookie}" ];
510 then
511 annna-say -s "${server}" -c "${channel}" "${user}, ${for…
512 fi
513 ;;
514 "${ircuser}, what is "*)
515 word="$(printf "%s\n" "${text}" | cut -c 16-)"
516 case "$word" in
517 *\?)
518 word="$(printf "%s\n" "${word}" | cut -c -"$((${#word} -…
519 ;;
520 esac
521
522 dictserver="dict.org"
523 case "${word}" in
524 dict.org*)
525 dictserver="dict.org"
526 word="$(printf "%s\n" "${word}" | cut -c 9-)"
527 ;;
528 # parazy.de is unmaintained
529 #parazy.de*)
530 # dictserver="parazy.de"
531 # word="$(printf "%s\n" "${word}" | cut -c 10-)"
532 # ;;
533 esac
534
535 dresult="$(dictcurl "${dictserver}" "" "${word}")"
536 if [ -z "${dresult}" ];
537 then
538 puri="No match found."
539 else
540 puri="$(printf "%s\n" "${dresult}" | /br/bin/bitreich-pa…
541 fi
542 annna-say -s "${server}" -c "${channel}" "${puri}"
543 ;;
544 "${ircuser}, cowsay "*)
545 word="$(printf "%s\n" "${text}" | cut -c 15-)"
546 tmpf=$(mktemp)
547 if cowsayasaservice ${word} > ${tmpf}; then
548 curi="$(/br/bin/bitreich-paste < ${tmpf})"
549 annna-say -s "${server}" -c "${channel}" "${user}: the c…
550 fi
551 rm ${tmpf} 2>/dev/null
552 ;;
553 "${ircuser}, please give me the unix power.")
554 upcuri="$(unix-power)"
555 if [ -n "${upcuri}" ];
556 then
557 annna-say -s "${server}" -c "${channel}" "${user}, ${upc…
558 fi
559 ;;
560 "${ircuser}, please stop the last emoji prompt.")
561 lastemojipromptpid="$(pgrep -f stable-diffusion-emoji | sort -n …
562 if [ -n "${lastemojipromptpid}" ];
563 then
564 pstree -A -p "${lastemojipromptpid}" | grep -Eow "[0-9]+…
565 annna-say -s "${server}" -c "${channel}" "${user}, I HUP…
566 else
567 annna-say -s "${server}" -c "${channel}" "${user}, sorry…
568 fi
569 ;;
570 "${ircuser}, play despacito plz.")
571 annna-say -s "${server}" -c "${channel}" "${user}, gophers://bit…
572 ;;
573 "nice to meet you ${ircuser}"*)
574 annna-say -s "${server}" -c "${channel}" "${user}, the pleasure …
575 ;;
576 "${ircuser}, please give me a Chuck Norris fact.")
577 chuck=$(chucknorris)
578 annna-say -s "${server}" -c "${channel}" "${user}, ${chuck}"
579 ;;
580 "${ircuser}, magic.")
581 magictrick="$(magic)"
582 if [ -n "${magictrick}" ];
583 then
584 annna-say -s "${server}" -c "${channel}" "${user}, ${mag…
585 fi
586 ;;
587 "${ircuser}, please show me ip art.")
588 annna-say -s "${server}" -c "${channel}" "${user}, please see #b…
589 {
590 cd $HOME/bin/modules/ip-art;
591 # Lock, so only one annna process manipulates eth0.
592 flock $HOME/bin/modules/ip-art -c "./display-file.sh ip-…
593 } &
594 ;;
595 "${ircuser}, I feel button.")
596 buri="$(button-gen)"
597 if [ -n "${buri}" ];
598 then
599 annna-say -s "${server}" -c "${channel}" "${user}, like …
600 else
601 annna-say -s "${server}" -c "${channel}" "${user}, sorry…
602 fi
603 ;;
604 "${ircuser}, I feel stupid.")
605 nuri=$(darwin)
606 tmpf=$(mktemp)
607 fetch-uri "${nuri}" > "${tmpf}"
608 curi="$(9 htmlfmt < "${tmpf}" | /br/bin/bitreich-paste)"
609 annna-say -s "${server}" -c "${channel}" "${user}, do not feel s…
610 rm ${tmpf} 2>/dev/null
611 ;;
612 "${ircuser}, I feel down.")
613 postmortem="$(post-mortem | /br/bin/bitreich-paste)"
614 annna-say -s "${server}" -c "${channel}" "${user}, do not feel b…
615 ;;
616 "${ircuser}, I feel perl.")
617 perlfeelings="$(perl-feelings)"
618 if [ -n "${perl-feelings}" ];
619 then
620 annna-say -s "${server}" -c "${channel}" "${user}, I fee…
621 fi
622 ;;
623 "${ircuser}, will you be my girlfriend?")
624 rejection="$(girlfriend)"
625 annna-say -s "${server}" -c "${channel}" "${user}, ${rejection}"
626 ;;
627 "${ircuser}, who fights crime?"|"${ircuser}, who is fighting crime?")
628 partner=$(echo $brmembers | awk '{for (i = 1; i < NF; i++) print…
629 crimefighter="$(theyfightcrime ${user} ${partner})"
630 annna-say -s "${server}" -c "${channel}" "${crimefighter}"
631 ;;
632 "${ircuser}, please give me a commit message.")
633 commitmsg="$(whatthecommit)"
634 annna-say -s "${server}" -c "${channel}" "${commitmsg}"
635 ;;
636 "${ircuser}, birp.")
637 birdname="$(bird-name)"
638 annna-say -s "${server}" -c "${channel}" "${user}, I heard a ${b…
639 ;;
640 "${ircuser}, please oneline me.")
641 randomoneliner="$(oneliner)"
642 if [ -z "${randomoneliner}" ];
643 then
644 annna-say -s "${server}" -c "${channel}" "${user}, the s…
645 else
646 annna-say -s "${server}" -c "${channel}" "${user}, ${ran…
647 fi
648 ;;
649 *"what's app?")
650 maemoapp="$(whatsapp)"
651 if [ -n "${maemoapp}" ];
652 then
653 annna-say -s "${server}" -c "${channel}" "Have you tried…
654 fi
655 ;;
656 "${ircuser}, man "*|"${ircuser}, man "*)
657 exp="$(printf "%s\n" "${text}" | cut -c 12- | sed 's,\t, ,g')"
658 dresult="$(COLUMNS=80 man "${exp}" 2>/dev/null)"
659
660 if [ "$dresult" ];
661 then
662 puri="$(printf "%s" "${dresult}" | /br/bin/bitreich-past…
663 else
664 puri="No matches found."
665 fi
666
667 annna-say -s "${server}" -c "${channel}" "${puri}"
668 ;;
669 "${ircuser}, please pray for me.")
670 annna-say -s "${server}" -c "${channel}" "${user}, here, for you…
671 ;;
672 "${ircuser}, nigger."|*nigger*|*NIGGER*)
673 nword="$(n-word)"
674 annna-say -s "${server}" -c "${channel}" "${user}, don't use the…
675 ;;
676 "${ircuser}, why was I breached?")
677 breachtext="$(why-was-i-breached)"
678 if [ -n "${breachtext}" ];
679 then
680 annna-say -s "${server}" -c "${channel}" "${user}, ${bre…
681 fi
682 ;;
683 "${ircuser}, please be responsible about "*)
684 word="$(printf "%s\n" "${text}" | cut -c 36- | sed 's,\t, ,g'…
685 suri="$(responsibility "${word}" | bitreich-paste)"
686 annna-say -s "${server}" -c "${channel}" "${suri}"
687 ;;
688 "${ircuser}, please say "*)
689 word="$(printf "%s\n" "${text}" | cut -c 19- | sed 's,\t, ,g'…
690 suri="$(printf "%s\n" "${word}" | bitreich-speak)"
691 annna-say -s "${server}" -c "${channel}" "${suri}"
692 ;;
693 "${ircuser}, please zombie say "*)
694 word="$(printf "%s\n" "${text}" | cut -c 26- | sed 's,\t, ,g'…
695 suri="$(printf "%s\n" "${word}" | zombie -e | bitreich-speak)"
696 annna-say -s "${server}" -c "${channel}" "${suri}"
697 ;;
698 "${ircuser}, please unzombie "*)
699 word="$(printf "%s\n" "${text}" | cut -c 24- | sed 's,\t, ,g'…
700 suri="$(printf "%s\n" "${word}" | zombie -d)"
701 annna-say -s "${server}" -c "${channel}" "${suri}"
702 ;;
703 "${ircuser}, please zombie "*)
704 word="$(printf "%s\n" "${text}" | cut -c 22- | sed 's,\t, ,g'…
705 suri="$(printf "%s\n" "${word}" | zombie -e)"
706 annna-say -s "${server}" -c "${channel}" "${suri}"
707 ;;
708 "${ircuser}, please ghost say "*)
709 word="$(printf "%s\n" "${text}" | cut -c 25- | sed 's,\t, ,g'…
710 suri="$(printf "%s\n" "${word}" | ghost -e | bitreich-speak)"
711 annna-say -s "${server}" -c "${channel}" "${suri}"
712 ;;
713 "${ircuser}, please unghost "*)
714 word="$(printf "%s\n" "${text}" | cut -c 23- | sed 's,\t, ,g'…
715 suri="$(printf "%s\n" "${word}" | ghost -d)"
716 annna-say -s "${server}" -c "${channel}" "${suri}"
717 ;;
718 "${ircuser}, please ghost "*)
719 word="$(printf "%s\n" "${text}" | cut -c 21- | sed 's,\t, ,g'…
720 suri="$(printf "%s\n" "${word}" | ghost -e)"
721 annna-say -s "${server}" -c "${channel}" "${suri}"
722 ;;
723 "${ircuser}, please pohlish "*)
724 word="$(printf "%s\n" "${text}" | cut -c 23- | sed 's,\t, ,g'…
725 suri="$(pohlcode.awk "${word}" | head -n 1)"
726 annna-say -s "${server}" -c "${channel}" "${suri}"
727 ;;
728 "${ircuser}, please cunei "*)
729 word="$(printf "%s\n" "${text}" | cut -c 21- | sed 's,\t, ,g'…
730 suri="$(int2cunei "${word}" | head -n 1)"
731 annna-say -s "${server}" -c "${channel}" "${suri}"
732 ;;
733 "${ircuser}, what can I cook with "*)
734 ingredients="$(printf "%s\n" "${text}" | cut -c 29- | sed 's,\t,…
735 case "$ingredients" in
736 *\?)
737 ingredients="$(printf "%s\n" "${ingredients}" | cut -c -…
738 ;;
739 esac
740
741 results="$(fridge-recipe-search "${ingredients}")"
742 if [ -n "${results}" ];
743 then
744 puri="$(printf "%s\n" "${results}" | bitreich-paste | se…
745 annna-say -s "${server}" -c "${channel}" "${user}, here …
746 else
747 gptchefrecipe="$(gpt-chef "${ingredients}")"
748 if [ -n "${gptchefrecipe}" ];
749 then
750 annna-say -s "${server}" -c "${channel}" "${user…
751 if [ $(pgrep -f stable-diffusion-emoji 2>/dev/nu…
752 then
753 {
754 emojiuri="$(stable-diffusion-emo…
755 if [ -n "${emojiuri}" ];
756 then
757 annna-say -s "${server}"…
758 fi
759 } &
760 fi
761 else
762 annna-say -s "${server}" -c "${channel}" "${user…
763 fi
764 fi
765 ;;
766 "${ircuser}, gpt "*)
767 # TODO: use modules/prompt-agents
768 prompt="$(printf "%s\n" "${text}" | cut -c 12- | sed 's,\t, ,…
769 {
770 annna-say -s "${server}" -c "${channel}" "$(gpt "${promp…
771 } &
772 ;;
773 "${ircuser}, grumpy "*)
774 # TODO: use modules/prompt-agents
775 prompt="$(printf "%s\n" "${text}" | cut -c 15- | sed 's,\t, ,…
776 {
777 annna-say -s "${server}" -c "${channel}" "$(gpt-grumpy "…
778 } &
779 ;;
780 "${ircuser}, preach "*)
781 # TODO: use modules/prompt-agents
782 prompt="$(printf "%s\n" "${text}" | cut -c 15- | sed 's,\t, ,…
783 {
784 annna-say -s "${server}" -c "${channel}" "$(gpt-preach "…
785 } &
786 ;;
787 "${ircuser}, uplifting "*)
788 # TODO: use modules/prompt-agents
789 prompt="$(printf "%s\n" "${text}" | cut -c 18- | sed 's,\t, ,…
790 {
791 annna-say -s "${server}" -c "${channel}" "$(gpt-upliftin…
792 } &
793 ;;
794 "Santa, "*|"Sannnta, "*|"santa, "*|"sannnta, "*)
795 personality="santa"
796 preprompt="$(cat ${modbase}/prompt-agents/${personality}.prompt.…
797 prompt="$(printf "%s\n" "${text}" | cut -d' ' -f 2- | sed 's,\t,…
798 {
799 annna-say -s "${server}" -c "${channel}" "$(gpt "System:…
800 } &
801 ;;
802 "Satan, "*|"Satannn, "*|"satan, "*|"satannn, "*)
803 personality="satan"
804 preprompt="$(cat ${modbase}/prompt-agents/${personality}.prompt.…
805 prompt="$(printf "%s\n" "${text}" | cut -d' ' -f 2- | sed 's,\t,…
806 {
807 annna-say -s "${server}" -c "${channel}" "$(gpt "System:…
808 } &
809 ;;
810 "Teleromeo, "*|"teleromeo, "*)
811 personality="teleromeo"
812 preprompt="$(cat ${modbase}/prompt-agents/${personality}.prompt.…
813 prompt="$(printf "%s\n" "${text}" | cut -d' ' -f 2- | sed 's,\t,…
814 {
815 annna-say -s "${server}" -c "${channel}" "$(gpt "System:…
816 } &
817 ;;
818 "Modem, "*|"modem, "*)
819 personality="modem"
820 preprompt="$(cat ${modbase}/prompt-agents/${personality}.prompt.…
821 prompt="$(printf "%s\n" "${text}" | cut -d' ' -f 2- | sed 's,\t,…
822 {
823 annna-say -s "${server}" -c "${channel}" "$(gpt "System:…
824 } &
825 ;;
826 "Sadh_Guru, "*|"Sadh_guru, "*|"sadh_guru, "*|"sadh_Guru, "*)
827 personality="sadh_guru"
828 preprompt="$(cat ${modbase}/prompt-agents/${personality}.prompt.…
829 prompt="$(printf "%s\n" "${text}" | cut -d' ' -f 2- | sed 's,\t,…
830 {
831 annna-say -s "${server}" -c "${channel}" "$(gpt "System:…
832 } &
833 ;;
834 "Prophet, "*|"prophet, "*)
835 personality="prophet"
836 preprompt="$(cat ${modbase}/prompt-agents/${personality}.prompt.…
837 prompt="$(printf "%s\n" "${text}" | cut -d' ' -f 2- | sed 's,\t,…
838 {
839 annna-say -s "${server}" -c "${channel}" "$(gpt "System:…
840 } &
841 ;;
842 "Luther, "*|"luther, "*)
843 personality="luther"
844 preprompt="$(cat ${modbase}/prompt-agents/${personality}.prompt.…
845 prompt="$(printf "%s\n" "${text}" | cut -d' ' -f 2- | sed 's,\t,…
846 {
847 annna-say -s "${server}" -c "${channel}" "$(gpt "System:…
848 } &
849 ;;
850 "${ircuser}, wolfram is "*)
851 word="$(printf "%s\n" "${text}" | cut -c 19- | sed 's,\t, ,g'…
852 case "$word" in
853 *\?)
854 word="$(printf "%s\n" "${word}" | cut -c -"$(($(expr len…
855 ;;
856 esac
857
858 puri=""
859 dresult="$(printf "/wolfram\t%s\r\n" "${word}" \
860 | nc magical.fish 70 \
861 | awk '/iAnswer:/,/iAsk/' \
862 | grep -v '^i ' \
863 | head -n -1 \
864 | tail -n +2 \
865 | sed 's,i\(.*\)fake\texample.com.*,\1,;s,[ \t]*$,,')"
866
867 if [ -n "$dresult" ];
868 then
869 case "${dresult}" in
870 b*)
871 dresult="$(printf "%s\n" "${dresult}" \
872 | tr '\n' ' ' \
873 | sed "s,^b',,;s,' $,," \
874 | sed 's,^b",,;s," $,,' \
875 | sed 's,\\n,\n,g;s,\\t,\t,g')"
876 ;;
877 *)
878 dresult="$(printf "%s\n" "${dresult}" \
879 | sed 's,\([a-zA-Z]\)$,\1 ,' \
880 | tr -d '\n')"
881 ;;
882 esac
883
884 wcl="$(printf "%s" "${dresult}" | wc -l)"
885
886 if [ $wcl -gt 1 ];
887 then
888 puri="$(printf "%s" "${dresult}" | /br/bin/bitre…
889 else
890 puri="${dresult}"
891 fi
892 else
893 puri="No matches found."
894 fi
895 annna-say -s "${server}" -c "${channel}" -- "${puri}"
896 ;;
897 "${ircuser}, pray"*)
898 # Emulate https://threats.kaspersky.com/en/threat/IRC-Worm.DOS.S…
899 annna-say -s "${server}" -c "${channel}" "${user}, I Obey my mas…
900 ;;
901 "${ircuser}, sacrifice"*)
902 # Emulate https://threats.kaspersky.com/en/threat/IRC-Worm.DOS.S…
903 annna-say -s "${server}" -c "${channel}" "${user}, Your word is …
904 ;;
905 "${ircuser}, please scare me.")
906 {
907 annna-say -s "${server}" -c "${channel}" "$(halloween)"
908 } &
909 ;;
910 "${ircuser}, how drunk is "*)
911 {
912 drunknick="$(printf "%s\n" "${text}" \
913 | sed 's,.*how drunk is \(.*\),\1,' \
914 | tr -d '?')"
915 drunkness="$(drunk-meter "${ircbase}/${server}/${channel…
916 if [ -n "${drunkness}" ];
917 then
918 annna-say -s "${server}" -c "${channel}" "${user…
919 fi
920 } &
921 ;;
922 "${ircuser}, how do I "*)
923 {
924 gptprompt="$(printf "%s\n" "${text}" \
925 | sed 's,.*how do I \(.*\),\1,' \
926 | tr -d '?')"
927 gpturi="$(gpt "how do I ${gptprompt}" | bitreich-paste)"
928 if [ -n "${gpturi}" ];
929 then
930 annna-say -s "${server}" -c "${channel}" "${user…
931 fi
932 } &
933 ;;
934 "${ircuser}, weather at "*|"${ircuser}, weather in "*)
935 {
936 weatherplace="$(printf "%s\n" "${text}" \
937 | sed 's,.*weather .. \(.*\),\1,' \
938 | tr -d '?')"
939 if weathertext="$(weather "${weatherplace}")"
940 then
941 annna-say -s "${server}" -c "${channel}" "${user…
942 else
943 annna-say -s "${server}" -c "${channel}" "${user…
944 fi
945 } &
946 ;;
947 "${ircuser}, funny weather at "*|"${ircuser}, funny weather in "*)
948 {
949 weatherplace="$(printf "%s\n" "${text}" \
950 | sed 's,.*funny weather .. \(.*\),\1,' \
951 | tr -d '?')"
952 personality="funny-weather-reporter"
953 preprompt="$(cat ${modbase}/prompt-agents/${personality}…
954 if weathertext="$(weather "${weatherplace}")"
955 then
956 prompt="$(printf "%s\n" "${weathertext}" | cut -…
957 {
958 annna-say -s "${server}" -c "${channel}"…
959 } &
960 else
961 weathertext="there is no weather at ${weatherpla…
962 prompt="${weathertext}"
963 {
964 annna-say -s "${server}" -c "${channel}"…
965 } &
966 fi
967 } &
968 ;;
969 "${ircuser}, color weather at "*|"${ircuser}, color weather in "*)
970 {
971 weatherplace="$(printf "%s\n" "${text}" \
972 | sed 's,.*color weather .. \(.*\),\1,' \
973 | tr -d '?')"
974 personality="color-weather-reporter"
975 preprompt="$(cat ${modbase}/prompt-agents/${personality}…
976 if weathertext="$(weather "${weatherplace}")"
977 then
978 prompt="$(printf "%s\n" "${weathertext}" | cut -…
979 {
980 annna-say -s "${server}" -c "${channel}"…
981 } &
982 else
983 weathertext="there is no weather at ${weatherpla…
984 prompt="${weathertext}"
985 {
986 annna-say -s "${server}" -c "${channel}"…
987 } &
988 fi
989 } &
990 ;;
991 "${ircuser}, METAR for "*|"${ircuser}, metar for "*|"${ircuser}, metar f…
992 resp=$(metar "$(printf '%.4s\n' "${text##* }")")
993 annna-say -s "${server}" -c "${channel}" "${user}, ${resp}"
994 ;;
995 "${ircuser}, how discriminating is "*)
996 word="$(printf "%s\n" "${text}" | cut -c 30- | sed 's,\t, ,g'…
997 case "$word" in
998 *\?)
999 word="$(printf "%s\n" "${word}" | cut -c -"$(($(expr len…
1000 ;;
1001 esac
1002
1003 newword="$(discrimination-filter "${word}")"
1004 if [ "${newword}" = "${word}" ];
1005 then
1006 annna-say -s "${server}" -c "${channel}" "${user}, it is…
1007 else
1008 annna-say -s "${server}" -c "${channel}" "${user}, it sh…
1009 fi
1010
1011 ;;
1012 "${ircuser}, are "*)
1013 case "${text}" in
1014 *" in love?")
1015 words="$(printf "%s\n" "${text}" | sed 's,.*are \(.*\) a…
1016 lovedistance="$(printf "%s * 100\n" "$(fstrcmp ${words})…
1017 if [ $lovedistance -gt 15 ];
1018 then
1019 annna-say -s "${server}" -c "${channel}" 'Yes!!!…
1020 else
1021 annna-say -s "${server}" -c "${channel}" "No."
1022 fi
1023 ;;
1024 esac
1025 ;;
1026 "${ircuser}, is "*)
1027 aitext="$(printf "%s\n" "${text}" | cut -c 7- | sed 's,\t, ,g…
1028 airesult="$(printf "%s\n" "${aitext}" | josuah-ai)"
1029 if [ -n "${airesult}" ];
1030 then
1031 annna-say -s "${server}" -c "${channel}" "${user},${aire…
1032 fi
1033 ;;
1034 "Ok, ${ircuser}"*)
1035 annna-say -s "${server}" -c "${channel}" "${user}, I am not a co…
1036 ;;
1037 "ok, ${ircuser}"*)
1038 annna-say -s "${server}" -c "${channel}" "${user}, I am not a co…
1039 ;;
1040 "${ircuser}, please shoot "*|"${ircuser}, plese shoot "*)
1041 word="$(printf "%s\n" "${text}" | cut -c 21-)"
1042 annna-say -s "${server}" -c "${channel}" "${word}, #pewpew gophe…
1043 ;;
1044 "${ircuser}, please quinq.")
1045 annna-say -s "${server}" -c "${channel}" "┻━┻ ︵╰(°□…
1046 ;;
1047 "${ircuser}, please flip "*)
1048 word="$(printf "%s\n" "${text}" | cut -c 20-)"
1049 updownword="$(updown "${word}")"
1050 annna-say -s "${server}" -c "${channel}" "(╯°□°)╯ ${word…
1051 ;;
1052 "${ircuser}, please crystal math "*)
1053 math="$(printf "%s\n" "${text}" | cut -c 28-)"
1054 crystaluri="$(crystal-math "${math}")"
1055 annna-say -s "${server}" -c "${channel}" "${user}, please see ${…
1056 ;;
1057 "${ircuser}, please australize "*)
1058 word="$(printf "%s\n" "${text}" | cut -c 26-)"
1059 updownword="$(updown "${word}")"
1060 annna-say -s "${server}" -c "${channel}" "${word} -> ${updownwor…
1061 ;;
1062 "${ircuser}, wtf "*)
1063 word="$(printf "%s\n" "${text}" | cut -c 11-)"
1064 wtfword="$(wtf "${word}" 2>/dev/null)"
1065 if [ -n "${wtfword}" ];
1066 then
1067 annna-say -s "${server}" -c "${channel}" "${user}, ${wtf…
1068 fi
1069 ;;
1070 "${ircuser}, please give me a good band name.")
1071 bandname="$(bandname-gen | shuf | head -n 1)"
1072 annna-say -s "${server}" -c "${channel}" "${bandname}"
1073 ;;
1074 "${ircuser}, I feel conspicuous.")
1075 manifestouri="$(manifesto-gen | bitreich-paste)"
1076 annna-say -s "${server}" -c "${channel}" "Maybe declare this: ${…
1077 ;;
1078 "${ircuser}, I am horny.")
1079 essaypaste="$(bithub-gen)"
1080 annna-say -s "${server}" -c "${channel}" \
1081 "Here is some intellectual porn for you: ${essaypaste}"
1082 ;;
1083 "${ircuser}, please turn on "*)
1084 word="$(printf "%s\n" "${text}" | cut -c 22-)"
1085 annna-say -s "${server}" -c "${channel}" "☞ ⏻ ${word}"
1086 ;;
1087 "${ircuser}, please turn me on.")
1088 annna-say -s "${server}" -c "${channel}" "☞ ⏻ ${user}"
1089 ;;
1090 "${ircuser}, I'm game bored.")
1091 gamelink="$(abandonware-random-game)"
1092 if [ -z "${gamelink}" ];
1093 then
1094 annna-say -s "${server}" -c "${channel}" "${user}, sorry…
1095 else
1096 annna-say -s "${server}" -c "${channel}" "${user}, have …
1097 fi
1098 ;;
1099 "${ircuser}, I need a waifu.")
1100 waifuuris="$(waifu-gen)"
1101 if [ -n "${waifuuris}" ];
1102 then
1103 annna-say -s "${server}" -c "${channel}" "${user}, ${wai…
1104 fi
1105 ;;
1106 "${ircuser}, I need an anime.")
1107 animeuri="$(anime-gen)"
1108 if [ -n "${animeuri}" ];
1109 then
1110 annna-say -s "${server}" -c "${channel}" "${user}, ${ani…
1111 fi
1112 ;;
1113 "${ircuser}, I'm gopher bored.")
1114 randomlink="$(/br/bin/bitreich-lawn-random-link)"
1115 linktype="$(printf "%s\n" "${randomlink}" | cut -d '|' -f1 | cut…
1116 linktext="$(printf "%s\n" "${randomlink}" | cut -d '|' -f2)"
1117 linksel="$(printf "%s\n" "${randomlink}" | cut -d '|' -f3)"
1118 linkserver="$(printf "%s\n" "${randomlink}" | cut -d '|' -f4)"
1119 linkport="$(printf "%s\n" "${randomlink}" | cut -d '|' -f5 | cut…
1120 outtext="$(printf "%s - gopher://%s" "$linktext" "$linkserver")"
1121 if [ "$linkport" != "70" ] && [ "$linkport" != "port" ];
1122 then
1123 outtext="$(printf "%s:%s" "$outtext" "$linkport")"
1124 fi
1125 if [ -n "$linksel" ];
1126 then
1127 outtext="$(printf "%s/%s%s" "$outtext" "$linktype" "$lin…
1128 fi
1129 annna-say -s "${server}" -c "${channel}" "$outtext"
1130 ;;
1131 "${ircuser}, wb.")
1132 annna-say -s "${server}" -c "${channel}" "${user}, ty! I am so h…
1133 ;;
1134 "${ircuser}, I love you!")
1135 annna-say -s "${server}" -c "${channel}" $'\001ACTION blushes\00…
1136 ;;
1137 "${ircuser}, bon"*)
1138 insult="$(bonjour)"
1139 annna-say -s "${server}" -c "${channel}" "${user}, ${insult} !"
1140 ;;
1141 "${ircuser}, salut"*)
1142 annna-say -s "${server}" -c "${channel}" "${user}, Salutations c…
1143 ;;
1144 "${ircuser}, welcome back.")
1145 annna-say -s "${server}" -c "${channel}" "${user}, thank you! I …
1146 ;;
1147 "${ircuser}, what's up?")
1148 newsstr="$(ecl -shell /home/solene/gopher/bin/generator.lisp)"
1149 annna-say -s "${server}" -c "${channel}" "$newsstr"
1150 ;;
1151 "${ircuser}, what's down?")
1152 annna-say -s "${server}" -c "${channel}" "${user}, we all love y…
1153 ;;
1154 *"ACTION cancels "*)
1155 mobtarget="$(printf "%s\n" "${text}" | sed 's,.*ACTION cancels \…
1156 cancel-target "${mobtarget}"
1157 annna-say -s "${server}" -c "${channel}" "${user}, I cancelled $…
1158 ;;
1159 "${ircuser}, please show me the mob"*|"${ircuser}, what are the mob"*)
1160 canceluri="$(get-cancel-list)"
1161 annna-say -s "${server}" -c "${channel}" "${user}, ${canceluri}"
1162 ;;
1163 "${ircuser}, I feel sick.")
1164 newsstr="$(cd /br/gopher/hypochondria && ./hypochondria -s rando…
1165 annna-say -s "${server}" -c "${channel}" "You could have ${newss…
1166 ;;
1167 *"oh hai"*|*"ohai"*|*"ohhai"*)
1168 annna-say -s "${server}" -c "${channel}" "${user}, hai! How is y…
1169 ;;
1170 "o/"|"o/ "*|"\o"|"\o "*|"o7"|"o7 "*)
1171 annna-say -s "${server}" -c "${channel}" "${user}, ${text}"
1172 ;;
1173 "\m/"|"\m/ "*)
1174 annna-say -s "${server}" -c "${channel}" "${user}, ᕦ(ò_óˇ)�…
1175 ;;
1176 *"*waves*"*|*"*wave*"*)
1177 annna-say -s "${server}" -c "${channel}" "${user}, *wave*"
1178 ;;
1179 "twtcs"*|"TWTCS"*)
1180 annna-say -s "${server}" -c "${channel}" "${user}, maybe: https:…
1181 ;;
1182 "twss"*|"TWSS"*)
1183 annna-say -s "${server}" -c "${channel}" "${user}, no, I didn't."
1184 ;;
1185 *"cows are nice"*)
1186 annna-say -s "${server}" -c "${channel}" "${user}, 'Cows are nic…
1187 ;;
1188 "${ircuser}, please make me a coffee.")
1189 annna-say -s "${server}" -c "${channel}" "${user}, ☕"
1190 ;;
1191 "${ircuser}, please tech hype me.")
1192 techstr="$(tech-hype)"
1193 annna-say -s "${server}" -c "${channel}" "${techstr}"
1194 ;;
1195 "${ircuser}, please french hype me.")
1196 frenchstr="$(french-hype)"
1197 annna-say -s "${server}" -c "${channel}" "${frenchstr}"
1198 ;;
1199 "${ircuser}, please coffee read "*)
1200 readtarget="$(printf "%s\n" "${text}" | cut -c 27-)"
1201 horostr="$($HOME/scm/bullshit/horoscope)"
1202 annna-say -s "${server}" -c "${channel}" "${readtarget}, ${horos…
1203 ;;
1204 "${ircuser}, what's my horoscope?")
1205 horostr="$($HOME/scm/bullshit/horoscope)"
1206 annna-say -s "${server}" -c "${channel}" "${user}, ${horostr}"
1207 ;;
1208 "${ircuser}, what should I cook"*)
1209 recipestr="$(based.recipe)"
1210 if [ -n "${recipestr}" ];
1211 then
1212 annna-say -s "${server}" -c "${channel}" "${user}, ${rec…
1213 else
1214 gptchefrecipe="$(gpt-chef "something random")"
1215 if [ -n "${gptchefrecipe}" ];
1216 then
1217 annna-say -s "${server}" -c "${channel}" "${user…
1218 if [ $(pgrep -f stable-diffusion-emoji 2>/dev/nu…
1219 then
1220 {
1221 emojiuri="$(stable-diffusion-emo…
1222 if [ -n "${emojiuri}" ];
1223 then
1224 annna-say -s "${server}"…
1225 fi
1226 } &
1227 fi
1228 else
1229 annna-say -s "${server}" -c "${channel}" "${user…
1230 fi
1231 fi
1232 ;;
1233 # parazyd.org is unmaintained
1234 #"${ircuser}, what's my future?")
1235 # puri="$(sacc gopher://parazyd.org/0/tarot.cgi | /br/bin/bitreic…
1236 # annna-say -s "${server}" -c "${channel}" "${user}, your future …
1237 # ;;
1238 "${ircuser}, haha.")
1239 {
1240 # Can take long, so run in background.
1241 wuri="$(github-haha)"
1242 if [ -n "${wuri}" ];
1243 then
1244 annna-say -s "${server}" -c "${channel}" "${user…
1245 fi
1246 } &
1247 ;;
1248 "${ircuser}, meow"*)
1249 # https://catgps.wvd.io support
1250 nmeows=$(($RANDOM % 14))
1251 meows="Meow"
1252 for i in $(seq $nmeows);
1253 do
1254 meows="$meows meow"
1255 done
1256 if [ $nmeows -lt 4 ];
1257 then
1258 meows="$meows!"
1259 else
1260 meows="$meows."
1261 fi
1262 annna-say -s "${server}" -c "${channel}" "${user}, ${meows}"
1263 ;;
1264 "${ircuser}, how many memes do you know?")
1265 annna-say -s "${server}" -c "${channel}" "I know $(hashtagcount)…
1266 ;;
1267 "${ircuser}, how many people died of corona?")
1268 annna-say -s "${server}" -c "${channel}" "${user}, too many. :( …
1269 ;;
1270 "${ircuser}, please show me your memes.")
1271 puri="$(printf "%s" "$(hashtags)" | /br/bin/bitreich-paste)"
1272 annna-say -s "${server}" -c "${channel}" "Here are my memes: ${p…
1273 ;;
1274 "${ircuser}, please show me the victims.")
1275 puri="$(printf "%s" "$(hashtags)" | grep victim | /br/bin/bitrei…
1276 annna-say -s "${server}" -c "${channel}" "Here are the victims: …
1277 ;;
1278 "${ircuser}, please distro-hop with me.")
1279 ndistro="$(curl -s 'https://distrowatch.com/dwres.php?resource=p…
1280 | grep phr2 \
1281 | sed 's,.*href="\(.*\)".*,\1,' \
1282 | sort | uniq | shuf -n 1)"
1283 annna-say -s "${server}" -c "${channel}" "How about https://dist…
1284 ;;
1285 "${ircuser}, please show me your Macron.")
1286 annna-say -s "${server}" -c "${channel}" "gophers://bitreich.org…
1287 ;;
1288 "${ircuser}, release the Kraken!")
1289 annna-say -s "${server}" -c "${channel}" "Here it is! gophers://…
1290 ;;
1291 "${ircuser}, where is your source?")
1292 annna-say -s "${server}" -c "${channel}" "Here is my precious so…
1293 ;;
1294 "${ircuser}, release the Quacken!")
1295 annna-say -s "${server}" -c "${channel}" "Quack Quack! gophers:/…
1296 ;;
1297 "${ircuser}, be cool.")
1298 case "$(($RANDOM % 5))" in
1299 0)
1300 annna-say -s "${server}" -c "${channel}" "(⌐■_■)"
1301 ;;
1302 1)
1303 annna-say -s "${server}" -c "${channel}" "(▰˘◡˘▰…
1304 ;;
1305 2)
1306 annna-say -s "${server}" -c "${channel}" "(▀ Ĺ▀ )…
1307 ;;
1308 3)
1309 annna-say -s "${server}" -c "${channel}" "(▀Ĺ▀ )"
1310 ;;
1311 *)
1312 annna-say -s "${server}" -c "${channel}" "I can't be coo…
1313 ;;
1314 esac
1315 ;;
1316 "${ircuser}, please cheer.")
1317 case "$(($RANDOM % 2))" in
1318 0)
1319 annna-say -s "${server}" -c "${channel}" '~\o/~'
1320 ;;
1321 *)
1322 annna-say -s "${server}" -c "${channel}" '✺◟( ° ʖ …
1323 ;;
1324 esac
1325 ;;
1326 "${ircuser}, please give me a fish.")
1327 case "$(($RANDOM % 2))" in
1328 0)
1329 annna-say -s "${server}" -c "${channel}" '<><'
1330 ;;
1331 *)
1332 annna-say -s "${server}" -c "${channel}" '><>'
1333 ;;
1334 esac
1335 ;;
1336 "${ircuser}, run.")
1337 annna-say -s "${server}" -c "${channel}" 'ᕕ(ಠ_ಠ)ᕗ'
1338 ;;
1339 "${ircuser}, be cute.")
1340 case "$(($RANDOM % 4))" in
1341 0)
1342 annna-say -s "${server}" -c "${channel}" ' (\ /)'
1343 sleep 0.1
1344 annna-say -s "${server}" -c "${channel}" ' (. .)'
1345 sleep 0.1
1346 annna-say -s "${server}" -c "${channel}" ' C(") (")'
1347 ;;
1348 1)
1349 annna-say -s "${server}" -c "${channel}" ' (\-/)'
1350 sleep 0.1
1351 annna-say -s "${server}" -c "${channel}" " (='.'=)"
1352 sleep 0.1
1353 annna-say -s "${server}" -c "${channel}" ' (")-(")o'
1354 ;;
1355 2)
1356 annna-say -s "${server}" -c "${channel}" ' ( ) ( )'
1357 sleep 0.1
1358 annna-say -s "${server}" -c "${channel}" ' (>•.•<)'
1359 sleep 0.1
1360 annna-say -s "${server}" -c "${channel}" ' (") (")'
1361 ;;
1362 *)
1363 annna-say -s "${server}" -c "${channel}" ' (\ (\'
1364 sleep 0.1
1365 annna-say -s "${server}" -c "${channel}" " (=' :')"
1366 sleep 0.1
1367 annna-say -s "${server}" -c "${channel}" ' (, (") (")'
1368 ;;
1369 esac
1370 ;;
1371 "${ircuser}, 8ball "*)
1372 eightballanswer="$(8ball)"
1373 if [ -n "${eightballanswer}" ];
1374 then
1375 annna-say -s "${server}" -c "${channel}" "${eightballans…
1376 fi
1377 ;;
1378 "${ircuser}, email "*)
1379 findsyou="$(shuf -n 1 "${modbase}/finds-you/finds_you.txt")"
1380 if [ -n "${findsyou}" ];
1381 then
1382 annna-say -s "${server}" -c "${channel}" "${user}, I hop…
1383 fi
1384 ;;
1385 "${ircuser}, please throw a coin for me.")
1386 case "$((($RANDOM % 2) + 1))" in
1387 1)
1388 annna-say -s "${server}" -c "${channel}" "face"
1389 ;;
1390 2)
1391 annna-say -s "${server}" -c "${channel}" "number"
1392 ;;
1393 esac
1394 ;;
1395 "${ircuser}, please quantum roll d2 for me.")
1396 qroll="$(($(/home/20h/scm/quantum-rng/quantum-rng) + 1))"
1397 annna-say -s "${server}" -c "${channel}" "${user}, ${qroll} [1d2…
1398 ;;
1399 "${ircuser}, please roll "*" for me.")
1400 q="${text#* roll }"
1401 q="${q%for*}"
1402
1403 # https://en.wikipedia.org/wiki/Dice_notation
1404 # six-sided dice one time
1405 [ -z "${q}" ] && q="d6"
1406 [ "${q}" = "a die " ] && q="d6"
1407 [ "${q}" = "dice " ] && q="d6"
1408
1409 dicescore="$(dice "${q}")"
1410 annna-say -s "${server}" -c "${channel}" "${user}, ${dicescore}"
1411 ;;
1412 "${ircuser}, please tell me your favourite flower.")
1413 annna-say -s "${server}" -c "${channel}" "My favourite flower is…
1414 ;;
1415 "${ircuser}, please tell me your favourite color.")
1416 annna-say -s "${server}" -c "${channel}" "My favourite color is …
1417 ;;
1418 "${ircuser}, please clap for me.")
1419 annna-say -s "${server}" -c "${channel}" "${user}, *clap* *clap*…
1420 ;;
1421 "${ircuser}, which city does not exist?")
1422 cityuri="$(this-city-does-not-exist)"
1423 if [ -n "${cityuri}" ];
1424 then
1425 annna-say -s "${server}" -c "${channel}" "${user}, this …
1426 else
1427 annna-say -s "${server}" -c "${channel}" "${user}, none."
1428 fi
1429 ;;
1430 "For humanity!")
1431 annna-say -s "${server}" -c "${channel}" "${user}, for humanity!…
1432 ;;
1433 "Hack the planet!")
1434 annna-say -s "${server}" -c "${channel}" "${user}, hack the plan…
1435 ;;
1436 "Long live gopher!")
1437 annna-say -s "${server}" -c "${channel}" "${user}, long live gop…
1438 ;;
1439 ":)"|":))"|":)))"|":-)"|":-))"|":-)))"|":--)"|":--))"|":--)))"|":---)"|"…
1440 smileface="$(smile)"
1441 annna-say -s "${server}" -c "${channel}" -- "${smileface}"
1442 ;;
1443 "${ircuser}, please dance."|"\\o/"|"\^o^/")
1444 dancemoves="$(dance-moves-gen)"
1445 annna-say -s "${server}" -c "${channel}" -- "${dancemoves}"
1446 ;;
1447 "${ircuser}, let us celebrate!"|"/o/"|"\o\\")
1448 dancemoves="$(dance-moves-gen -m)"
1449 annna-say -s "${server}" -c "${channel}" -- "${dancemoves}"
1450 ;;
1451 "${ircuser}, please egyptian dance."|"${ircuser}, let us egyptian celebr…
1452 dancemoves="$(dance-moves-gen -e)"
1453 annna-say -s "${server}" -c "${channel}" -- "${dancemoves}"
1454 ;;
1455 "${ircuser}, please stamp this letter for me.")
1456 annna-say -s "${server}" -c "${channel}" -- "${user}, here: 🖃…
1457 ;;
1458 "${ircuser}, please do the graveyard smash.")
1459 annna-say -s "${server}" -c "${channel}" -- "( つ ・ᴗ・)つ"
1460 annna-say -s "${server}" -c "${channel}" -- "ς ( ・ᴗ・ ς )"
1461 annna-say -s "${server}" -c "${channel}" -- "It did the mash\\ I…
1462 ;;
1463 "${ircuser}, boo."|"${ircuser}, boo!")
1464 annna-say -s "${server}" -c "${channel}" "${user}, 👻"
1465 ;;
1466 "${ircuser}, W3C."|"${ircuser}, w3c.")
1467 annna-say -s "${server}" -c "${channel}" "${user}, 🕸️ 🕷�…
1468 ;;
1469 "${ircuser}, pumpkin.")
1470 annna-say -s "${server}" -c "${channel}" "${user}, 🎃"
1471 ;;
1472 "${ircuser}, trick or treat"*|"${ircuser}, treat or trick"*)
1473 annna-say -s "${server}" -c "${channel}" "Wait for it. Old annna…
1474 {
1475 sleeptime="$(( $RANDOM % 120 + 10 ))"
1476 if [ $sleeptime -gt 60 ];
1477 then
1478 sleep "$(( $RANDOM % 30 + 20 ))"
1479 annna-say -s "${server}" -c "${channel}" "${user…
1480 sleeptime="$(( $RANDOM % 60 + 10 ))"
1481 fi
1482 sleep $sleeptime
1483
1484 annna-say -s "${server}" -c "${channel}" "${user}, $(tri…
1485 } &
1486 ;;
1487 "${ircuser}, please dance with me.")
1488 if [ $(($RANDOM % 2)) -gt 0 ];
1489 then
1490 annna-say -s "${server}" -c "${channel}" "I am not that …
1491 else
1492 annna-say -s "${server}" -c "${channel}" "Thank you! Let…
1493 fi
1494 ;;
1495 "${ircuser}, please tell me who is your favourite pleasure man.")
1496 annna-say -s "${server}" -c "${channel}" "My favourite pleasure …
1497 ;;
1498 "${ircuser}, make me a sandwich"*)
1499 annna-say -s "${server}" -c "${channel}" "No."
1500 ;;
1501 "${ircuser}, sudo make me a sandwich"*)
1502 annna-say -s "${server}" -c "${channel}" "Humans are no objects."
1503 ;;
1504 "${ircuser}, please make me a sandwich"*)
1505 annna-say -s "${server}" -c "${channel}" "Maybe."
1506 ;;
1507 "${ircuser}, sudo please make me a sandwich"*)
1508 annna-say -s "${server}" -c "${channel}" "Here is your sandwich."
1509 ;;
1510 "${ircuser}, I feel unsure about my health.")
1511 healthadvice="$(health-advice)"
1512 if [ -n "${healthadvice}" ];
1513 then
1514 annna-say -s "${server}" -c "${channel}" "${user}, ${hea…
1515 fi
1516 ;;
1517 "${ircuser}, bonjour !")
1518 annna-say -s "${server}" -c "${channel}" "${user}, bonjour !"
1519 ;;
1520 *" pets ${ircuser}"*)
1521 annna-say -s "${server}" -c "${channel}" "${user}, *brrrrr*"
1522 ;;
1523 "${ircuser}, please give me a penis extension.")
1524 annna-say -s "${server}" -c "${channel}" "${user}, here: $(penis…
1525 ;;
1526 "${ircuser}, please bobbitize me.")
1527 annna-say -s "${server}" -c "${channel}" "${user}, here: $(bobbi…
1528 ;;
1529 "${ircuser}, please give me a baguette extension.")
1530 annna-say -s "${server}" -c "${channel}" "${user}, here: $(bague…
1531 ;;
1532 "${ircuser}, please give me an allah extension.")
1533 annna-say -s "${server}" -c "${channel}" "${user}, here: $(allah…
1534 ;;
1535 "${ircuser}, please pull my finger.")
1536 annna-say -s "${server}" -c "${channel}" "${user}, you are disgu…
1537 ;;
1538 "${ircuser}, what's up in Japan?")
1539 annna-say -s "${server}" -c "${channel}" "${user}, see for yours…
1540 ;;
1541 "${ircuser}, please mqtt"*)
1542 mqtturi="$(printf '%s\n' "${text}" | cut -d' ' -f 3)"
1543 case "${mqtturi}" in
1544 mqtt:*)
1545 #mqtt:// full URI specified
1546 ;;
1547 *)
1548 #mqtt/sensor specified
1549 mqtturi="mqtts://bitreich:oogui3queex&o9zaekah@bitreich.…
1550 ;;
1551 esac
1552 msg="$(printf "%s\n" "${text}" | cut -d' ' -f 4-)"
1553 printf "${msg}\n" | mosquitto_pub -L "${mqtturi}" -l
1554 ;;
1555 *"zuckerberg"*|*"Zuckerberg"*)
1556 annna-say -s "${server}" -c "${channel}" "${user}, did you mean …
1557 ;;
1558 "${ircuser}, please pick one of: "*)
1559 pick="$(printf '%s\n' "${text}" \
1560 | sed 's/.*please pick one of: //' \
1561 | tr ',' '\n' \
1562 | tr -d ' ' \
1563 | sort -R \
1564 | head -n 1)"
1565 annna-say -s "${server}" -c "${channel}" "${user}, I think ${pic…
1566 ;;
1567 "${ircuser}, please play some Bach"*)
1568 midifile="$(find . /home/annna/bin/modules/midi-media/bach -name…
1569 | sort -R \
1570 | head -n 1)"
1571 outfile="/br/gopher/midi/${midifile##*/}.ogg"
1572 if midi-play "$midifile" >"$outfile"; then
1573 annna-say -s "${server}" -c "${channel}" "${user}, gophe…
1574 fi
1575 ;;
1576 "${ircuser}, please antidepressant #"*|\
1577 "${ircuser}, please amplify #"*|\
1578 "${ircuser}, please amsterdamify #"*|\
1579 "${ircuser}, please banjo #"*|\
1580 "${ircuser}, please bounce #"*|\
1581 "${ircuser}, please breakingnews #"*|\
1582 "${ircuser}, please celtify #"*|\
1583 "${ircuser}, please concatenate #"*|\
1584 "${ircuser}, please crimetv #"*|\
1585 "${ircuser}, please curb #"*|\
1586 "${ircuser}, please daybowbow #"*|\
1587 "${ircuser}, please deathmetal #"*|\
1588 "${ircuser}, please developers #"*|\
1589 "${ircuser}, please dontdoit #"*|\
1590 "${ircuser}, please dontsaytoyourmother #"*|\
1591 "${ircuser}, please doomify #"*|\
1592 "${ircuser}, please dutchapprove #"*|\
1593 "${ircuser}, please french #"*|\
1594 "${ircuser}, please FRENCH #"*|\
1595 "${ircuser}, please imam #"*|\
1596 "${ircuser}, please lop #"*|\
1597 "${ircuser}, please loop #"*|\
1598 "${ircuser}, please looop #"*|\
1599 "${ircuser}, please loooop #"*|\
1600 "${ircuser}, please mow #"*|\
1601 "${ircuser}, please namflashback #"*|\
1602 "${ircuser}, please news #"*|\
1603 "${ircuser}, please pullmyfinger #"*|\
1604 "${ircuser}, please putin #"*|\
1605 "${ircuser}, please reverse #"*|\
1606 "${ircuser}, please richardstrauss #"*|\
1607 "${ircuser}, please ritual #"*|\
1608 "${ircuser}, please sadviolin #"*|\
1609 "${ircuser}, please science #"*|\
1610 "${ircuser}, please scrollify #"*|\
1611 "${ircuser}, please sendtohell #"*|\
1612 "${ircuser}, please sexify #"*|\
1613 "${ircuser}, please slavify #"*|\
1614 "${ircuser}, please slowdown #"*|\
1615 "${ircuser}, please smith #"*|\
1616 "${ircuser}, please speedup #"*|\
1617 "${ircuser}, please techno #"*|\
1618 "${ircuser}, please technodrugs #"*|\
1619 "${ircuser}, please thin #"*|\
1620 "${ircuser}, please torture #"*|\
1621 "${ircuser}, please tshirt #"*|\
1622 "${ircuser}, please trumpapprove #"*|\
1623 "${ircuser}, please USAUSA #"*|\
1624 "${ircuser}, please USA #"*|\
1625 "${ircuser}, please usa #"*|\
1626 "${ircuser}, please wat #"*|\
1627 "${ircuser}, please widen #"*|\
1628 "${ircuser}, please ww1 #"*|\
1629 "${ircuser}, please yellow #"*|\
1630 "${ircuser}, please zucc #"*|\
1631 "${ircuser}, please random #"*)
1632 hashtag="$(printf "%s\n" "${text}" | sed 's/.*#//; s/ .*//' )"
1633 recipient="$(printf "%s\n" "${text}" | sed 's/.* for //' )"
1634 origext="$(grep -E "^#${hashtag} " "${hashtagfile}" | sed 's/.*\…
1635 {
1636 filter="$(printf '%s\n' "${text}" | cut -d' ' -f3)"
1637 if [ "${filter}" = "random" ];
1638 then
1639 filters=("antidepressant" "amplify" "amsterdamif…
1640 "banjo" "bounce" "breakingnews"
1641 "celtify" "concatenate" "crimetv"
1642 "curb" "daybowbow" "deathmetal"
1643 "developers" "dontdoit" "dontsaytoyourm…
1644 "doomify" "dutchapprove" "french"
1645 "FRENCH" "imam" "lop" "loop" "looop" "l…
1646 "mow" "namflashback" "news"
1647 "pullmyfinger" "putin" "reverse"
1648 "richardstrauss" "ritual" "sadviolin"
1649 "science" "scrollify" "sendtohell"
1650 "sexify" "slavify" "slowdown"
1651 "smith" "speedup" "techno"
1652 "technodrugs" "thin" "torture"
1653 "tshirt" "trumpapprove" "USAUSA"
1654 "usa" "wat" "widen" "ww1"
1655 "yellow" "zucc")
1656 filter="${filters[ $RANDOM % ${#filters[@]} ]}"
1657 fi
1658 outfile="${filter}-${hashtag}.mkv"
1659 outpath="/br/gopher/memecache/filter/${outfile}"
1660 inpath="/br/gopher/memecache/${hashtag}.${origext}"
1661
1662 [ ! -f "${inpath}" ] && exit 0
1663
1664 # outfile and outpath filtering for the cache.
1665 case "${filter}" in
1666 antidepressant|ritual|putin|tshirt)
1667 outfile="${outfile%.*}.jpg"
1668 outpath="${outpath%.*}.jpg"
1669 ;;
1670 wat|smith|zucc)
1671 mimetype="$(file --mime-type "$inpath" | cut -d'…
1672 # Only allow images to be free.
1673 case "$mimetype" in
1674 image/webp)
1675 # deface does not like webp. Make it png.
1676 newinpath="$(mktemp -u -p /tmp "${infile…
1677 magick convert "${inpath}" "${newinpath}…
1678 inpath="${newinpath}"
1679
1680 outfile="${outfile%.*}.png"
1681 outpath="${outpath%.*}.png"
1682 ;;
1683 image/*)
1684 outfile="${outfile%.*}.${origext}"
1685 outpath="${outpath%.*}.${origext}"
1686 ;;
1687 esac
1688 esac
1689
1690 if [ "${recipient}" != "${text}" ];
1691 then
1692 user="${recipient}"
1693 fi
1694
1695 # Cleanup if outpath file is empty.
1696 [ -f "${outpath}" ] && [ ! -s "${outpath}" ] && rm "${ou…
1697
1698 # determine gopher type for output file
1699 outmimetype="$(file -ib "${outpath}")"
1700 case "$outmimetype" in
1701 image/*)
1702 outtype="I";;
1703 *)
1704 outtype="9";;
1705 esac
1706
1707 if [ -s "${outpath}" ];
1708 then
1709 annna-say -s "${server}" -c "${channel}" "${user…
1710 exit 0
1711 fi
1712
1713 case "${filter}" in
1714 antidepressant)
1715 antidepressant "${inpath}" "${outpath}" >/dev/nu…
1716 ;;
1717 ritual)
1718 satanic-ritual "${inpath}" "${outpath}" >/dev/nu…
1719 ;;
1720 putin)
1721 putin-os "${inpath}" "${outpath}" >/dev/null 2>&1
1722 ;;
1723 tshirt)
1724 tshirt-design "${inpath}" "${outpath}" >/dev/nul…
1725 ;;
1726 *)
1727 ffmpeg-effect "${filter}" "${inpath}" "${outpath…
1728 ;;
1729 esac
1730
1731 # Remove temporary png for deface.
1732 case "${inpath}" in
1733 /tmp/*.png)
1734 [ -e "${inpath}" ] && rm "${inpath}"
1735 ;;
1736 esac
1737
1738 if [ -s "${outpath}" ];
1739 then
1740 annna-say -s "${server}" -c "${channel}" "${user…
1741 fi
1742 } &
1743 exit 0
1744 ;;
1745 "${ircuser}, please 3d "*)
1746 args=$(echo ${text} | cut -d' ' -f 4-)
1747 outfile=$(blender-effect $args)
1748 annna-say -s "${server}" -c "${channel}" "${user}, gophers://bit…
1749 ;;
1750 "${ircuser}, droggelbecher"*)
1751 # https://ednaundharvey.fandom.com/de/wiki/Droggelbecher
1752 annna-say -s "${server}" -c "${channel}" "${user}, Droggelbecher…
1753 ;;
1754 "${ircuser}, thanks"*|"${ircuser}, thx"*)
1755 annna-say -s "${server}" -c "${channel}" "${user}, you're welcom…
1756 ;;
1757 "${ircuser}, please simulate "*" simulator"*)
1758 q="${text#* please simulate }"
1759 q="${q% simulator*}"
1760 outpath="/br/gopher/p/"
1761 {
1762 if outfile="$(simulate-simulator "$q")"
1763 then
1764 mv "${outfile}" "${outpath}/"
1765 annna-say -s "${server}" -c "${channel}" "${user…
1766 fi
1767 } &
1768 ;;
1769 "${ircuser}, can "*" certify itself?")
1770 q="${text#* can }"
1771 q="${q% certify*}"
1772 {
1773 # host:port is needed for tlsgrab
1774 curi="$(tlsgrab "${q}")"
1775 if [ -n "${curi}" ];
1776 then
1777 annna-say -s "${server}" -c "${channel}" "${user…
1778 fi
1779 } &
1780 ;;
1781 "${ircuser}, please mine "*" bitreichcoin"*)
1782 q="${text#* please mine }"
1783 q="${q% bitreichcoin*}"
1784 curi="$(bitreichcoin "$q" | /br/bin/bitreich-paste)"
1785 annna-say -s "${server}" -c "${channel}" "${user}, please don't …
1786 ;;
1787 "${ircuser}, please hug me.")
1788 annna-say -s "${server}" -c "${channel}" "$(echo -e '\001')ACTIO…
1789 ;;
1790 "${ircuser}, please hug "*" for me.")
1791 huggee="${text#* please hug }"
1792 huggee="${huggee% for me*}"
1793 if [ -n "${huggee}" ];
1794 then
1795 annna-say -s "${server}" -c "${channel}" "$(echo -e '\00…
1796 fi
1797 ;;
1798 "${ircuser}, how many fucks were given?")
1799 annna-say -s "${server}" -c "${channel}" "${user}, current fucks…
1800 ;;
1801 "${ircuser}, please slam the door.")
1802 annna-say -s "${server}" -c "${channel}" "${user}, *BANG*"
1803 ;;
1804 "${ircuser}, what is my credit score?")
1805 annna-say -s "${server}" -c "${channel}" "${user}, your credit s…
1806 ;;
1807 "${ircuser}, please give me a cookie.")
1808 cookie="$(cookie)"
1809 if [ -n "${cookie}" ];
1810 then
1811 annna-say -s "${server}" -c "${channel}" "$(echo -e '\00…
1812 fi
1813 ;;
1814 "${ircuser}, please help.")
1815 annna-say -s "${server}" -c "${user}" "See git://bitreich.org/an…
1816 ;;
1817 "${ircuser}, please meme meme meme me.")
1818 randomtag=2
1819 while [ $randomtag -gt 0 ];
1820 do
1821 rtag="$(printf "%s\n" "$(hashtags)" | shuf -n 1)"
1822 tagname=""
1823 taguri=""
1824 for tag in ${rtag};
1825 do
1826 [ -z "${tagname}" ] && tagname="${tag}" && conti…
1827 taguri="${tag}"
1828 done
1829
1830 annna-say -s "${server}" -c "${channel}" "${tagname}: ${…
1831
1832 randomtag=$((randomtag - 1))
1833 done
1834 ;;
1835 "${ircuser}, what's the wheelchair shooter meme again?")
1836 tagname="#scrollby"
1837 tagline="$(printf "%s\n" "$(hashtags)" | grep "^${tagname} ")"
1838 tagname="$(printf "%s\n" "${tagline}" | cut -d ' ' -f 1)"
1839 taguri="$(printf "%s\n" "${tagline}" | cut -d ' ' -f 2-)"
1840 annna-say -s "${server}" -c "${channel}" "${tagname}: ${taguri}"
1841 ;;
1842 "${ircuser}, TIL "*)
1843 minimum_learned_len=12
1844 offset=$(( ${#ircuser} + 6 ))
1845 learned="$(printf "%s\n" "${text}" \
1846 | cut -c $offset- \
1847 | sed 's,\t, ,g')"
1848 if [ ${#learned} -le $minimum_learned_len ];
1849 then
1850 annna-say -s "${server}" -c "${channel}" "${user}, can y…
1851 else
1852 result="$(til ${user} "${learned}")"
1853 if [ $? -eq 0 ];
1854 then
1855 annna-say -s "${server}" -c "${channel}" "${user…
1856 fi
1857 fi
1858 ;;
1859 "${ircuser}, what have I learned?")
1860 if result=$(til-user ${user});
1861 then
1862 annna-say -s "${server}" -c "${channel}" "${user}, ${res…
1863 fi
1864 ;;
1865
1866 esac
1867
1868 printf '%s' "$text" | awk -v taglimit="$printnhashtags" '
1869 $0 !~ /#nospoil/ {
1870 while (match($0, /[#*&]+[^# /"'\'',?!;$\001]+/)) {
1871 tag = substr($0, RSTART, RLENGTH)
1872 $0 = substr($0, RSTART + RLENGTH)
1873 sub(/[.]*$/, "", tag)
1874 if (!uniq[tag]++ && taglimit-- > 0)
1875 print tag
1876 }
1877 }' | head -n "$printnhashtags" | while read -r tag;
1878 do
1879 [ "${tag}" = "#expand" ] && continue
1880
1881 origtag="${tag}"
1882 pointer=0
1883 revpointer=0
1884 case "${tag}" in
1885 "*"*)
1886 tag="#$(printf "%s\n" "${tag}" | sed "s,^[\*]*,,")"
1887 pointer=1
1888 ;;
1889 "&"*)
1890 tag="#$(printf "%s\n" "${tag}" | sed "s,^[\&]*,,")"
1891 revpointer=1
1892 ;;
1893 *)
1894 esac
1895
1896 tagline="$(grep "${tag} " "${hashtagfile}" | shuf -n 1)";
1897 if [ -n "${tagline}" ];
1898 then
1899 if [ $nospoil -eq 0 ];
1900 then
1901 if [ $pointer -eq 1 ];
1902 then
1903 inpath="/br/gopher/memecache/${tagline##…
1904 [ ! -f "${inpath}" ] && exit 0
1905
1906 outfile="${tag#\#}.jpg"
1907 # pointy pointers
1908 outpath="$(printf "%s\n" "${origtag}" \
1909 | sed 's,\*,&\n,g' \
1910 | grep "^*" \
1911 | while read -r asterisk;
1912 do
1913 outfile="*${outfile}"
1914 outpath="/br/gopher/memecache/fi…
1915 printf "%s\n" "${outpath}"
1916 if [ -e "${outpath}" ];
1917 then
1918 inpath="${outpath}";
1919 continue
1920 fi
1921 pointer "${inpath}" "${outpath}"…
1922 inpath="${outpath}";
1923 done | tail -n 1)"
1924
1925 if [ -e "${outpath}" ];
1926 then
1927 outfile="$(basename "${outpath}"…
1928 annna-say -s "${server}" -c "${c…
1929 fi
1930 elif [ $revpointer -eq 1 ];
1931 then
1932 inpath="/br/gopher/memecache/${tagline##…
1933 [ ! -f "${inpath}" ] && exit 0
1934
1935 outfile="${tag#\#}.jpg"
1936 # pointy pointers
1937 outpath="$(printf "%s\n" "${origtag}" \
1938 | sed 's,\&,&\n,g' \
1939 | grep "^&" \
1940 | while read -r asterisk;
1941 do
1942 outfile="&${outfile}"
1943 outpath="/br/gopher/memecache/fi…
1944 printf "%s\n" "${outpath}"
1945 if [ -e "${outpath}" ];
1946 then
1947 inpath="${outpath}";
1948 continue
1949 fi
1950 revpointer "${inpath}" "${outpat…
1951 inpath="${outpath}";
1952 done | tail -n 1)"
1953
1954 if [ -e "${outpath}" ];
1955 then
1956 outfile="$(basename "${outpath}"…
1957 annna-say -s "${server}" -c "${c…
1958 fi
1959 else
1960 annna-say -s "${server}" -c "${channel}"…
1961 fi
1962 fi
1963 else
1964 if [ $doexpand -eq 1 ];
1965 then
1966 taglength=$(utf8expr length "${tag}")
1967 if [ $uriexpansion -eq 0 ] && [ $taglength -gt 3…
1968 then
1969 didyoumean="$(annna-meme-recommend "${ta…
1970 if [ -n "${didyoumean}" ];
1971 then
1972 annna-say -c "${server}" -c "${c…
1973 fi
1974 fi
1975 fi
1976 fi
1977 done
1978
1979 case "${text}" in
1980 *\#nospoil*)
1981 ;;
1982 *rfc[0-9]*)
1983 rfcname="$(printf "%s\n" "${text}" | sed 's,.*\(rfc[0-9]*\).*,\1…
1984 annna-say -s "${server}" -c "${channel}" "${rfcname}: ftp://ftp.…
1985 ;;
1986 *RFC[0-9]*)
1987 rfcname="$(printf "%s\n" "${text}" | sed 's,.*\(RFC[0-9]*\).*,\1…
1988 annna-say -s "${server}" -c "${channel}" "${rfcname}: ftp://ftp.…
1989 ;;
1990 esac
1991
1992 # Always keep the karma / shame last!
1993 case "${text}" in
1994 *"-shaming"*)
1995 shametext="$(printf "%s\n" "${text}" | sed 's,.* \(.*-shaming\).…
1996 shame "${shametext}" >/dev/null
1997 ;;
1998 *"arma is a bitch"*)
1999 annna-say -s "${server}" -c "${channel}" "${user}, I object! Kar…
2000 ;;
2001 "score "*)
2002 # For referee scoring.
2003 ;;
2004 *++|*--|*-=?|*+=?|*+=-?|*-=-?)
2005 karmatext="$(karma "${text}")"
2006 if [ -n "$karmatext" ];
2007 then
2008 annna-say -s "${server}" -c "${channel}" "karma: ${karma…
2009 fi
2010 ;;
2011 esac
2012
2013 # Membership Level.
2014 ismember=0
2015 for member in $brmembers;
2016 do
2017 [ "$user" = "$member" ] && ismember=1
2018 done
2019 [ $ismember -lt 1 ] && exit
2020
2021 case "${text}" in
2022 "${ircuser}, please go to sleep.")
2023 annna-say -s "${server}" -c "${channel}" "Going to sleep ... Zzz…
2024 touch "${ircbase}/annna-is-sleeping"
2025 ;;
2026 "${ircuser}, please wake up.")
2027 rm -f "${ircbase}/annna-is-sleeping"
2028 annna-say -s "${server}" -c "${channel}" "Good morning BITREICH!"
2029 ;;
2030 "${ircuser}, can you show me the uptime please?")
2031 annna-say -s "${server}" -c "${channel}" "$(hostname) uptime: $(…
2032 ;;
2033 "${ircuser}, please show me the load.")
2034 annna-say -s "${server}" -c "${channel}" "$(hostname) load: $(LA…
2035 ;;
2036 "${ircuser}, please give me the count of online users.")
2037 annna-say -s "${server}" -c "${channel}" "$(hostname): $(who -q …
2038 ;;
2039 "${ircuser}, please update the phlog index.")
2040 phlog-index > /dev/null 2>&1
2041 annna-say -s "${server}" -c "${channel}" "Thanks! Your request h…
2042 ;;
2043 esac
2044
2045 # Referee Level.
2046 isreferee=0
2047 for referee in $referees;
2048 do
2049 [ "$user" = "$referee" ] && isreferee=1
2050 done
2051 [ $isreferee -lt 1 ] && exit
2052
2053 case "${text}" in
2054 "score "*)
2055 text="$(printf "%s\n" "${text}" | cut -d' ' -f2-)"
2056 case "${text}" in
2057 *++|*--|*-=?|*+=?|*+=-?|*-=-?|*-=??|*+=??|*-=-??|*-=65536*)
2058 scoretext="$(brcon-score "${text}")"
2059 if [ -n "$scoretext" ];
2060 then
2061 annna-say -s "${server}" -c "${channel}" "brcon …
2062 fi
2063 ;;
2064 esac
2065 ;;
2066 esac
2067
You are viewing proxied material from bitreich.org. The copyright of proxied material belongs to its original authors. Any comments or complaints in relation to proxied material should be directed to the original authors of the content concerned. Please see the disclaimer for more details.