From 0b101d662e794274be28e8e2ca90b8e3a948c418 Mon Sep 17 00:00:00 2001 From: Nestpebble Date: Fri, 27 Sep 2024 02:26:55 +0100 Subject: [PATCH] trying to simplify nodeid entry... --- mesh_bot.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/mesh_bot.py b/mesh_bot.py index 9301016..d975fbb 100755 --- a/mesh_bot.py +++ b/mesh_bot.py @@ -478,8 +478,10 @@ def handle_bbspost(message, message_from_id, deviceID): return "example: bbspost $subject #message" elif "@" in message and not "example:" in message: toNode = message.split("@")[1].split("#")[0] - toNode = toNode.rstrip().strip("!") - if toNode.isalpha() or not toNode.isnumeric(): + toNode = toNode.rstrip() + if "!" in toNode and toNode.strip("!").ishex(): + toNode = toNode.strip("!") + elif toNode.isalpha() or not toNode.isnumeric(): toNode = get_num_from_short_name(toNode, deviceID) if toNode == 0: return "Node not found " + message.split("@")[1].split("#")[0]