Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

! symbol is not escaped in Telegram notifier #379

Closed
ihor-chaban opened this issue Jun 23, 2023 · 3 comments
Closed

! symbol is not escaped in Telegram notifier #379

ihor-chaban opened this issue Jun 23, 2023 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@ihor-chaban
Copy link

Reservation notifications don't work for Telegram because the ! symbol is not escaped in the notification body.
https://github.com/Der-Henning/tgtg/blob/main/src/notifiers/telegram.py#L110

Related logs:

2023-06-23 19:06:34 DEBUG    Entering: get_updates
2023-06-23 19:06:38 DEBUG    https://apptoogoodtogo.com:443 "POST /api/item/v8/ HTTP/1.1" 200 None
2023-06-23 19:06:38 DEBUG    new State: {'632020': 1, '906712': 0, '1025054': 0, '505771': 0, '941072': 0, '907612': 0, '944311': 0, '1025330': 0, '517480': 0, '519703': 0, '506322': 0}
2023-06-23 19:06:39 DEBUG    https://apptoogoodtogo.com:443 "POST /api/order/v7/create/632020 HTTP/1.1" 200 299
2023-06-23 19:06:39 DEBUG    Sending Telegram new Reservation
2023-06-23 19:06:39 DEBUG    Telegram message: Chatime \- Chinatown \(Panier surprise \- Soir\) is reserved for 5 minutes!
2023-06-23 19:06:39 DEBUG    Entering: send_message
2023-06-23 19:06:39 DEBUG    https://api.telegram.org:443 "POST /botXXXXXXXXXX:XXXXXXXXXX/sendMessage HTTP/1.1" 400 150
2023-06-23 19:06:39 ERROR    Telegram Error: Can't parse entities: character '!' is reserved and must be escaped with the preceding '\'. For details see https://github.com/Der-Henning/tgtg/wiki/Configuration#note-on-markdown-v2
@ihor-chaban
Copy link
Author

And also the typo here "Mafic Bag"
https://github.com/Der-Henning/tgtg/blob/main/src/notifiers/telegram.py#L76

@Der-Henning
Copy link
Owner

Thank you @ihor-chaban.
I will fix this as soon as possible.

@Der-Henning Der-Henning self-assigned this Jun 24, 2023
@Der-Henning Der-Henning added the bug Something isn't working label Jun 24, 2023
Der-Henning added a commit that referenced this issue Jun 24, 2023
@ihor-chaban
Copy link
Author

ihor-chaban commented Jun 24, 2023

@Der-Henning Thanks for fixing it so fast.

I have a question about this new reservation feature.
And I supposed the reservation means the bag would be added to your cart and you just have to purchase it.
But I see no changes in my app when the bag is reserved, just -1 bag available in a particular cafe.
And if it was the last available bag then I would see that no bags left, how do I pay for my reserved bag then?
Not sure I fully understand how the feature works.
Could you please elaborate on that?

upd. I guess I found the answer:
#377 (comment)

After your bot reserved a magic bag you're supposed to cancel the reservation via telegram and immediately switch to the toogoodtogo-App to buy the now available bag your bot had reserved for you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants