node-toogoodtogo-watcher icon indicating copy to clipboard operation
node-toogoodtogo-watcher copied to clipboard

Telegram bot command to filter favorites

Open bengeois opened this issue 2 years ago • 5 comments

Try an implementation of this feature request https://github.com/marklagendijk/node-toogoodtogo-watcher/issues/60

bengeois avatar Aug 25 '21 11:08 bengeois

I have to try this when I get the time.

I would like this way better if the favorites would be stored per chat, instead of globally. This would make it possible to share the bot with family / friends that live in the same town:

  • Just add all restaurants that anyone finds interesting to your favorites.
  • All your friends / family use your Telegram bot.
  • By setting their personal filter, they only get what they are interested in.

marklagendijk avatar Sep 25 '21 17:09 marklagendijk

I have to try this when I get the time.

I would like this way better if the favorites would be stored per chat, instead of globally. This would make it possible to share the bot with family / friends that live in the same town:

  • Just add all restaurants that anyone finds interesting to your favorites.
  • All your friends / family use your Telegram bot.
  • By setting their personal filter, they only get what they are interested in.

is there any news on this feature of sharing it so that multiple users can have separate lists of favourites? And so that they can login with their own account and manage their favourites using their own account?

or a more broad approach of instanced user sessions?

personal filter? multiple accounts connected to same bot?

Molier avatar Dec 26 '23 16:12 Molier

Easiest way to achieve multi-tenancy would actually be simulating it. Because of API request limitations per IP it would not be viable sending requests for multiple accounts with one bot.

Simple approach would be making the user able to add / remove favorites by chat, for example using vendor or bag ids. The chat would subscribe to receiving notifications for the bags it added / subscribe to already existing bags. Those bags would be added to one dummy account, especially created and authenticated for the bot, and when the bot detects changes it would send notifications to each subscribed chat. Implementing this would probably have to be supported by starting to use some kind of database to store subscriptions though, for example a local sqlite.

sebastianklein96 avatar Dec 26 '23 19:12 sebastianklein96

mmh that sounds pretty doable and a good upgrade indeed, thanks for the info/suggestion. Will try this out after exam period. Having all people receive all notifications in the telegram bot chat and having to 'subscribe' via one account , is quite annoying but not that necessary a fix either.

Let me know though @marklagendijk if you ended up doing something like this already , so I don't end up doing something redundant.

Molier avatar Dec 27 '23 13:12 Molier

I haven't done anything like this. Main reason being that I don't have a real need for it.

The approach sounds fine. We don't need a database for storing the subscriptions. Just storing it in the settings file, like we're doing with the chats etc. already, is fine.

marklagendijk avatar Dec 28 '23 08:12 marklagendijk