From 55472bbbc082e29a24be5471aedc2ea5a4e8c5c4 Mon Sep 17 00:00:00 2001 From: Nestpebble Date: Fri, 27 Sep 2024 03:12:40 +0100 Subject: [PATCH] try this --- mesh_bot.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/mesh_bot.py b/mesh_bot.py index 95ce04e..bc8ccbb 100755 --- a/mesh_bot.py +++ b/mesh_bot.py @@ -479,8 +479,12 @@ def handle_bbspost(message, message_from_id, deviceID): elif "@" in message and not "example:" in message: toNode = message.split("@")[1].split("#")[0] toNode = toNode.rstrip() - if "!" in toNode and toNode.strip("!").isHex(): - toNode = toNode.strip("!") + if "!" in toNode: + try: + int(toNode.strip("!"),16) + toNode = int(toNode.strip("!"),16) + except ValueError as e: + logger.debug("toNode is not hex, error: {e}") elif toNode.isalpha() or not toNode.isnumeric(): toNode = get_num_from_short_name(toNode, deviceID) if toNode == 0: