From bb0a22c69b650df0837d52afc1a7c5b4cc18364c Mon Sep 17 00:00:00 2001 From: SpudGunMan Date: Wed, 22 Oct 2025 18:45:45 -0700 Subject: [PATCH] Update system.py --- modules/system.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/modules/system.py b/modules/system.py index 21c8075..4b1cfb8 100644 --- a/modules/system.py +++ b/modules/system.py @@ -1872,9 +1872,12 @@ def get_mesh_leaderboard(msg, fromID, deviceID): # Most Emojis if 'emojiCounts' in meshLeaderboard and meshLeaderboard['emojiCounts']: - # Find the nodeID with the highest emoji count - nodeID, value = max(meshLeaderboard['emojiCounts'].items(), key=lambda x: x[1]) - result += f"🤪 Most Emojis: {value} {get_name_from_number(nodeID, 'short', 1)}\n" + # Only consider items where the value is an int + emoji_counts = {k: v for k, v in meshLeaderboard['emojiCounts'].items() if isinstance(v, int)} + if emoji_counts: + nodeID, value = max(emoji_counts.items(), key=lambda x: x[1]) + result += f"🤪 Most Emojis: {value} {get_name_from_number(nodeID, 'short', 1)}\n" + # Most Messages if 'nodeMessageCounts' in meshLeaderboard and meshLeaderboard['mostMessages']['nodeID'] is not None: nodeID = meshLeaderboard['mostMessages']['nodeID']