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:
+2
-2
@@ -48,8 +48,8 @@ def auto_response(message, snr, rssi, hop, message_from_id, channel_number, devi
|
||||
cmds.append({key,message_lower.index(key)})
|
||||
|
||||
if len(cmds) > 0:
|
||||
# sort the commands by index
|
||||
cmds.sort(key=lambda x: x[1])
|
||||
# sort the commands by index value
|
||||
cmds.sort(key=lambda x: list(x.values())[0])
|
||||
logger.debug(f"System: Bot Detected: {cmds}")
|
||||
# run the first command after sorting
|
||||
bot_response = command_handler[cmds[0].pop()]()
|
||||
|
||||
Reference in New Issue
Block a user