annna-message-wikigame - annna - Annna the nice friendly bot. HTML git clone git://bitreich.org/annna/ git://enlrupgkhuxnvlhsf6lc3fziv5h2hhfrinws65d7roiv6bfj7d652fid.onion/annna/ DIR Log DIR Files DIR Refs DIR Tags DIR README --- annna-message-wikigame (723B) --- 1 #!/bin/sh -e 2 3 cfgbase="$(pwd)" 4 ircbase="$(cat ${cfgbase}/ircbase)" 5 modbase="$(cat ${cfgbase}/modbase)" 6 7 server="$1" 8 ircuser="$(cat ${cfgbase}/${server}/ircuser)" 9 channel="$2" 10 user="$3" 11 text="$4" 12 13 [ "$user" = "${ircuser}" ] && exit 14 15 saytext="" 16 case "${text}" in 17 init|summary|hint|more|giveup) 18 saytext="$(wikipediagame "${text}")" 19 ;; 20 "init "*) 21 inittext="$(printf "%s\n" "${text}" | cut -c 5-)" 22 saytext="$(wikipediagame init "${inittext}")" 23 ;; 24 "guess "*) 25 guesstext="$(printf "%s\n" "${text}" | cut -c 6-)" 26 saytext="$(wikipediagame guess "${guesstext}")" 27 ;; 28 esac 29 30 if [ -n "${saytext}" ]; 31 then 32 annna-say -s "${server}" -c "${channel}" "${saytext}" 33 fi 34 35 annna-message-common "${server}" "${channel}" "${user}" "${text}" 36