This commit is contained in:
SpudGunMan
2024-07-09 02:28:37 -07:00
parent 0ff8a59dde
commit dc205412d9
3 changed files with 11 additions and 2 deletions

View File

@@ -28,6 +28,7 @@ other features
- `whereami` returns the address of location of sender if known
- `tide` returns the local tides, NOAA data source
- `wx` and `wxc` returns local weather forcast, NOAA data source (wxc is metric value)
- `wxa` and `wxalert` returns NOAA alerts. short title or expanded details
- `joke` tells a joke
### Configurations

View File

@@ -30,7 +30,7 @@ trap_list = trap_list + trap_list_solarconditions # items hfcond, solar, sun, mo
trap_list = trap_list + trap_list_bbs # items bbslist, bbspost, bbsread, bbsdelete, bbshelp
welcome_message = "MeshBot, here for you like a friend who is not. Try sending: ping @foo or, help"
help_message = "CMD?: ping, motd, sitrep, joke, sun, hfcond, solar, moon, tide, whereami, wx, wxc, bbslist, bbshelp"
help_message = "CMD?: ping, motd, sitrep, joke, sun, hfcond, solar, moon, tide, whereami, wx, wxc, wxa, bbslist, bbshelp"
MOTD = "Thanks for using PongBOT! Have a good day!" # Message of the Day
RESPOND_BY_DM_ONLY = True # Set to True to respond messages via DM only (keeps the channel clean)
@@ -99,6 +99,14 @@ 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 "wxalert" in message.lower():
location = get_node_location(message_from_id)
weatherAlert = get_wx_alert_details(str(location[0]),str(location[1]))
bot_response = weatherAlert[0]
elif "wxa" in message.lower():
location = get_node_location(message_from_id)
weatherAlert = get_wx_alerts_list(str(location[0]),str(location[1]))
bot_response = weatherAlert[0]
elif "wxc" in message.lower():
location = get_node_location(message_from_id)
weather = get_weather(str(location[0]),str(location[1]),1)

View File

@@ -209,7 +209,7 @@ def get_wx_alerts_list(lat=0, lon=0):
return "\n".join(alerts.split("\n")[:ALERT_COUNT]), alert_num
def get_wx_alert_details(lat=0, lon=0):
# get the latest details of weather alerts from NOAA :: not used yet lotsa text
# get the latest details of weather alerts from NOAA
alerts = ""
if float(lat) == 0 and float(lon) == 0:
return NO_DATA_NOGPS