From 1008ec6afa268f9e7508172f3e35c18978616d2b Mon Sep 17 00:00:00 2001 From: SpudGunMan Date: Sun, 28 Sep 2025 17:36:57 -0700 Subject: [PATCH] yarp --- mesh_bot.py | 6 ++++-- pong_bot.py | 8 +++++--- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/mesh_bot.py b/mesh_bot.py index 621cdca..76aee61 100755 --- a/mesh_bot.py +++ b/mesh_bot.py @@ -301,8 +301,10 @@ def handle_echo(message, message_from_id, deviceID, isDM, channel_number): if "?" in message.lower(): return "echo command returns your message back to you. Example:echo Hello World" elif "echo " in message.lower(): - echo_msg = message.split("echo ")[1] - if echo_msg.strip() == "": + parts = message.split("echo ", 1) + if len(parts) > 1 and parts[1].strip() != "": + echo_msg = parts[1] + else: return "Please provide a message to echo back to you. Example:echo Hello World" if echoChannel and channel_number != echoChannel: echo_msg = "@" + get_name_from_number(message_from_id, 'short', deviceID) + " " + echo_msg diff --git a/pong_bot.py b/pong_bot.py index ae03c1b..6fd0ddd 100755 --- a/pong_bot.py +++ b/pong_bot.py @@ -176,11 +176,13 @@ def handle_motd(message, message_from_id, isDM): return msg def handle_echo(message, message_from_id, deviceID, isDM, channel_number): - if "?" in message.lower() and isDM: + if "?" in message.lower(): return "echo command returns your message back to you. Example:echo Hello World" elif "echo " in message.lower(): - echo_msg = message.split("echo ")[1] - if echo_msg.strip() == "": + parts = message.split("echo ", 1) + if len(parts) > 1 and parts[1].strip() != "": + echo_msg = parts[1] + else: return "Please provide a message to echo back to you. Example:echo Hello World" if echoChannel and channel_number != echoChannel: echo_msg = "@" + get_name_from_number(message_from_id, 'short', deviceID) + " " + echo_msg