diff --git a/main.py b/main.py index d4eb1d2..9a90391 100644 --- a/main.py +++ b/main.py @@ -68,7 +68,12 @@ async def send_message(number, text): res = tn.read_until(b'whatever', timeout=4).decode() logging.debug('Response data: %s', res) - message = text + CTRL_Z + # fix sending quirks: question marks and short messages + text = text.replace('?', '\\?') + if len(text) <= 2: + message = text + '\r\n' + CTRL_Z + else: + message = text + CTRL_Z tn.write(message.encode()) res = tn.read_until(b'UserDevice> ', timeout=6).decode()