Compare commits

..

3 commits

Author SHA1 Message Date
Ricardo Dantas 382a19996f
Merge 9ece3719c7 into 9b7c4e9aee 2025-02-14 21:45:40 +01:00
TC² 9b7c4e9aee Update command_handlers.py
Fix double posting of urgent bulletins when using Quick Command
2025-02-14 08:17:14 -05:00
TC² 7ebcd2fa23 Update command_handlers.py
Fix BBS Menu
2025-02-14 07:15:10 -05:00

View file

@ -32,7 +32,10 @@ def build_menu(items, menu_name):
if item.strip() == 'Q': if item.strip() == 'Q':
menu_str += "[Q]uick Commands\n" menu_str += "[Q]uick Commands\n"
elif item.strip() == 'B': elif item.strip() == 'B':
menu_str += "[B]BS\n" if menu_name == "📰BBS Menu📰":
menu_str += "[B]ulletins\n"
else:
menu_str += "[B]BS\n"
elif item.strip() == 'U': elif item.strip() == 'U':
menu_str += "[U]tilities\n" menu_str += "[U]tilities\n"
elif item.strip() == 'X': elif item.strip() == 'X':
@ -51,7 +54,6 @@ def build_menu(items, menu_name):
menu_str += "[W]all of Shame\n" menu_str += "[W]all of Shame\n"
return menu_str return menu_str
def handle_help_command(sender_id, interface, menu_name=None): def handle_help_command(sender_id, interface, menu_name=None):
if menu_name: if menu_name:
update_user_state(sender_id, {'command': 'MENU', 'menu': menu_name, 'step': 1}) update_user_state(sender_id, {'command': 'MENU', 'menu': menu_name, 'step': 1})
@ -522,9 +524,6 @@ def handle_post_bulletin_command(sender_id, message, interface, bbs_nodes):
unique_id = add_bulletin(board_name, sender_short_name, subject, content, bbs_nodes, interface) unique_id = add_bulletin(board_name, sender_short_name, subject, content, bbs_nodes, interface)
send_message(f"Your bulletin '{subject}' has been posted to {board_name}.", sender_id, interface) send_message(f"Your bulletin '{subject}' has been posted to {board_name}.", sender_id, interface)
if board_name.lower() == "urgent":
notification_message = f"💥NEW URGENT BULLETIN💥\nFrom: {sender_short_name}\nTitle: {subject}"
send_message(notification_message, BROADCAST_NUM, interface)
except Exception as e: except Exception as e:
logging.error(f"Error processing post bulletin command: {e}") logging.error(f"Error processing post bulletin command: {e}")