Der-Henning / tgtg

Scanner for Too Good To Go Notifications
https://github.com/Der-Henning/tgtg/wiki
GNU General Public License v3.0
410 stars 66 forks source link

how to use the function /reserve #383

Open PB91-FR opened 1 year ago

PB91-FR commented 1 year ago

Hi,

How to use the function /reserve in Telegram Bot? do you have to put the name of the bag?

Thanks a lot

Der-Henning commented 1 year ago

I created a wiki page that describes the reservation feature. https://github.com/Der-Henning/tgtg/wiki/FAQ#4-how-does-the-reservation-feature-work

PB91-FR commented 1 year ago

I don't understand. When I entrer /reserve in my Telegram Application I don't have list. image

bisselch commented 1 year ago

Then you havn't selected any favorites in your linked tgtg-Account, the script isn't running or your telegram bot isn't set up properly.

PB91-FR commented 1 year ago

image image I think the reason is not here...

PB91-FR commented 1 year ago

I found the error. I had too many favorites. I deleted some favorites and now it works. how many favorites can we have?

bisselch commented 1 year ago

I've just tested the feature with 51 favorites and had no issues...

Der-Henning commented 1 year ago

Hi @PB91-FR. I am curious. How many favorites are you observing? The Telegram API should allow up to 100 buttons in one inline keyboard. What is the use case to observe even more bags? Maybe I should implement some kind of pagination here. But is it even useful at all to use the Telegram app with so many buttons?

PB91-FR commented 1 year ago

Hello, I now observe 34 favourites. Before I observed 70 I think. I hadn't noticed that I had so many. I'm not sure that was the problem. I think it's useless to have so many. I think Telegram is not meant to be used with so many favorites. Thank you very much for your work.

floriegl commented 1 year ago

I currently observe 42, but I understand why you would want to observe a lot more. As I am living in a very densely populated city there are a lot of restaurants and shops offering TGTG in walking distance of my home and my work. Of course, I am not interested in all of them, but some have a lot of magic bags listed for different occasions (e.g. meal at 14:00, meal in reusable container at 14:00, dessert at 14:00, meal at 20:00, meal in reusable container at 20:00, dessert at 20:00). And most of the time they only offer specific ones every few days but if I like to food of a restaurant and want to know about all possibilities to get their food cheaper I have to observe all of them.

I agree that there is not much use for more than about 50 buttons I think that extended the added functionality for the bot to recognize and respond to a TGTG share from https://github.com/Der-Henning/tgtg/pull/386 could be extended to also allow the user to reserve a magic bag by sending the share link to the bot. As this would be a new workflow for the user I suggest that if a user has more than 50 (configurable using env vars and config and capped to 100 as it is the API limit) we don't respond with the button list and instead inform him that he ether needs to reduce his favorites to a max of 50 or share the item in the TGTG app with the bot and reserve it that way.

olzhang commented 1 year ago

Hi @PB91-FR. I am curious. How many favorites are you observing? The Telegram API should allow up to 100 buttons in one inline keyboard. What is the use case to observe even more bags? Maybe I should implement some kind of pagination here. But is it even useful at all to use the Telegram app with so many buttons?

Just wanna follow up on this. I think pagination is a great solution. Have you had a chance to look at this https://github.com/ksinn/python-telegram-bot-pagination/tree/master

floriegl commented 1 year ago

Hi @PB91-FR. I am curious. How many favorites are you observing? The Telegram API should allow up to 100 buttons in one inline keyboard. What is the use case to observe even more bags? Maybe I should implement some kind of pagination here. But is it even useful at all to use the Telegram app with so many buttons?

Just wanna follow up on this. I think pagination is a great solution. Have you had a chance to look at this https://github.com/ksinn/python-telegram-bot-pagination/tree/master

I took a look at this repo in the past, but I noticed it is only designed to be used with a very long text and not with a lot of buttons which is the use case we would need for this project.

olzhang commented 1 year ago

Gotcha thanks!

renergydev commented 4 months ago

Is there a way to reserve from the command line of scanner? I have written some custom python script that uses scanner.exe . Is there a helper switch to reserve?