TELESHARE
A efficient and configurable telegram file sharing bot
DEMO: BOT LINK
- CodeXbotz links compatibility.
- Fully asynchronous.
- Highly configurable.
- In-built rate limiter.
- Multi-channel force subscription.
- Protect content.
- Quick Deployment.
- Toggleable auto file backup.
- Toggleable auto message delete.
- Type-hinted for improved code readability.
- User-friendly interface.
- Broadcast / Announcement.
- Configuration commands.
- HTTP client.
- Invite requests.
- Public mode.
- Quick deployments.
- Support common file types:
(doc,photo,vid,audio)
. - Toggle Backup.
- Help command.
- Toggle global mode.
- In-built rate limiter.
- Fully remove database models.
- Try again button.
- Auto link generator.
- add codeXbots file-sharing link compatibility.
- Tokenized access.
Use: /help [command name]
for more informations.
/make_files
: Handles a conversation that receives files to generate an accessable file link./start
: Handle start command, it returns files if a link is included otherwise sends the user a request./broadcast
: Broadcasts a message to multiple subscribed users this command may take awhile depending on user count./option
: Use to configure database options. See START-UP REQUIREMENTS bot options for more informations.
FAQS
1. How do i disable automatic deletation:/option AUTO_DELETE_SECONDS 0
.env / environ
You can use either .env or environ as a way to setup the configuration. Please see .env_example as reference.
- API_ID
- API_HASH
- BOT_TOKEN
- MONGO_DB_URL = mongodb+srv
Bot Config
BOT_WORKER (int)
: amount of bot workers, default to 8.BOT_SESSION (int)
: bot session name, reads from bot directory.BOT_MAX_MESSAGE_CACHE_SIZE (int)
: amount of message to cache, recommended to cache more than a thousand if your bot is big enough due to scheduling. default to 100.
Main config
BACKUP_CHANNEL (int)
: file backup channel.ROOT_ADMINS_ID (list[int])
: bot admins.PRIVATE_REQUEST (bool)
: enable private request on private channel/group. default toFalse
.PROTECT_CONTENT (bool)
: disalllow forwarding and saving of files sent by the bot. default toTrue
.FORCE_SUB_CHANNELS (list[int])
: force subscription channels.AUTO_GENERATE_LINK
: toggle auto link generator when file is recieve directly. default toTrue
.
Bot options
Set:
-
FORCE_SUB_MESSAGE (str|int)
: message during force subscription. -
START_MESSAGE (str|int)
: a start message -
AUTO_DELETE_MESSAGE (str|int)
: an auto delete messages, {} is the amount of minutes. -
AUTO_DELETE_SECONDS (int)
: auto deletion in minutes, is set as {} of AUTO_DELETE_MESSAGE. -
GLOBAL_MODE (bool)
: toggle everyone to generate a file link. -
BACKUP_FILES (bool)
: toggle all files to back up.
configure through /option
command or use /help option
for more information.
Usage:
/option key new_value
/option key [reply to a message]
Example:
/option AUTO_DELETE_SECONDS 600
/option FORCE_SUB_MESSAGE: reply to a message.
Local Deployment
- Clone the repo
git clone https://github.com/zawsq/Teleshare.git
then change directory to Teleshare
cd Teleshare
-
Create an .env file refer to .env_example for referencee.
-
Create an python environment (poetry / virtualenv):
Optional
pip install virtualenv
virtualenv myenv
source myenv/bin/activate
windows:
myenv\Scripts\activate
- Install requirements
pip install -r requirements.txt
- Start the bot.
python -m bot.main
Quick Deployment
Please edit the following "Environment Variable" and refer to .env_example for reference.
SUPPORT CHANNEL: THE HQ