kacpi2442 / am_bot

Using the toogoodtogo and foodsi APIs to notify me via a Telegram bot for open offers
39 stars 19 forks source link

Proposition of new function and problem with 403 #7

Closed swiezaczek closed 1 year ago

swiezaczek commented 1 year ago
  1. Can you add function of notifications of available bags that's outside of range, but are added to favourites?

  2. Whem I launch the app on heroku i get 403 error. I think tgtg banned heroku ips, because when I run it from local machine it works just fine. Can you suggest any other cloud server that is easy to use and free?

  3. I get this from time to time:

TGTG: API run at Wed Sep 28 18:08:46 2022 successful. Foodsi total items: 282 Traceback (most recent call last): File "C:\Users\ASUS ROG\Desktop\am_bot-mainkopia\watch_script.py", line 358, in refresh foodsi() File "C:\Users\ASUS ROG\Desktop\am_bot-mainkopia\watch_script.py", line 329, in foodsi telegram_bot_delete_message([stock['msg_id'] for stock in foodsi_in_stock if stock['id'] == item['id']][0]) File "C:\Users\ASUS ROG\Desktop\am_bot-mainkopia\watch_script.py", line 329, in telegram_bot_delete_message([stock['msg_id'] for stock in foodsi_in_stock if stock['id'] == item['id']][0]) KeyError: 'msg_id'

kacpi2442 commented 1 year ago
  1. I'm not planning to, but you can fork the project, do it yourself and send a pull request.
  2. No. I use mine on my local linux machine with residential IP, didn't even tried running it on any cloud service.
  3. I added try/catch for this in my latest commit.