From 5fd326f2e8780502417c3ac6556496bd29f5545b Mon Sep 17 00:00:00 2001 From: Nestpebble <116762865+Nestpebble@users.noreply.github.com> Date: Mon, 16 Sep 2024 01:41:43 +0100 Subject: [PATCH] Update mesh_bot.py add nodeID check to MOTD change --- mesh_bot.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mesh_bot.py b/mesh_bot.py index 916aef6..3f8035f 100755 --- a/mesh_bot.py +++ b/mesh_bot.py @@ -16,7 +16,7 @@ def auto_response(message, snr, rssi, hop, message_from_id, channel_number, devi command_handler = { "ping": lambda: handle_ping(message, hop, snr, rssi), "pong": lambda: "🏓PING!!", - "motd": lambda: handle_motd(message), + "motd": lambda: handle_motd(message, deviceID), "bbshelp": bbs_help, "wxalert": lambda: handle_wxalert(message_from_id, deviceID, message), "wxa": lambda: handle_wxalert(message_from_id, deviceID, message), @@ -81,7 +81,7 @@ def handle_ping(message, hop, snr, rssi): def handle_motd(message): global MOTD - if "$" in message: + if "$" in message and str(fromNode) in bbs_admin_list: motd = message.split("$")[1] MOTD = motd.rstrip() return "MOTD Set to: " + MOTD