zeroone2numeral2 / sticker-thief

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

/readd command #46

Closed zeroone2numeral2 closed 3 years ago

zeroone2numeral2 commented 3 years ago

Add a command that allows users to add to the database sticker sets they have created through the bot (and later removed manually with /forgetme, for example).

To check whether the bot owns the pack or not:

We have to use uploadStickerFile because addStickerToSet doesn't return the sticker object on the server, so we wouldn't know which sticker to remove later

The first time an user uses the command, store the sticker file object in their user_data so we can re-use it for future requests. Also save when the object has been generated in case we want to clean old ones up with a job (to check: user_data is persisted on disk?). Stickers uploaded with uploadStickerFile are owned by a specific user, because the request requires an user_id

The bot should also support t.me/addstickers/ urls when requesting the pack name to the user

Possible usages:

zeroone2numeral2 commented 3 years ago

Related discussion and adopted solution (view thread): https://t.me/s/BotTalk/524393