diff --git a/bot/constants/globals.py b/bot/constants/globals.py index 56de0ae..5a741f7 100644 --- a/bot/constants/globals.py +++ b/bot/constants/globals.py @@ -30,12 +30,12 @@ # Emojis # Be aware that keys of STATUS_EMOJIS are displayed to the user STATUS_EMOJIS = { - "unknown": "ā“", - "whitelisted": "šŸ“‹", - "standby": "šŸ“†", - "ready": "āœ”ļø", - "active": "šŸ’š", - "disabled": "šŸ”“" + "Unknown": "ā“", + "Whitelisted": "šŸ“‹", + "Standby": "šŸ“†", + "Ready": "āœ”ļø", + "Active": "šŸ’š", + "Disabled": "šŸ”“" } HEALTH_EMOJIS = { diff --git a/bot/handlers/network_info_handlers.py b/bot/handlers/network_info_handlers.py index 0505a5f..367bb3f 100644 --- a/bot/handlers/network_info_handlers.py +++ b/bot/handlers/network_info_handlers.py @@ -35,7 +35,7 @@ async def show_network_stats(update, context): validators = get_node_accounts() statuses_counter = Counter(map(lambda v: v['status'], validators)) - active_validators = filter(lambda v: v['status'] == 'active', + active_validators = filter(lambda v: v['status'] == 'Active', validators) versions_counter = Counter( map(lambda v: v['version'], active_validators)) @@ -43,20 +43,20 @@ async def show_network_stats(update, context): text += "\nšŸ“” Nodes:\n" for status in statuses_counter: emoji = STATUS_EMOJIS[ - status] if status in STATUS_EMOJIS else STATUS_EMOJIS["unknown"] + status] if status in STATUS_EMOJIS else STATUS_EMOJIS["Unknown"] text += f" *{str(statuses_counter[status])}* ({status} {emoji})\n" total_nodes = len(validators) text += f" = *{str(total_nodes)}* (total)\n" - text += "\n" + STATUS_EMOJIS["active"] + " Active Bonds:\n *" + \ + text += "\n" + STATUS_EMOJIS["Active"] + " Active Bonds:\n *" + \ tor_to_rune(network['bondMetrics']['totalActiveBond']) + "* (total)\n *" + \ tor_to_rune(network['bondMetrics']['averageActiveBond']) + "* (avg)\n *" + \ tor_to_rune(network['bondMetrics']['medianActiveBond']) + "* (median)\n *" + \ tor_to_rune(network['bondMetrics']['maximumActiveBond']) + "* (max)\n *" + \ tor_to_rune(network['bondMetrics']['minimumActiveBond']) + "* (min)\n" - text += "\n" + STATUS_EMOJIS["standby"] + " Standby Bonds:\n *" + \ + text += "\n" + STATUS_EMOJIS["Standby"] + " Standby Bonds:\n *" + \ tor_to_rune(network['bondMetrics']['totalStandbyBond']) + "* (total)\n *" + \ tor_to_rune(network['bondMetrics']['averageStandbyBond']) + "* (avg)\n *" + \ tor_to_rune(network['bondMetrics']['medianStandbyBond']) + "* (median)\n *" + \ diff --git a/bot/handlers/thornodes_handlers.py b/bot/handlers/thornodes_handlers.py index baa871d..ae7cc1b 100644 --- a/bot/handlers/thornodes_handlers.py +++ b/bot/handlers/thornodes_handlers.py @@ -283,7 +283,7 @@ def get_thornode_menu_buttons(chat_data): buttons = [] for address in chat_data.get('nodes', {}).keys(): node = chat_data['nodes'][address] - status_emoji = STATUS_EMOJIS.get(node['status'], STATUS_EMOJIS["unknown"]) + status_emoji = STATUS_EMOJIS.get(node['status'], STATUS_EMOJIS["Unknown"]) truncated_address = f"...{address[-3:]}" is_catching_up = node.get('is_catching_up', None) is_healthy = None if is_catching_up is None else not is_catching_up