Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions bot/firestore_service.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
from datetime import datetime
from bot.firestore_config import db


# New user setup
def new_user_setup(telegram_id, sheet_id):
def new_user_setup(telegram_id, sheet_id, telegram_username):
user_ref = db.collection("users").document(str(telegram_id))
user_ref.set({"sheet_id": sheet_id})
user_ref.set({
"sheet_id": sheet_id,
"datetime_created": datetime.now(),
"username": telegram_username
})


# Check if user exists
Expand Down
3 changes: 2 additions & 1 deletion bot/telegram_bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,14 +63,15 @@ def start(update, context):

def set_up(update, context) -> int:
telegram_id = update.effective_user.id
telegram_username = update.effective_user.username
url = update.message.text

pattern = r"/d/([a-zA-Z0-9-_]+)"
match = re.search(pattern, url)
if match:
sheet_id = match.group(1)
try:
db.new_user_setup(telegram_id, sheet_id)
db.new_user_setup(telegram_id, sheet_id, telegram_username)
current_datetime = dt.datetime.now(timezone)
day = current_datetime.day
month = current_datetime.strftime("%b")
Expand Down
3 changes: 2 additions & 1 deletion bot/text_str.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@
+ "/getdaytransaction - Retrieve transaction from dates\n"
+ "/getoverall - Retrieve overall transaction for a month\n"
+ "/cancel - Cancel Conversation\n"
+ "\nTo report bugs, please create a issue at https://github.com/brucewzj99/tele-tracker-v2/issues or contact me @bruceeew on Telegram"
+ "\nTo report bugs or request any features, please create a issue at https://github.com/brucewzj99/tele-tracker-v2/issues\n"
+ "\nYou can support me by buying me a coffee at https://ko-fi.com/brucewzj"
)

GET_TRANSACTION_TEXT = "Please specify the date and month you wish to retrieve from in this format: DD MMM\ne.g 16 Mar\n\nUse 'tdy' to retrieve the transacation for today \nor use /cancel to exit"
Expand Down
5 changes: 5 additions & 0 deletions release_notes.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
# Release Notes
## Version 2.3.3 - Date 1 May 2024
### Minor Fix 🛠️
- Add datetime and username for logging purposes
- Add more message to help command

## Version 2.3.2 - Date 27 Mar 2024
### Bug Fix 🛠️
- Fix backlog new date entry bug
Expand Down