From ab64ff14b12a78296455eb5ea027b0f750d6367e Mon Sep 17 00:00:00 2001 From: SpudGunMan Date: Mon, 12 Aug 2024 02:59:27 -0700 Subject: [PATCH] Update mesh_bot.py --- mesh_bot.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mesh_bot.py b/mesh_bot.py index e43802d..e3ba6d2 100755 --- a/mesh_bot.py +++ b/mesh_bot.py @@ -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()]()