Update command_handlers.py

More streamlining of menu text to make messages more reliable over large mesh
This commit is contained in:
Blergo 2024-07-03 11:47:48 +01:00 committed by GitHub
parent b685ac9506
commit a55c8d0b52
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -38,9 +38,9 @@ def handle_exit_command(sender_id, interface):
def handle_help_command(sender_id, interface, state=None): def handle_help_command(sender_id, interface, state=None):
title = "█▓▒░ Yorkshire BBS ░▒▓█\n\n" title = "█▓▒░ Yorkshire BBS ░▒▓█\n\n"
commands = [ commands = [
"[M]ail Menu", "[M]ail",
"[B]ulletin Menu", "[B]ulletin",
"[S]tats Menu", "[S]tats",
"[F]ortune", "[F]ortune",
#"[W]all of Shame", #"[W]all of Shame",
#"[C]hannel Directory", #"[C]hannel Directory",
@ -53,7 +53,7 @@ def handle_help_command(sender_id, interface, state=None):
commands = [ commands = [
"[0]Read Mail", "[0]Read Mail",
"[1]Send Mail", "[1]Send Mail",
"[2]Exit Mail Menu" "[2]Exit"
] ]
elif current_command == 'BULLETIN': elif current_command == 'BULLETIN':
commands = [ commands = [
@ -61,19 +61,19 @@ def handle_help_command(sender_id, interface, state=None):
"[1]Info Board", "[1]Info Board",
"[2]News Board", "[2]News Board",
"[3]Urgent Board", "[3]Urgent Board",
"[4]Exit Bulletin Menu" "[4]Exit"
] ]
elif current_command == 'STATS': elif current_command == 'STATS':
commands = [ commands = [
"[0]Mesh Stats", "[0]Mesh Stats",
"[1]Server Stats", "[1]Server Stats",
"[2]Exit Stats Menu" "[2]Exit"
] ]
response = title + "\n".join(commands) response = title + "\n".join(commands)
send_message(response, sender_id, interface) send_message(response, sender_id, interface)
def handle_stats_command(sender_id, interface): def handle_stats_command(sender_id, interface):
response = "📈 STATS MENU 📈\n\n[0]Mesh Stats\n[1]Server Stats\n[2]Exit Stats Menu" response = "📈 STATS MENU 📈\n\n[0]Mesh Stats\n[1]Server Stats\n[2]Exit"
send_message(response, sender_id, interface) send_message(response, sender_id, interface)
update_user_state(sender_id, {'command': 'STATS', 'step': 1}) update_user_state(sender_id, {'command': 'STATS', 'step': 1})
@ -98,7 +98,7 @@ def handle_stats_steps(sender_id, message, step, interface, bbs_nodes):
handle_help_command(sender_id, interface) handle_help_command(sender_id, interface)
return return
if choice == 0: if choice == 0:
response = "📈 MESH STATS 📈\n\n[0]Node Numbers\n[1]Hardware\n[2]Roles\n[3]Main Menu" response = "📈 MESH STATS 📈\n\n[0]Node Numbers\n[1]Hardware\n[2]Roles\n[3]Exit"
send_message(response, sender_id, interface) send_message(response, sender_id, interface)
update_user_state(sender_id, {'command': 'STATS', 'step': 2}) update_user_state(sender_id, {'command': 'STATS', 'step': 2})
if choice == 1: if choice == 1: