AlexKrutoy / PixelTapBot

Made by Hidden Coding. Automatic bot for telegram PixelTap by Pixelverse bot
https://t.me/hidden_coding/55
93 stars 20 forks source link

Redundant api calls (Waiting for x seconds before continuing (required by "users.GetFullUser")) #3

Closed asyv3n closed 1 month ago

asyv3n commented 1 month ago

Issue: Waiting for 8 seconds before continuing (required by "users.GetFullUser") Every time when task loop ends. Script requesting two telegram api requests like RequestWebView and GetFullUser here: https://github.com/AlexKrutoy/PixelTapBot/blob/5bb2c9993a67522fdca7e6ac4f85e51e2d9f7582/bot/core/tapper.py#L73 and here https://github.com/AlexKrutoy/PixelTapBot/blob/5bb2c9993a67522fdca7e6ac4f85e51e2d9f7582/bot/core/tapper.py#L86

Solution: Get this data once and save it until web app sesion will be expired, and avoid call this requests every loop iteration.

asyv3n commented 1 month ago

a proof that get_me under the hood uses users.GetFullUser https://github.com/pyrogram/pyrogram/blob/efac17198b5fcaec1c2628c4bba0c288a4d617d4/pyrogram/methods/users/get_me.py#L25-L44

AlexKrutoy commented 1 month ago

fixed