Introduction
Introduction Statistics Contact Development Disclaimer Help
Add random #tag selection. - annna - Annna the nice friendly bot.
git clone git://bitreich.org/annna/ git://enlrupgkhuxnvlhsf6lc3fziv5h2hhfrinws6…
Log
Files
Refs
Tags
README
---
commit b58ec95b06148f41116103745fd8dc7ba0ff9c24
parent d3bbf6476945cd43149a90c29b8ef56990e7db87
Author: Annna Robert-Houdin <[email protected]>
Date: Sun, 10 Feb 2019 17:24:25 +0100
Add random #tag selection.
Diffstat:
M annna-start-services | 66 +++++++++++++++++++++--------…
1 file changed, 46 insertions(+), 20 deletions(-)
---
diff --git a/annna-start-services b/annna-start-services
@@ -276,28 +276,54 @@ then
continue;
fi
- tagname=""
- taguri=""
- for tag in ${hashtags};
- do
- [ -z "${tagname}" ] && tagname="${tag}" && continue
- taguri="${tag}"
+ randomtag=0
+ case "${text}" in
+ *\#nospoil*)
+ ;;
+ *\#tag[^a-zA-Z]*)
+ randomtag=1
+ ;;
+ *\#tag)
+ randomtag=1
+ ;;
+ esac
- case "${text}" in
- *\#nospoil*)
- break;
- ;;
- *${tagname}[^a-zA-Z]*)
- annna-say -c "#bitreich-en" "${tagname}: ${tag…
- break;
- ;;
- *${tagname})
- annna-say -c "#bitreich-en" "${tagname}: ${tag…
- break;
- ;;
- esac
+ if [ $randomtag -eq 1 ];
+ then
+ rtag="$(printf "%s\n" "${hashtags}" | shuf -n 1)"
tagname=""
- done
+ taguri=""
+ for tag in ${rtag};
+ do
+ [ -z "${tagname}" ] && tagname="${tag}" && con…
+ taguri="${tag}"
+ done
+
+ annna-say -c "#bitreich-en" "${tagname}: ${taguri}"
+ else
+ tagname=""
+ taguri=""
+ for tag in ${hashtags};
+ do
+ [ -z "${tagname}" ] && tagname="${tag}" && con…
+ taguri="${tag}"
+
+ case "${text}" in
+ *\#nospoil*)
+ break;
+ ;;
+ *${tagname}[^a-zA-Z]*)
+ annna-say -c "#bitreich-en" "${tagname…
+ break;
+ ;;
+ *${tagname})
+ annna-say -c "#bitreich-en" "${tagname…
+ break;
+ ;;
+ esac
+ tagname=""
+ done
+ fi
ismember=0
for member in $brmembers;
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.