Introduction
Introduction Statistics Contact Development Disclaimer Help
Add annna-message-wikigame. - annna - Annna the nice friendly bot.
git clone git://bitreich.org/annna/ git://enlrupgkhuxnvlhsf6lc3fziv5h2hhfrinws6…
Log
Files
Refs
Tags
README
---
commit 162814a9de74f6fae7c6a0a1688278e09f0167b7
parent 8488fcefb34a7357eb5250857d781ce5eb67a252
Author: Annna Robert-Houdin <[email protected]>
Date: Sat, 15 Apr 2023 20:42:15 +0200
Add annna-message-wikigame.
Thanks adc for noticing!
Diffstat:
A annna-message-wikigame | 36 +++++++++++++++++++++++++++++…
1 file changed, 36 insertions(+), 0 deletions(-)
---
diff --git a/annna-message-wikigame b/annna-message-wikigame
@@ -0,0 +1,36 @@
+#!/bin/sh -e
+
+cfgbase="$(pwd)"
+ircbase="$(cat ${cfgbase}/ircbase)"
+modbase="$(cat ${cfgbase}/modbase)"
+
+server="$1"
+ircuser="$(cat ${cfgbase}/${server}/ircuser)"
+channel="$2"
+user="$3"
+text="$4"
+
+[ "$user" = "${ircuser}" ] && exit
+
+saytext=""
+case "${text}" in
+init|summary|hint)
+ saytext="$(wikipediagame "${text}")"
+ ;;
+"init "*)
+ inittext="$(printf "%s\n" "${text}" | cut -c 5-)"
+ saytext="$(wikipediagame init "${inittext}")"
+ ;;
+"guess "*)
+ guesstext="$(printf "%s\n" "${text}" | cut -c 6-)"
+ saytext="$(wikipediagame guess "${guesstext}")"
+ ;;
+esac
+
+if [ -n "${saytext}" ];
+then
+ annna-say -s "${server}" -c "${channel}" "${saytext}"
+fi
+
+annna-message-common "${server}" "${channel}" "${user}" "${text}"
+
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.