zeroone2numeral2 / sticker-thief

Telegram bot to build custom sticker packs
https://t.me/stickersthiefbot
MIT License
68 stars 42 forks source link

Flood Control Exeeded #33

Closed Leichenengel closed 4 years ago

Leichenengel commented 4 years ago

Hello,

I just started out with this bot to reduce my sticker library by merging my favorites into a few packs. So far so good. I created one pack and reached the maximum amount of stickers pretty soon. So I created a new pack for the next batch of favs, went through the naming process and then was asked to post the first sticker of the pack. This is what the bot said, when I did:

"Error while trying to create the pack: Flood control exceeded. Retry in 8 seconds. Please try again, or /cancel"

So I canceled. Waited a few minutes and listed my packs to see, that the 2nd pack wasn't created. So I created it again but received the same error message when trying to add the first sticker. I waited a bit and tried again WITHOUT canceling. Then the Bot just kept reposting the stickers as downloadable pictures and the comment "mime type: image/PNG"

What did I do wrong?

zeroone2numeral2 commented 4 years ago

You did nothing wrong.

Waited a few minutes and listed my packs to see, that the 2nd pack wasn't created

When you create a pack, the bot will ask you for the pack title and the pack link - but the pack is actually created only when you send its first sticker (that is, the request to create a new pack is sent to Telegram when the bot receives the pack's first sticker). If Telegram raises an unknown error during the last step of the creation process (after you send the pack's first sticker), the creation fails and the pack is not created. This is exactly what happened - the bot cancels the operation because it doesn't know why Telegram refused its request (in this case, I didn't know about the existence of this error, so the bot simply warned you with the error description and canceled the operation)

I waited a bit and tried again WITHOUT canceling. Then the Bot just kept reposting the stickers as downloadable pictures and the comment "mime type: image/PNG"

After 15 minutes of inactivity, the bot exists the current conversation you were having with it. When this timeout happens, the bot should warn you with a message saying so. Did it send that message? After you exit a conversation (eg. the conversation to create a pack), you return to your "neutral" state, in which the bot will answer to every sticker by sending it back as a png file.

Back to the main issue: Telegram probably refused your request to create a pack because the bot is executing too many requests. This is probably related to how the bot fetches a sticker's emojis, because it uses a tricky way to overcome a Telegram limit by executing a couple of extra requests - and this might enrage Telegram at times. Or maybe it is globally creating too many packs. I need to investigate the issue, thanks for reporting it

In the meantime, I suggest you to wait a couple of hours and try again - or to send the first sticker as png file instead of sending it directly as sticker

zeroone2numeral2 commented 4 years ago

Reminder to myself: we should catch any exception that occurs during the fetching of a sticker's emojis using pyrogram. If it fails, use the sticker main emoji provided by the bot api.

Idea: after adding a sticker to a pack, the bot's answer should also tell the user which emojis has been used for that sticker. Just to be transparent

zeroone2numeral2 commented 4 years ago

Okay, it looks like Telegram's limits about creating packs are really tight. From today the bot will warn you when it can't create a pack because telegram told it to wait, and will tell you how much to wait

Leichenengel commented 4 years ago

Great, I will try it again as soon as I sorted out some Internet issues on my end. I will report back as soon as I encounter new issues related to this.

On Mon, Jul 20, 2020 at 12:34 PM zeroone2numeral2 notifications@github.com wrote:

Okay, it looks like Telegram's limits about creating packs are really tight. From today the bot will warn you when it can't create a pack because telegram told it to wait, and will tell you how much to wait

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/zeroone2numeral2/sticker-thief/issues/33#issuecomment-660946938, or unsubscribe https://github.com/notifications/unsubscribe-auth/AQJNCUKPIMEEDXGBOIMD453R4QMRXANCNFSM4O2VFXSQ .