mirror of
https://github.com/TheCommsChannel/TC2-BBS-mesh.git
synced 2025-08-07 14:12:19 -04:00
Add ability to add "x" to commands
This is to allow web client users to use the BBS since the web client doesn't allow you to send single characters
This commit is contained in:
parent
ddc3fbf1f1
commit
e9709fd781
3 changed files with 34 additions and 10 deletions
|
@ -214,15 +214,19 @@ class JS8CallClient:
|
|||
self.connected = False
|
||||
|
||||
|
||||
|
||||
def handle_js8call_command(sender_id, interface):
|
||||
response = "JS8Call Menu:\n[G]roup Messages\n[S]tation Messages\n[U]rgent Messages\nE[X]IT"
|
||||
send_message(response, sender_id, interface)
|
||||
update_user_state(sender_id, {'command': 'JS8CALL_MENU', 'step': 1})
|
||||
|
||||
|
||||
def handle_js8call_steps(sender_id, message, step, interface, state):
|
||||
message = message.lower().strip()
|
||||
if len(message) == 2 and message[1] == 'x':
|
||||
message = message[0]
|
||||
|
||||
if step == 1:
|
||||
choice = message.lower()
|
||||
choice = message
|
||||
if choice == 'x':
|
||||
handle_help_command(sender_id, interface, 'bbs')
|
||||
return
|
||||
|
@ -236,6 +240,8 @@ def handle_js8call_steps(sender_id, message, step, interface, state):
|
|||
send_message("Invalid option. Please choose again.", sender_id, interface)
|
||||
handle_js8call_command(sender_id, interface)
|
||||
|
||||
|
||||
|
||||
def handle_group_messages_command(sender_id, interface):
|
||||
conn = sqlite3.connect('js8call.db')
|
||||
c = conn.cursor()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue