Skip to content

Commit cac021b

Browse files
committed
v2.0.1 bug fix
1 parent 7c3f913 commit cac021b

File tree

6 files changed

+24
-7
lines changed

6 files changed

+24
-7
lines changed

bot/telegram_bot.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -484,14 +484,15 @@ def log_transaction(user_data, update):
484484
# start new date if date elapsed
485485
if day_tracker < day or day == 1:
486486
msg = f"New entry for {day} {month}"
487+
prev_month = month
487488
if day == 1:
488-
month = (current_datetime - dt.timedelta(days=1)).strftime("%b")
489+
prev_month = (current_datetime - dt.timedelta(days=1)).strftime("%b")
489490
# update prev day
490491
msg = f"{msg}\nCreating sum for day {day_tracker}"
491-
gs.update_prev_day(sheet_id, month, first_row)
492+
gs.update_prev_day(sheet_id, prev_month, first_row)
492493
if day == 1:
493-
new_row = 5
494-
first_row = 6
494+
new_row = 4
495+
first_row = 5
495496
gs.update_rows(sheet_id, 1, new_row, first_row)
496497
else:
497498
new_row = gs.get_new_row(sheet_id, month)

bot/text_str.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@
5454
+ "/addincome - Add Income Entry\n"
5555
+ "/retrievetransaction - Retrieve transaction from dates\n"
5656
+ "/cancel - Cancel Conversation\n"
57+
+ "\nTo report bugs, please create a issue at https://github.com/brucewzj99/tele-tracker-v2/issues or contact me @bruceeew on Telegram"
5758
)
5859

5960
RETRIEVE_TRANSACTION_TEXT = "Please specify the date and month you wish to retrieve from in this format: DD MMM\ne.g 16 Mar\nor use /cancel to exit"

bot/updates.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@ def send_new_feature_message(new_feature_message):
1515
def update_gsheet():
1616
sheet_ids = fb.get_all_sheet_id()
1717
for sheet_id in sheet_ids:
18-
pass # gs.update_gsheet(sheet_id)
18+
pass # gs.update_gsheet(sheet_id)

push_updates.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import os
2+
from telegram import Bot
3+
import bot.updates as up
4+
5+
TOKEN = os.environ.get("BOT_TOKEN")
6+
bot = Bot(token=TOKEN)
7+
8+
# msg = "Msg here to push"
9+
# up.send_new_feature_message(msg)
10+

release_notes.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,4 +41,9 @@
4141

4242
## Version 2.0.1 - Date 1 Jun 2023
4343
### Bug Fix 🛠️
44-
- Fix month abbreviation
44+
- Fix month abbreviation
45+
- Fix updating of previous month
46+
47+
### For Developer 🧑‍💻
48+
- Added a new updates.py file to push updates to all users
49+
- To run updates, call functions in push_updates.py

test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import os
55
from bot.telegram_bot import setup_handlers
66

7-
TOKEN = os.environ.get("BOT_TOKEN")
7+
TOKEN = os.environ.get("TEST_TOKEN")
88
app = Flask(__name__)
99
updater = Updater(token=TOKEN)
1010
dispatcher = updater.dispatcher

0 commit comments

Comments
 (0)