Only generate recipe pictures, if bitreich isn't burning - 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
---
DIR commit 8661929e353a4ab21981590b0a935dd44352f239
DIR parent 4c2af11a6666a2e715631d81000616ec676f2bc0
HTML Author: Annna Robert-Houdin <annna@bitreich.org>
Date: Sun, 6 Apr 2025 16:27:09 +0200
Only generate recipe pictures, if bitreich isn't burning
Diffstat:
M annna-message-common | 34 ++++++++++++++++++-------------
1 file changed, 20 insertions(+), 14 deletions(-)
---
DIR diff --git a/annna-message-common b/annna-message-common
@@ -743,13 +743,16 @@ case "${text}" in
if [ -n "${gptchefrecipe}" ];
then
annna-say -s "${server}" -c "${channel}" "${user}, there was no ready-made recipe, so maybe this is an idea: ${gptchefrecipe}"
- {
- emojiuri="$(stable-diffusion-emoji "${gptchefrecipe}")"
- if [ -n "${emojiuri}" ];
- then
- annna-say -s "${server}" -c "${channel}" "${emojiuri}"
- fi
- } &
+ if [ $(pgrep -f stable-diffusion-emoji 2>/dev/null | wc -l) -lt 3 ];
+ then
+ {
+ emojiuri="$(stable-diffusion-emoji "${gptchefrecipe}")"
+ if [ -n "${emojiuri}" ];
+ then
+ annna-say -s "${server}" -c "${channel}" "${emojiuri}"
+ fi
+ } &
+ fi
else
annna-say -s "${server}" -c "${channel}" "${user}, I could not find any recipes for you."
fi
@@ -1101,13 +1104,16 @@ case "${text}" in
if [ -n "${gptchefrecipe}" ];
then
annna-say -s "${server}" -c "${channel}" "${user}, ${gptchefrecipe}"
- {
- emojiuri="$(stable-diffusion-emoji "${gptchefrecipe}")"
- if [ -n "${emojiuri}" ];
- then
- annna-say -s "${server}" -c "${channel}" "${emojiuri}"
- fi
- } &
+ if [ $(pgrep -f stable-diffusion-emoji 2>/dev/null | wc -l) -lt 3 ];
+ then
+ {
+ emojiuri="$(stable-diffusion-emoji "${gptchefrecipe}")"
+ if [ -n "${emojiuri}" ];
+ then
+ annna-say -s "${server}" -c "${channel}" "${emojiuri}"
+ fi
+ } &
+ fi
else
annna-say -s "${server}" -c "${channel}" "${user}, I have no recommendation for you today."
fi