You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: Implement dual-mode user access control system
Add BlockFlag configuration option to control the behavior mode of the UsersID list:
- When BlockFlag is false: Users in the UsersID list are allowed to use the bot
- When BlockFlag is true: Users in the UsersID list are blocked from using the bot
Copy file name to clipboardExpand all lines: README.md
+33-31Lines changed: 33 additions & 31 deletions
Original file line number
Diff line number
Diff line change
@@ -59,8 +59,6 @@
59
59
</ol>
60
60
</details>
61
61
62
-
63
-
64
62
## How to make your own
65
63
66
64
### Deploy to Heroku
@@ -77,34 +75,37 @@ Press the below button to fast deploy to Heroku
77
75
<hr>
78
76
79
77
### Download from releases
80
-
- Head over to [releases](https://github.com/EverythingSuckz/TG-FileStreamBot/releases) tab, from the *pre release* section, download the one for your platform and architecture.
81
-
- Extract the zip file to a folder.
82
-
- Create an a file named `fsb.env` and add all the variables there (see `fsb.sample.env` file for reference).
83
-
- Give the executable file permission to execute using the command `chmod +x fsb` (Not required for windows).
84
-
- Run the bot using `./fsb run` command. ( `./fsb.exe run` for windows)
78
+
79
+
- Head over to [releases](https://github.com/EverythingSuckz/TG-FileStreamBot/releases) tab, from the _pre release_ section, download the one for your platform and architecture.
80
+
- Extract the zip file to a folder.
81
+
- Create an a file named `fsb.env` and add all the variables there (see `fsb.sample.env` file for reference).
82
+
- Give the executable file permission to execute using the command `chmod +x fsb` (Not required for windows).
83
+
- Run the bot using `./fsb run` command. ( `./fsb.exe run` for windows)
Before running the bot, you will need to set up the following mandatory variables:
184
187
185
-
-`API_ID` : This is the API ID for your Telegram account, which can be obtained from my.telegram.org.
188
+
-`API_ID` : This is the API ID for your Telegram account, which can be obtained from my.telegram.org.
186
189
187
-
-`API_HASH` : This is the API hash for your Telegram account, which can also be obtained from my.telegram.org.
190
+
-`API_HASH` : This is the API hash for your Telegram account, which can also be obtained from my.telegram.org.
188
191
189
-
-`BOT_TOKEN` : This is the bot token for the Telegram Media Streamer Bot, which can be obtained from [@BotFather](https://telegram.dog/BotFather).
192
+
-`BOT_TOKEN` : This is the bot token for the Telegram Media Streamer Bot, which can be obtained from [@BotFather](https://telegram.dog/BotFather).
190
193
191
-
-`LOG_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.
194
+
-`LOG_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.
192
195
193
196
### Optional Vars
197
+
194
198
In addition to the mandatory variables, you can also set the following optional variables:
195
199
196
-
-`PORT` : This sets the port that your webapp will listen to. The default value is 8080.
200
+
-`PORT` : This sets the port that your webapp will listen to. The default value is 8080.
197
201
198
-
-`HOST` : A Fully Qualified Domain Name if present or use your server IP. (eg. `https://example.com` or `http://14.1.154.2:8080`)
202
+
-`HOST` : A Fully Qualified Domain Name if present or use your server IP. (eg. `https://example.com` or `http://14.1.154.2:8080`)
199
203
200
-
-`HASH_LENGTH` : Custom hash length for generated URLs. The hash length must be greater than 5 and less than or equal to 32. The default value is 6.
204
+
-`HASH_LENGTH` : Custom hash length for generated URLs. The hash length must be greater than 5 and less than or equal to 32. The default value is 6.
201
205
202
-
-`USE_SESSION_FILE` : Use session files for worker client(s). This speeds up the worker bot startups. (default: `false`)
206
+
-`USE_SESSION_FILE` : Use session files for worker client(s). This speeds up the worker bot startups. (default: `false`)
203
207
204
-
-`USER_SESSION` : A pyrogram session string for a user bot. Used for auto adding the bots to `LOG_CHANNEL`. (default: `null`)
208
+
-`USER_SESSION` : A pyrogram session string for a user bot. Used for auto adding the bots to `LOG_CHANNEL`. (default: `null`)
205
209
206
-
-`ALLOWED_USERS` : A list of user IDs separated by comma (`,`). If this is set, only the users in this list will be able to use the bot. (default: `null`)
210
+
-`BLOCK_FLAG` : Used to determine whether to use whitelist or blacklist mode. If set to `true`, users specified in `USERS_ID` will be blocked from using the bot. If set to `false`, only users specified in `USERS_ID`will be allowed to use the bot. (default: `false`)
207
211
208
-
-`BLOCK_USERS` : A list of user IDs separated by comma (`,`). If this is set, users in this list will be blocked from using the bot. (default: `null`)
212
+
-`USERS_ID` : A list of user IDs separated by comma (`,`). (default: `null`)
209
213
210
214
<hr>
211
215
212
216
### Use Multiple Bots to speed up
213
217
214
-
> [!NOTE]
215
-
> **What it multi-client feature and what it does?** <br>
218
+
> [!NOTE] > **What it multi-client feature and what it does?** <br>
216
219
> This feature shares the Telegram API requests between worker bots to speed up download speed when many users are using the server and to avoid the flood limits that are set by Telegram. <br>
217
220
218
221
> [!NOTE]
219
222
> You can add up to 50 bots since 50 is the max amount of bot admins you can set in a Telegram Channel.
220
223
221
-
To enable multi-client, generate new bot tokens and add it as your `fsb.env` with the following key names.
224
+
To enable multi-client, generate new bot tokens and add it as your `fsb.env` with the following key names.
222
225
223
226
`MULTI_TOKEN1`: Add your first bot token here.
224
227
@@ -267,12 +270,11 @@ Feel free to contribute to this project if you have any further ideas
267
270
268
271
You can contact either via my [Telegram Group](https://xn--r1a.click/AlteredVoid) or you can message me on [@EverythingSuckz](https://xn--r1a.click/EverythingSuckz)
269
272
270
-
271
273
## Credits
272
274
273
-
-[@celestix](https://github.com/celestix) for [gotgproto](https://github.com/celestix/gotgproto)
274
-
-[@divyam234](https://github.com/divyam234/teldrive) for his [Teldrive](https://github.com/divyam234/teldrive) Project
275
-
-[@karu](https://github.com/krau) for adding image support
275
+
-[@celestix](https://github.com/celestix) for [gotgproto](https://github.com/celestix/gotgproto)
276
+
-[@divyam234](https://github.com/divyam234/teldrive) for his [Teldrive](https://github.com/divyam234/teldrive) Project
277
+
-[@karu](https://github.com/krau) for adding image support
0 commit comments