Skip to content

Commit c99ce49

Browse files
docs: make it better.
1 parent 3feccc2 commit c99ce49

File tree

2 files changed

+41
-36
lines changed

2 files changed

+41
-36
lines changed

.vscode/settings.json

+2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
"VSCord.enabled": true,
33
"cSpell.words": [
44
"DYNO",
5+
"floodwaited",
6+
"missrose",
57
"mkdirs",
68
"workdir"
79
]

README.md

+39-36
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<img src="https://socialify.git.ci/EverythingSuckz/TG-FileStreamBot/image?description=1&font=Source%20Code%20Pro&forks=1&issues=1&logo=https://telegra.ph/file/01385a9f4cf0419682b87.png&pattern=Circuit%20Board&pulls=1&stargazers=1&theme=Dark" alt="Cover Image" width="650">
66
</a>
77
<p align="center">
8-
A Telegram bot to stream files to web
8+
A Telegram bot to <b>generate direct link</b> for your Telegram files.
99
<br />
1010
<a href="https://telegram.dog/TG_FileStreamBot"><strong>Demo Bot »</strong></a>
1111
<br />
@@ -147,73 +147,76 @@ HAS_SSL=False
147147
```
148148

149149
### Mandatory Vars
150+
Before running the bot, you will need to set up the following mandatory variables:
150151

151-
`API_ID` : Goto [my.telegram.org](https://my.telegram.org) to obtain this.
152+
- `API_ID` : This is the API ID for your Telegram account, which can be obtained from my.telegram.org.
152153

153-
`API_HASH` : Goto [my.telegram.org](https://my.telegram.org) to obtain this.
154+
- `API_HASH` : This is the API hash for your Telegram account, which can also be obtained from my.telegram.org.
154155

155-
`BOT_TOKEN` : Get the bot token from [@BotFather](https://telegram.dog/BotFather)
156+
- `BOT_TOKEN` : This is the bot token for the Telegram Media Streamer Bot, which can be obtained from [@BotFather](https://telegram.dog/BotFather).
156157

157-
`BIN_CHANNEL` : Create a new channel (private/public), post something in your channel. Forward that post to [@missrose_bot](https://telegram.dog/MissRose_bot) and **reply** `/id`. Now copy paste the forwarded channel ID in this field.
158+
- `BIN_CHANNEL` : This is the channel ID for the log channel where the bot will forward media messages and store these files to make the generated direct links work. To obtain a channel ID, create a new telegram channel (public or private), post something in the channel, forward the message to [@missrose_bot](https://telegram.dog/MissRose_bot) and **reply the forwarded message** with the /id command. Copy the forwarded channel ID and paste it into the this field.
158159

159-
### For making use of Multi-Client support
160+
### Optional Vars
161+
In addition to the mandatory variables, you can also set the following optional variables:
160162

161-
> **What it does?** <br>
162-
> Shares the workload between other bots to avoid getting floodwaited and to make the server handle more requests.
163-
`MULTI_TOKEN1`: Add your first bot token here.
164163

165-
`MULTI_TOKEN2`: Add your second bot token here.
164+
- `HASH_LENGTH` : This is the custom hash length for generated URLs. The hash length must be greater than 5 and less than 64.
166165

167-
you may also add as many as bots you want. (max limit is not tested yet)
168-
`MULTI_TOKEN3`, `MULTI_TOKEN4`, etc.
169166

170-
> Don't forget to add all these bots to the `BIN_CHANNEL`
167+
- `SLEEP_THRESHOLD` : This sets the sleep threshold for flood wait exceptions that occur globally in the bot instance. Requests that raise flood wait exceptions below this threshold will be automatically invoked again after sleeping for the required amount of time. Flood wait exceptions requiring longer waiting times will be raised. The default value is 60 seconds. Better leave this field empty.
171168

172-
### Optional Vars
173169

174-
-`HASH_LENGTH` : Set custom hash length for generated urls
175-
> **NOTE**: Hash length should be greater than 5 and less than 64.
170+
- `WORKERS` : This sets the maximum number of concurrent workers for handling incoming updates. The default value is 3.
176171

177172

178-
- `SLEEP_THRESHOLD` : Set a sleep threshold for flood wait exceptions happening globally in this telegram bot instance, below which any request that raises a flood wait will be automatically invoked again after sleeping for the required amount of time. Flood wait exceptions requiring higher waiting times will be raised. Defaults to 60 seconds.
173+
- `PORT` : This sets the port that your webapp will listen to. The default value is 8080.
179174

180175

181-
- `WORKERS` : Number of maximum concurrent workers for handling incoming updates.
182-
> Defaults to `3`
176+
- `WEB_SERVER_BIND_ADDRESS` : This sets your server bind address. The default value is 0.0.0.0.
183177

178+
- `NO_PORT` : This can be either True or False. If set to True, the port will not be displayed.
179+
> **Note**
180+
> To use this setting, you must point your `PORT` to 80 for HTTP protocol or to 443 for HTTPS protocol to make the generated links work.
184181
185-
- `PORT` : The port that you want your webapp to be listened to.
186-
> Defaults to `8080`
182+
- `FQDN` : A Fully Qualified Domain Name if present. Defaults to `WEB_SERVER_BIND_ADDRESS`
187183

184+
- `HAS_SSL` : This can be either True or False. If set to True, the generated links will be in HTTPS format.
188185

189-
- `WEB_SERVER_BIND_ADDRESS` : Your server bind address.
190-
> Defaults to `0.0.0.0`
186+
- `KEEP_ALIVE`: If you want to make the server ping itself every `PING_INTERVAL` seconds to avoid sleeping. Helpful in PaaS Free tiers. Defaults to `False`
191187

192-
- `NO_PORT` : (can be either `True` or `False`) If you don't want your port to be displayed.
193-
> You should point your `PORT` to `80` (http) or `443` (https) for the links to work.
188+
- `PING_INTERVAL` : The time in ms you want the servers to be pinged each time to avoid sleeping (If you're on some PaaS). Defaults to `1200` or 20 minutes.
194189

195-
- `FQDN` : A Fully Qualified Domain Name if present.
196-
> Defaults to `WEB_SERVER_BIND_ADDRESS`
190+
- `USE_SESSION_FILE` : Use session files for client(s) rather than storing the pyrogram sqlite database in the memory
197191

198-
- `HAS_SSL` : (can be either `True` or `False`) If you want the generated links in https format.
192+
### For making use of Multi-Client support
199193

200-
- `KEEP_ALIVE`: If you want to make the server ping itself every `PING_INTERVAL` seconds to avoid sleeping. Helpful in PaaS Free tiers.
201-
> Defaults to `False`
194+
> **Note**
195+
> What it multi-client feature and what it does? <br>
196+
> This feature shares the Telegram API requests between other bots to avoid getting floodwaited (A kind of rate limiting that Telegram does in the backend to avoid flooding their servers) and to make the server handle more requests. <br>
202197
203-
- `PING_INTERVAL` : The time in ms you want the servers to be pinged each time to avoid sleeping (If you're on some PaaS).
204-
> Defaults to `1200` or 20 minutes.
198+
To enable multi-client, generate new bot tokens and add it as your environmental variables with the following key names.
199+
200+
`MULTI_TOKEN1`: Add your first bot token here.
201+
202+
`MULTI_TOKEN2`: Add your second bot token here.
203+
204+
you may also add as many as bots you want. (max limit is not tested yet)
205+
`MULTI_TOKEN3`, `MULTI_TOKEN4`, etc.
205206

206-
- `USE_SESSION_FILE` : Use session files for client(s) rather than storing the pyrogram sqlite db in the memory
207+
> **Warning**
208+
> Don't forget to add all these bots to the `BIN_CHANNEL` for the proper functioning
207209
208210
## How to use the bot
209211

210-
> :warning: **Before using the bot, don't forget to add all the bots (multi-client ones too) to the `BIN_CHANNEL` as an admin**
212+
> **Warning**
213+
> Before using the bot, don't forget to add all the bots (multi-client ones too) to the `BIN_CHANNEL` as an admin
211214
212215
`/start` : To check if the bot is alive or not.
213216

214-
To get an instant stream link, just forward any media to the bot and boom, its fast af.
217+
To get an instant stream link, just forward any media to the bot and boom, the bot instantly replies a direct link to that Telegram media message.
215218

216-
## faQ
219+
## FAQ
217220

218221
- How long the links will remain valid or is there any expiration time for the links generated by the bot?
219222
> The links will will be valid as longs as your bot is alive and you haven't deleted the log channel.

0 commit comments

Comments
 (0)