From c86ebafa7eb4f32fd2868efe0260b112c584349e Mon Sep 17 00:00:00 2001 From: SpudGunMan Date: Thu, 20 Jun 2024 22:57:21 -0700 Subject: [PATCH] Update mesh-bot.py --- mesh-bot.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/mesh-bot.py b/mesh-bot.py index 38147ba..248a09c 100755 --- a/mesh-bot.py +++ b/mesh-bot.py @@ -269,6 +269,15 @@ def send_message(message,ch,nodeid): #Send to DM print (f"{log_timestamp()} System: Sending: {m} To: {get_name_from_number(nodeid)}") interface.sendText(text=m,channelIndex=ch,destinationId=nodeid) + else: + if nodeid == 0: + #Send to channel + print (f"{log_timestamp()} System: Sending: {message} To: Channel:{ch}") + interface.sendText(text=message,channelIndex=ch) + else: + #Send to DM + print (f"{log_timestamp()} System: Sending: {message} To: {get_name_from_number(nodeid)}") + interface.sendText(text=message,channelIndex=ch,destinationId=nodeid) def exit_handler(signum, frame): print("\nSystem: Closing Autoresponder")