From deb5ee83748921d11d934c3cbbb0917724448a12 Mon Sep 17 00:00:00 2001 From: Nestpebble <116762865+Nestpebble@users.noreply.github.com> Date: Mon, 16 Sep 2024 02:29:34 +0100 Subject: [PATCH] Update mesh_bot.py --- mesh_bot.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mesh_bot.py b/mesh_bot.py index 383cd06..32efd1c 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, message_from_id), + "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,11 +81,11 @@ 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 bbs_admin_list: + if "$" in message and str(deviceID) in bbs_admin_list: motd = message.split("$")[1] MOTD = motd.rstrip() return "MOTD Set to: " + MOTD - elif "$" in message and str(message_from_id) not in bbs_admin_list: + elif "$" in message and not str(deviceID) in bbs_admin_list: return "I can't do that for you" else: return MOTD