This bot is designed to perform various functions based on user interactions. The configuration is done using environment variables, making it easy to customize the bot's behavior.
- Python 3.x
python-dotenv
library: Install it usingpip install python-dotenv
-
Clone this repository:
git clone https://github.com/Switch-Bot-Samples/SwitchTgAutoFilter
-
Navigate to the project directory:
cd SwitchTgAutoFilter
-
Install the required dependencies:
pip install -r requirements.txt
-
Create a
.env
file in the project root and configure the following variables:BOT_TOKEN=<your_bot_token> CACHE_TIME=300 DATABASE_URI= ADMINS=10 # Add other configuration variables as needed
-
Run the bot:
python bot.py
BOT_TOKEN
: switch bot token obtained from the BotFather.CACHE_TIME
: Cache time for certain bot operations.USE_DESCRIPTION_FILTER
: Boolean indicating whether a description filter should be used.PICS
: List of URLs for pictures.
ADMINS
: List of admin user IDs.CHANNELS
: List of channel IDs.
DATABASE_URI
: Database URI.DATABASE_NAME
: Database name.COLLECTION_NAME
: Collection name.
LOG_CHANNEL
: Chat ID for log channel.SUPPORT_CHAT
: Support chat username.P_TTI_SHOW_OFF
: Boolean indicating whether to redirect users to send/start
in Bot PM.IMDB
: Boolean indicating whether to enable IMDB results.SINGLE_BUTTON
: Boolean indicating whether to show filename and file size in a single button.CUSTOM_FILE_CAPTION
: Custom caption for files.- ... (other variables)
LOG_STR
: Summary of current customized configurations.
Provide instructions on how users can interact with the bot and any available commands.
If you'd like to contribute to the project, please follow the standard GitHub flow:
- Fork the repository.
- Create a new branch.
- Make your changes.
- Open a pull request.
This project is licensed under the MIT License.