Compare commits

...

4 commits

Author SHA1 Message Date
TC² 69d74e33dd
Merge pull request #116 from mdarty/main
Added missing Parenthisis
2025-02-17 08:21:17 -05:00
Matthew Daugherty 16660e1f49
Added missing Parenthisis 2025-02-16 17:16:04 -06: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})
@ -380,7 +382,7 @@ def handle_channel_directory_steps(sender_id, message, step, state, interface):
else: else:
send_message("No channels available in the directory.", sender_id, interface) send_message("No channels available in the directory.", sender_id, interface)
handle_channel_directory_command(sender_id, interface) handle_channel_directory_command(sender_id, interface)
elif choice.lower == 'p': elif choice.lower() == 'p':
send_message("Name your channel for the directory:", sender_id, interface) send_message("Name your channel for the directory:", sender_id, interface)
update_user_state(sender_id, {'command': 'CHANNEL_DIRECTORY', 'step': 3}) update_user_state(sender_id, {'command': 'CHANNEL_DIRECTORY', 'step': 3})
@ -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}")