diff --git a/telegram_bot/bot.py b/telegram_bot/bot.py index 83667ba..fabe6ec 100644 --- a/telegram_bot/bot.py +++ b/telegram_bot/bot.py @@ -468,13 +468,13 @@ def set_new_transaction(message): :rtype: none """ user_id = int(message.from_user.id) - bot.send_message(chat_id=user_id, text='Type ",,," (time of transaction will be set to now):') + bot.send_message(chat_id=user_id, text='Type ",,," (time of transaction will be set to now, negative amount is selling, positive is buying):') bot.register_next_step_handler(message, set_new_transaction_step) def set_new_transaction_step(message): user_id = int(message.from_user.id) - if not re.match(r"[A-Za-z0-9]+,[A-Za-z0-9]+,[0-9]+(.[0-9]+)?,[0-9]+(.[0-9]+)?", message.text): + if not re.match(r"[A-Za-z0-9]+,[A-Za-z0-9]+,(-)?[0-9]+(.[0-9]+)?,[0-9]+(.[0-9]+)?", message.text): bot.send_message(chat_id=user_id, text='Invalid format \n(e.g. Apple,US0378331005,53.2,120.4).\n Try again with /newtransaction.') return