Update mesh_bot.py

This commit is contained in:
SpudGunMan
2024-09-29 12:55:41 -07:00
parent 452b9b7c67
commit 03057b3263
+4 -4
View File
@@ -579,8 +579,7 @@ def handle_history(message, nodeid, deviceID, isDM, lheard=False):
# create the message from the buffer list
for i in range(0, len(buffer)):
msg += f"{buffer[i][0]}: {buffer[i][1]} :{buffer[i][2]} ago"
if i < len(buffer) - 1:
msg += "\n"
if i < len(buffer) - 1: msg += "\n" # add a new line if not the last line
else:
# sort the cmdHistory list by time, return the username and time into a new list which used for display
for i in range(len(cmdHistory)):
@@ -599,10 +598,11 @@ def handle_history(message, nodeid, deviceID, isDM, lheard=False):
buffer[j] = (nodeName, prettyTime)
# create the message from the buffer list
buffer.reverse() # reverse the list to show the latest first
for i in range(0, len(buffer)):
msg += f"{buffer[i][0]} seen {buffer[i][1]} ago"
if i < len(buffer) - 1:
msg += "\n"
if i < len(buffer) - 1: msg += "\n" # add a new line if not the last line
if i > 3: break # only return the last 4 nodes
return msg
def handle_whereami(message_from_id, deviceID, channel_number):