Skip to content

Commit 0236798

Browse files
committed
improve docs
1 parent bceec71 commit 0236798

File tree

2 files changed

+149
-55
lines changed

2 files changed

+149
-55
lines changed
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
2+
# Using Backends in TStickers
3+
4+
TStickers supports multiple backends for converting sticker formats. You can choose between
5+
`rlottie-python` and `pyrlottie` depending on your needs and system compatibility. Here’s a brief
6+
guide on how to use and select these backends.
7+
8+
## Available Backends
9+
10+
- **pyrlottie**: in my testing this seems to be a little faster at converting telegram stickers
11+
- **rlottie-python**: this backend has broader system compatibility, though seems to be a little
12+
slower on my machine™
13+
14+
## How to Specify a Backend
15+
16+
You can specify the backend you want to use by using the `-b` or `--backend` option in your
17+
TStickers command.
18+
19+
### Command Syntax
20+
21+
```bash
22+
tstickers -b BACKEND [other options]
23+
```
24+
25+
### Examples
26+
27+
1. **Using `rlottie-python` Backend:**
28+
29+
If you want to use the `rlottie-python` backend, run:
30+
31+
```bash
32+
tstickers -b rlottie-python -t YOUR_BOT_TOKEN -p https://t.me/addstickers/YourStickerPack
33+
```
34+
35+
This command uses the `rlottie-python` backend to process the sticker pack specified by the URL.
36+
37+
2. **Using `pyrlottie` Backend:**
38+
39+
To use the `pyrlottie` backend, execute:
40+
41+
```bash
42+
tstickers -b pyrlottie -t YOUR_BOT_TOKEN -p https://t.me/addstickers/YourStickerPack
43+
```
44+
45+
This command processes the sticker pack using the `pyrlottie` backend.
46+
47+
## Choosing the Right Backend
48+
49+
- **Performance:** Test both backends to see which one performs better for your specific needs.
50+
- **Compatibility:** If you are having trouble with the default then try `rlottie-python`.
51+
52+
Note if performance is important then you may want to explore the other options `--frameskip` and
53+
`--scale`. These will change the quality of the output image though!
Lines changed: 96 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -1,80 +1,121 @@
1+
12
<!-- omit in toc -->
2-
# Tutorial
3+
# Getting Started with TStickers
4+
5+
Welcome to the TStickers tutorial! Follow these steps to get up and running with TStickers. This
6+
guide will walk you through setting up a Telegram bot, retrieving sticker pack URLs, and using
7+
TStickers to download and convert stickers.
38

4-
See below for a step-by-step tutorial on how to use TStickers
9+
<!-- omit in toc -->
10+
## Table of Contents
511

