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:
check whether the pack name is consistent: *_by_botusername
try to add the sticker to the pack with the given name
remove the sticker if the request was successful, otherwise tell the user the bot doesn't own the pack
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:
/readd [set name or t.me/addstickers url]
/readd: the bot should ask for the set name/url, or to send a sticker belonging to the set
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:
*_by_botusername
uploadStickerFile
We have to use
uploadStickerFile
becauseaddStickerToSet
doesn't return the sticker object on the server, so we wouldn't know which sticker to remove laterThe 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 withuploadStickerFile
are owned by a specific user, because the request requires anuser_id
The bot should also support
t.me/addstickers/
urls when requesting the pack name to the userPossible usages:
/readd [set name or t.me/addstickers url]
/readd
: the bot should ask for the set name/url, or to send a sticker belonging to the set