|
1 |
| -# [@MyPackBot](https://t.me/MyPackBot) [](https://discord.gg/KYQB9FR) |
| 1 | +# [@MyPackBot](https://t.me/MyPackBot) [](https://discord.gg/KYQB9FR) |
| 2 | + |
| 3 | +[](LICENSE) |
| 4 | +[](https://travis-ci.org/toby3d/MyPackBot) |
| 5 | +[](https://goreportcard.com/report/github.com/toby3d/MyPackBot) |
| 6 | +[](https://www.patreon.com/toby3d) |
| 7 | + |
| 8 | + |
| 9 | + |
| 10 | +## Wat? |
| 11 | +This is a Telegram-bot that collects all the stickers sent to it in one (almost) infinite pack. No more, no less. |
| 12 | + |
| 13 | +**Benefits:** |
| 14 | +- Does not require creation of a set with a unique URL and/or name; |
| 15 | +- Indeed (almost) unlimited pack size; |
| 16 | +- Keeps stickers belonging to their original sets; |
| 17 | +- Fully support the standard functionality of Telegram stickers (for example "add to favorites"); |
| 18 | +- Avaliable anywhere in Telegram by typing `@MyPackBot ` in the input field; |
| 19 | +- Supports filtering of results by emoji: `@MyPackBot 😀`; |
| 20 | +- Fast as f\*\*\*king Sonic; |
| 21 | +- Worked with uploadable WebP stickers; |
| 22 | +- Worked with blocked by rightholders sets (but this is not exact); |
| 23 | + |
| 24 | +**Disadvantages:** |
| 25 | +- Requires type `@MyPackBot ` in the input field; |
| 26 | +- Availability depends on the internet connection and bot uptime; |
| 27 | +- Supports search/filtering only for first emoji associated with sticker; |
| 28 | +- Does not support synchronization of the updated original set contents with the saved set contents in the bot. |
| 29 | + |
| 30 | +## Why? |
| 31 | +Because Telegram native tools for managing stickers are somewhat limited: |
| 32 | +- User can have only **up to 200 active stickers sets**; |
| 33 | +- In one set can be uploaded **up to 120 stickers**; |
| 34 | +- User can have only **up to 5 favorites stickers**; |
| 35 | + |
| 36 | +Having done simple mathematical calculations, we can assume that the **maximum user capacity** (when he has the maximum number of sets, each of which contains the maximum number of stickers) **is equal 24,000 stickers**. |
| 37 | + |
| 38 | +But, as usual, there are problems: |
| 39 | +- **Most of the sets are incomplete** and contain less than 120 stickers (sometimes - only 1-3 stickers on whole set); |
| 40 | +- **Some sets contains junk, duplicated and promotional stickers**; |
| 41 | +- **Sometimes user want use own stickers** by uploading WebP files, but without creating new sticker set; |
| 42 | +- Anyway, **user just want have as many stickers as he want**; |
| 43 | + |
| 44 | +To solve these problems, this bot was designed. |
| 45 | + |
| 46 | +## How? |
| 47 | +### tl;dr |
| 48 | +- Telegram API [supports stickers as results](https://core.telegram.org/bots/api#inlinequeryresultcachedsticker) in inline query; |
| 49 | +- Telegram API allows to use someone else's FileID for results; |
| 50 | +- It is not necessary to [create a new set](https://core.telegram.org/bots/api#createnewstickerset) using Telegram, since it only "references" existing files; |
| 51 | +- Bot saves only [user](https://core.telegram.org/bots/api#user) info, [sticker and name of his set](https://core.telegram.org/bots/api#sticker) in the database if user upload custom sticker or send/forward already existing; |
| 52 | +- Database architecture allows to filter keys by user ID and sort them by set name and emoji value; |
| 53 | +- When requesting inline query, bot simply create results from filtered database keys; |
| 54 | +- ??????? |
| 55 | +- PROFIT!!1 |
| 56 | + |
| 57 | +## Step-by-step |
| 58 | +I'm too lazy to write, so just check the source code for the comments. 👀 |
| 59 | + |
| 60 | +### Dependencies |
| 61 | +Bot uses the following dependencies: |
| 62 | +- Written on [Go](https://github.com/golang/go) language, because I <3 Go; |
| 63 | +- I ventured to migrate to my own [telegram](https://github.com/toby3d/telegram) package to win in convenience and productivity; |
| 64 | +- I use [dlog](https://github.com/kirillDanshin/dlog) for debugging without spamming on production server by use only one build flag; |
| 65 | +- Data of users and stickers save thanks to [BuntDB](https://github.com/tidwall/buntdb); |
| 66 | + |
| 67 | +## Support |
| 68 | +### GitHub |
| 69 | +You can [request fix/add some things](https://github.com/toby3d/MyPackBot/issues/new), [make a patch](https://github.com/toby3d/MyPackBot/compare) or help with [translation and localization](https://github.com/toby3d/MyPackBot/tree/develop/i18n) on your language. |
| 70 | + |
| 71 | +Ah, and star this repo, of course. |
| 72 | + |
| 73 | +### Patreon |
| 74 | +**I work on my own projects in my free time.** Please think about the [financial support for my independence](https://patreon.com/toby3d) so that I can devote more time to this bot and other projects. In exchange for an award! |
| 75 | + |
| 76 | +### Social |
| 77 | +Subscribe, follow my resources and feel free to maintain contact with me: https://toby3d.github.io |
0 commit comments