mirror of
https://github.com/SpudGunMan/meshing-around.git
synced 2026-08-06 17:03:04 +02:00
Update mesh_bot.py
This commit is contained in:
+4
-4
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user