From a09c3fb0d487f766bdfdea9886b83a11be0ff4fc Mon Sep 17 00:00:00 2001 From: Profitroll <47523801+profitrollgame@users.noreply.github.com> Date: Sat, 14 Jan 2023 13:25:02 +0100 Subject: [PATCH] New error message added --- bwtbot.py | 3 ++- strings.json | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/bwtbot.py b/bwtbot.py index 5737555..101ed77 100644 --- a/bwtbot.py +++ b/bwtbot.py @@ -58,7 +58,8 @@ async def balance(_: Client, msg: Message): await app.send_chat_action(chat_id=msg.chat.id, action=ChatAction.TYPING) water_left = await getWaterLeft(userGet(msg.from_user.id, "card"), msg.from_user.id, app) if water_left == "": - raise EmptyCardException("Card information is empty") + await msg.reply_text(string("error_new").format(f'https://bwtaqua.com.ua/card-topup/?id={userGet(msg.from_user.id, "card")}')) + # raise EmptyCardException("Card information is empty") elif water_left == "Failure": await msg.reply_text(string("error_occured").format(string("get_number"))) appendLog(f"User {str(msg.from_user.id)} could not get left water amount") diff --git a/strings.json b/strings.json index e0ad20b..65a85f6 100644 --- a/strings.json +++ b/strings.json @@ -6,6 +6,7 @@ "card_unlinked": "Card was unlinked from your Telegram", "card_not_linked": "You don't have any linked card.\n\nВы можете задать её с помощью команды /setcard\n\n{0}", "error_occured": "An error occurred while getting the amount of remaining water on the card.\n\nPlease make sure the linked card number is correct. If you are sure that the bot is broken, please contact @profitroll.\n\nLink your card: /setcard\n\n{0}", + "error_new": "An error occurred while getting the amount of remaining water on the card.\n\nLast a few weeks BWT seems to return empty string to balance request from our server. We assume that our server has been blacklisted.\n\nTo check your balance you can use official [BWT App](https://bwtaqua.com.ua/en/#app) or simply bookmark this page: {0}.", "card_balance": "Card's balance is {0} l. of water", "top_up": "[Click here to top up](https://bwtaqua.com.ua/card-topup/?id={0})", "cancel": "Operation cancelled", @@ -21,6 +22,7 @@ "card_unlinked": "Картку відв'язано від вашого Telegram", "card_not_linked": "У вас немає прив'язаної картки.\n\nВи можете зробити це за допомогою команди /setcard\n\n{0}", "error_occured": "При отриманні води на карточці виникла помилка.\n\nБудь ласка, упевніться що номер карти правильний. Якщо ви впевнені, що номер картки правильний та бот зламався – зв'яжіться з @profitroll.\n\nПрив'язати карту: /setcard\n\n{0}", + "error_new": "При отриманні води на карточці виникла помилка.\n\nОстанні тижні BWT повертає нашому серверу порожні строки замість балансу. Є підозри, що сервер потрапив у блеклист.\n\nДля перевірки балансу рекомендуємо користуватись офіційним [додатком BWT](https://bwtaqua.com.ua/#app) або просто додати цю сторінку у закладки: {0}.", "card_balance": "На карточці {0} л. води", "top_up": "[Натисніть для поповнення](https://bwtaqua.com.ua/card-topup/?id={0})", "cancel": "Операція відмінена",