You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
defget_available_items_per_user(self):
whileTrue:
try:
ifany(val==1foruser_settingsinself.users_settings_data.values() forvalinuser_settings.values()):
# Führe die Abfragen nur aus, wenn mindestens eine Einstellung aktiviert isttemp_available_items= {}
forkeyinself.users_login_data.keys():
self.connect(key)
time.sleep(1)
available_items=self.get_favourite_items()
foriteminavailable_items:
status="null"item_id=item['item']['item_id']
# ... (Code davor)ifnotstatus=="null":
temp_available_items[item_id] =statusself.available_items_favorites[item_id] =itemifitem_idintemp_available_itemsand \
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)
exceptExceptionaserr:
print(f"Unexpected {err=}, {type(err)=}")```
The text was updated successfully, but these errors were encountered:
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:
The text was updated successfully, but these errors were encountered: