This is a Telegram bot that provides weather updates and other functionalities like greeting new members, translating text, and managing group members. The bot is built using Python and leverages the OpenWeatherMap API for weather updates.
- Weather Updates: Get current weather information for a predefined city.
- Greetings: Welcomes new members and says goodbye to members who leave the group.
- Offensive Message Handling: Tracks users who send offensive messages and kicks them out after a predefined number of warnings.
- Translation: Translates text to Arabic using the Google Translate API.
- Python 3.x
- A Telegram bot token from BotFather
- OpenWeatherMap API key from OpenWeatherMap
Create a .env
file in the root directory of your project and add your Telegram bot token and OpenWeatherMap API key:
in env:
BOT_TOKEN=your-telegram-bot-token
WEATHER=your-openweathermap-api-key
-
Clone the repository:
git clone https://github.com/catsmoker/Telegram_Bot.git cd Telegram_Bot
-
Install the required packages:
pip install -r requirements.txt
Run the bot using:
python bot.py