From dc8b0c90ff157f45c12398b7aa5971bfa3c75502 Mon Sep 17 00:00:00 2001 From: SpudGunMan Date: Thu, 20 Jun 2024 00:33:13 -0700 Subject: [PATCH] Update mesh-bot.py --- mesh-bot.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/mesh-bot.py b/mesh-bot.py index d841526..336f80f 100644 --- a/mesh-bot.py +++ b/mesh-bot.py @@ -18,9 +18,9 @@ interface = meshtastic.serial_interface.SerialInterface() #serial interface #interface=meshtastic.tcp_interface.TCPInterface(hostname="192.168.0.1") # IP of your device #interface=meshtastic.ble_interface.BLEInterface("AA:BB:CC:DD:EE:FF") # BLE interface -trap_list = ("ping","ack","testing","pong","motd","help","sun","solar","hfcond","lheard","whereami","tide","moon") #A list of strings to trap and respond to +trap_list = ("ping","ack","testing","pong","motd","help","sun","solar","hfcond","lheard","whereami","tide","moon","wx") #A list of strings to trap and respond to welcome_message = "MeshBot, here for you like a friend who is not. Try sending: ping @foo or, help" -help_message = "Commands are: ping, ack, motd, sun, solar, hfcond, Lheard, whereami, tide, moon" +help_message = "Commands are: ping, ack, motd, sun, solar, hfcond, Lheard, whereami, tide, moon, wx" RESPOND_BY_DM_ONLY = True # Set to True to respond messages via DM only (keeps the channel clean) MOTD = "Thanks for using PongBOT! Have a good day!" # Message of the Day @@ -86,6 +86,10 @@ def auto_response(message,snr,rssi,hop,message_from_id): location = get_node_location(message_from_id) moon = get_moon(str(location[0]),str(location[1])) bot_response = moon + elif "wx" in message.lower(): + location = get_node_location(message_from_id) + weather = get_weather(str(location[0]),str(location[1])) + bot_response = weather else: bot_response = "I'm sorry, I'm afraid I can't do that."