From 0a2e385f41d0adf38b4a991e5635b441e4e39a73 Mon Sep 17 00:00:00 2001 From: Nestpebble Date: Mon, 16 Sep 2024 10:43:58 +0100 Subject: [PATCH] see if this works --- mesh_bot.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/mesh_bot.py b/mesh_bot.py index 0f79547..a0a35f5 100755 --- a/mesh_bot.py +++ b/mesh_bot.py @@ -82,13 +82,19 @@ def handle_ping(message, hop, snr, rssi): def handle_motd(message, message_from_id): global MOTD - if "$" in message and str(message_from_id) in str(bbs_admin_list): + if "?" in message and not "$": #basic help message + return "Message of the day, set with 'motd $ motd'" + elif "$" in message and str(message_from_id) in str(bbs_admin_list): #access control via bbs admin list motd = message.split("$")[1] MOTD = motd.rstrip() return "MOTD Set to: " + MOTD logger.debug(f"System: node changed MOTD: ", {message_from_id}) + elif "$" in message and not (bbs_admin_list): #no names in bbs admin list + motd = message.split("$")[1] + MOTD = motd.rstrip() + return "MOTD Set to: " + MOTD elif "$" in message: - return "I can't do that for you " + str(bbs_admin_list) + return "I can't do that for you" logger.debug(f"System: node tried to change MOTD: ", {message_from_id}) else: return MOTD