Add mqtt support to annna. - annna - Annna the nice friendly bot. | |
git clone git://bitreich.org/annna/ git://enlrupgkhuxnvlhsf6lc3fziv5h2hhfrinws6… | |
Log | |
Files | |
Refs | |
Tags | |
README | |
--- | |
commit de40edf2f15b54c8f9e7860d93a4a8df55953059 | |
parent 5cb9d9da1d1d315bb749828aaa7982880362f851 | |
Author: Annna Robert-Houdin <[email protected]> | |
Date: Thu, 8 Aug 2024 21:49:26 +0200 | |
Add mqtt support to annna. | |
Diffstat: | |
M annna-message-common | 14 ++++++++++++++ | |
1 file changed, 14 insertions(+), 0 deletions(-) | |
--- | |
diff --git a/annna-message-common b/annna-message-common | |
@@ -1086,6 +1086,20 @@ case "${text}" in | |
"${ircuser}, what's up in Japan?") | |
annna-say -s "${server}" -c "${channel}" "${user}, see for yourself: h… | |
;; | |
+"${ircuser}, please mqtt"*) | |
+ mqtturi="$(printf '%s\n' "${text}" | cut -d' ' -f 3)" | |
+ case "${mqtturi}" in | |
+ mqtt:*) | |
+ #mqtt:// full URI specified | |
+ ;; | |
+ *) | |
+ #mqtt/sensor specified | |
+ mqtturi="mqtt://bitreich:[email protected]:65431${mqt… | |
+ ;; | |
+ esac | |
+ msg="$(printf "%s\n" "${text}" | cut -d' ' -f 4-)" | |
+ printf "${msg}\n" | mosquitto_pub -L "${mqtturi}" -l | |
+ ;; | |
*"zuckerberg"*|*"Zuckerberg"*) | |
annna-say -s "${server}" -c "${channel}" "${user}, did you mean cocksu… | |
;; |