torbenstriegel / toogoodtogo-telegrambot Goto Github PK
View Code? Open in Web Editor NEWThe bot will notify you as soon as new bags from your favorites are available.
License: GNU General Public License v3.0
The bot will notify you as soon as new bags from your favorites are available.
License: GNU General Public License v3.0
I had another idea to reduce the API access to the tgtg server side and not to provoke the 403 error (capture).
Currently the tgtg api is queried every 60 seconds (default) regardless of the settings in Telegram (/settings).
Before you start the loop, you could query the settings whether information is desired. If no information is required, the API is not queried and tgtg does not notice the bot.
Here is an untested draft:
def get_available_items_per_user(self):
while True:
try:
if any(val == 1 for user_settings in self.users_settings_data.values() for val in user_settings.values()):
# Führe die Abfragen nur aus, wenn mindestens eine Einstellung aktiviert ist
temp_available_items = {}
for key in self.users_login_data.keys():
self.connect(key)
time.sleep(1)
available_items = self.get_favourite_items()
for item in available_items:
status = "null"
item_id = item['item']['item_id']
# ... (Code davor)
if not status == "null":
temp_available_items[item_id] = status
self.available_items_favorites[item_id] = item
if item_id in temp_available_items and \
self.users_settings_data[key][temp_available_items[item_id]] == 1:
# ... (Code davor)
self.send_message_with_link(key, text, item_id)
self.save_available_items_favorites_to_txt()
time.sleep(60)
except Exception as err:
print(f"Unexpected {err=}, {type(err)=}")```
Hello, thank you for having shared your project with the community ^^
But I'm facing an issue when trying to run the project.
I've follow all the steps of installation and setup my telegram's access token bot in the config.ini
file but an error is throw when I'm running the `python3 Telegram.py. Here is the error's detail :
telebot.apihelper.ApiTelegramException: A request to the Telegram API was unsuccessful. Error code: 404. Description: Not Found
Python3.11
pip install -r requirements.txt
config.ini
file with a telegram's bot token at the format 7XXXXXXXX6:AXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX-M
python3 Telegram.py
I installed the script on an RPi Buster.
At first it wasn't clear to me where I should enter the /start command.
You could add the reference to Telegram in the readme.
I can register my email address in TGTG via Telegram and also receive a verification email. Unfortunately it takes some time for the email from tgtg to arrive. Before the email arrives, a time of 120 seconds has expired in the script.
The script reports
"Exception ignored"
After I clicked the button in the email, TGTG wrote that I was logged in and that I should go back to the app.
With all further commands in Telegram I get the message that I should log in first
Where is the problem? Why can't I log in?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.