612
- [Step 1 - Send a message to @BotFather](#step-1---send-a-message-to-botfather)
7-
- [Step 2 - Create a file called 'env'](#step-2---create-a-file-called-env)
8-
- [Step 3 - Get the URL of the telegram sticker pack(s)](#step-3---get-the-url-of-the-telegram-sticker-packs)
9-
- [Option 1 - Use a browser and search for the pack](#option-1---use-a-browser-and-search-for-the-pack)
10-
- [Option 2 - Use telegram](#option-2---use-telegram)
13+
- [Step 2 - Create a File Called 'env'](#step-2---create-a-file-called-env)
14+
- [Step 3 - Get the URL of the Telegram Sticker Pack(s)](#step-3---get-the-url-of-the-telegram-sticker-packs)
15+
- [Option 1 - Use a Browser and Search for the Pack](#option-1---use-a-browser-and-search-for-the-pack)
16+
- [Option 2 - Use Telegram](#option-2---use-telegram)
1117
- [Step 4 - Use TStickers](#step-4---use-tstickers)
1218

1319
## Step 1 - Send a message to @BotFather
1420

15-
1. You must have a telegram account to use this
16-
2. Send a message to @BotFather to get started.
17-
3. Send a message containing `/newbot`
18-
4. Send a message containing the name of the bot e.g. `/test`
19-
5. Send a message containing the username of the bot e.g. `/test_bot`
20-
6. @BotFather will send a message with the token
21+
To start using TStickers, you need to create a Telegram bot. Follow these steps to obtain your bot token:
22+
23+
1. **Create a Telegram Account:** If you don’t already have one, download the Telegram app and sign up.
24+
25+
2. **Contact @BotFather:** Open Telegram and search for the user `@BotFather`. This is the official bot for managing other bots on Telegram.
26+
27+
3. **Create a New Bot:**
28+
- Send the command `/newbot` to @BotFather.
29+
- Follow the prompts to provide a name for your bot (e.g., `TestBot`) and a username (e.g., `test_bot`).
30+
31+
4. **Receive Your Token:** @BotFather will reply with a message containing your bot’s API token. Keep this token safe, as you'll need it for the next steps.
32+
33+
<img src="assets/step1.png" alt="Step 1" width="600">
34+
35+
## Step 2 - Create a File Called 'env'
36+
37+
To store your bot token securely, you need to create a configuration file:
2138

22-
<img src="assets/step1.png" alt="Step 1" width="600">
39+
1. **Create the File:**
40+
- Create a new text file in the same directory where you'll run TStickers.
41+
- Name the file `env` or `env.txt`.
2342

24-
## Step 2 - Create a file called 'env'
43+
2. **Add Your Token:**
44+
- Open the file and paste your bot token into it.
2545

26-
Create a file called 'env' (or env.txt) and paste your token from part 1.
46+
Example `env.txt`:
47+
```txt
48+
14************
49+
```
2750

28-
e.g. `env.txt`
51+
## Step 3 - Get the URL of the Telegram Sticker Pack(s)
2952

30-
```txt
31-
14************
32-
```
53+
To use TStickers, you'll need the URL of the sticker pack(s) you want to download. You can get this URL in two ways:
3354

34-
## Step 3 - Get the URL of the telegram sticker pack(s)
55+
### Option 1 - Use a Browser and Search for the Pack
3556

36-
### Option 1 - Use a browser and search for the pack
57+
1. **Search for the Sticker Pack:**
58+
- Open your web browser and search for the sticker pack by name (e.g., `Telegram Donut The Dog`).
3759

38-
1. Use a browser and search for the pack e.g. `telegram donut the dog`
60+
<img src="assets/step3_0.png" alt="Step 3: Part 1" width="300">
3961

40-
<img src="assets/step3_0.png" alt="Step 3: Part 1" width="300">
62+
2. **Copy the URL:**
63+
- Find the sticker pack link and copy its URL. It should look something like `https://t.me/addstickers/DonutTheDog`.
4164

42-
2. Click on the link
43-
3. Copy the url: e.g. `https://t.me/addstickers/DonutTheDog`
65+
### Option 2 - Use Telegram
4466

45-
### Option 2 - Use telegram
67+
1. **Find the Sticker Pack:**
68+
- Open the Telegram app, search for the sticker pack, and open it.
4669

47-
1. Open telegram, find the desired sticker pack and share the pack (on mobile pick copy link). An example of sharing a pack is below
70+
2. **Copy the Link:**
71+
- Tap on the sticker pack’s name or menu options and select "Share" or "Copy Link" (on mobile devices). The URL will be copied to your clipboard.
4872

49-
<img src="assets/step3_1.png" alt="Step 3: Part 2" width="300">
73+
Example URL: `https://t.me/addstickers/DonutTheDog`
5074

51-
2. Click on share stickers/ link - this will copy the url: e.g. `https://t.me/addstickers/DonutTheDog`
75+
<img src="assets/step3_1.png" alt="Step 3: Part 2" width="300">
5276

5377
## Step 4 - Use TStickers
5478

55-
- Run the program `python -m tstickers`
56-
- Enter the URL of the sticker pack
57-
- Get the output in the `downloads` folder.
58-
59-
```bash
60-
$ tstickers
61-
Enter sticker_set url (leave blank to stop): https://t.me/addstickers/DonutTheDog
62-
Enter sticker_set url (leave blank to stop):
63-
INFO | ============================================================
64-
INFO | Starting to scrape "DonutTheDog" ..
65-
INFO | Time taken to scrape 31 stickers - 0.044s
66-
INFO |
67-
INFO | ------------------------------------------------------------
68-
INFO | Starting download of "donutthedog" into downloads\donutthedog
69-
INFO | Time taken to download 31 stickers - 0.157s
70-
INFO |
71-
INFO | ------------------------------------------------------------
72-
INFO | -> Cache miss for DonutTheDog!
73-
INFO | Converting stickers "DonutTheDog"...
74-
INFO | Time taken to convert 31 stickers (tgs) - 60.970s
75-
INFO |
76-
INFO | Time taken to convert 31 stickers (webp) - 0.447s
77-
INFO |
78-
INFO | Time taken to convert 62 stickers (total) - 61.434s
79-
INFO |
80-
```
79+
Now you’re ready to use TStickers to download and convert stickers from the URL you obtained:
80+
81+
1. **Install TStickers:**
82+
- Run the following command in your terminal:
83+
```bash
84+
python3 -m pip install tstickers
85+
```
86+
87+
2. **Run TStickers:**
88+
- Start the program by executing:
89+
```bash
90+
python3 -m tstickers
91+
```
92+
93+
3. **Enter the Sticker Pack URL:**
94+
- When prompted, paste the URL of the sticker pack and press Enter.
95+
96+
4. **Check the Output:**
97+
- TStickers will download and convert the stickers. The output will be saved in the `downloads` folder.
98+
99+
Example output:
100+
```bash
101+
$ tstickers
102+
Enter sticker_set url (leave blank to stop): https://t.me/addstickers/DonutTheDog
103+
Enter sticker_set url (leave blank to stop):
104+
INFO | ============================================================
105+
INFO | Starting to scrape "DonutTheDog" ..
106+
INFO | Time taken to scrape 31 stickers - 0.044s
107+
INFO |
108+
INFO | ------------------------------------------------------------
109+
INFO | Starting download of "donutthedog" into downloads\donutthedog
110+
INFO | Time taken to download 31 stickers - 0.157s
111+
INFO |
112+
INFO | ------------------------------------------------------------
113+
INFO | -> Cache miss for DonutTheDog!
114+
INFO | Converting stickers "DonutTheDog"...
115+
INFO | Time taken to convert 31 stickers (tgs) - 60.970s
116+
INFO |
117+
INFO | Time taken to convert 31 stickers (webp) - 0.447s
118+
INFO |
119+
INFO | Time taken to convert 62 stickers (total) - 61.434s
120+
INFO |
121+
```

0 commit comments

Comments
 (0)