From f6e0abd6cc89fa2de58790d0ff5c97222f24f90b Mon Sep 17 00:00:00 2001 From: "igor.tsupko" Date: Mon, 1 Oct 2018 18:49:31 +0300 Subject: [PATCH] Misc fixes - fixes #2 - fixes #3 --- bot.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/bot.py b/bot.py index 29ba9a4..c40ca1c 100644 --- a/bot.py +++ b/bot.py @@ -242,11 +242,13 @@ def got_reply_on_cron(message): markup = telebot.types.ReplyKeyboardMarkup() for balance in balances: - markup.row(telebot.types.KeyboardButton('took '+str(balance_diff)+' from '+str(balance))) + markup.row(telebot.types.KeyboardButton('took '+str(abs(balance_diff))+' from '+str(balance))) bot.reply_to(message, MESSAGES["where_did_you_get_money"], reply_markup=markup) + elif message_integer < current_balance: + bot.send_message(message.chat.id, "You have spent "+str(abs(balance_diff))+".") + _talk_about_spent_money(message, message_number=str(abs(balance_diff))) else: - bot.send_message(message.chat.id, "You have spent "+str(balance_diff)+".") - _talk_about_spent_money(message, message_number=str(balance_diff)) + bot.send_message(message.chat.id, "Nothing changed. Thanks for info!") except Exception as err: print(err)