Add radio status command - annna - Annna the nice friendly bot. | |
git clone git://bitreich.org/annna/ git://enlrupgkhuxnvlhsf6lc3fziv5h2hhfrinws6… | |
Log | |
Files | |
Refs | |
Tags | |
README | |
--- | |
commit f5a29deea422823be5aa3debd7fa2e00242ac4e1 | |
parent 7989504e93a4b01638563f1e2aca95162b30f7fc | |
Author: N.F. <[email protected]> | |
Date: Tue, 10 Dec 2024 17:12:28 -0600 | |
Add radio status command | |
Allow users to tell the difference between an mpd error and an idle mpd | |
server with a command. | |
Signed-off-by: Annna Robert-Houdin <[email protected]> | |
Diffstat: | |
M annna-message-radio | 8 ++++++++ | |
1 file changed, 8 insertions(+), 0 deletions(-) | |
--- | |
diff --git a/annna-message-radio b/annna-message-radio | |
@@ -47,6 +47,14 @@ case "${text}" in | |
annna-say -s "${server}" -c "${channel}" "${user}, sorry, no i… | |
fi | |
exit;; | |
+"${ircuser}, please radio status.") | |
+ mpc_status="$(/usr/bin/mpc status | grep '\[.*\]' -o | tr -d '[]')" | |
+ if [ -z "$mpc_status" ]; | |
+ then | |
+ mpc_status="gone" | |
+ fi | |
+ annna-say -s "${server}" -c "${channel}" "The radio is $mpc_status." | |
+ exit;; | |
esac | |
annna-message-common "${server}" "${channel}" "${user}" "${text}" |