This bot is based on Weather Api website, it's optimized and capable of working with multiple users at the same time.
/start
— Welcome message/help
— Usage instructions and available parameters- Weather queries using parameters like city, city_id, zip, lat, lon, lang
- Async and fast (uses
aiohttp
andtelebot.async_telebot
) - Logs errors and activity to
bot.log
-
Clone the repository:
git clone https://github.com/YOUR_USERNAME/tegbot.git cd tegbot
-
Install dependencies:
pip install -r requirements.txt
-
Set your API keys:
- Open
main.py
- Replace
YOUR_OPENWEATHERMAP_APPID
with your OpenWeatherMap API key - Replace
YOUR_TELEGRAM_BOT_TOKEN
with your Telegram Bot token
- Open
-
Run the bot:
python main.py
- Type
/start
to get a welcome message. - Type
/help
to see usage instructions. - To get weather, send a message starting with
!
and parameters, for example:!city: London, lang: en !lat: 55.75, lon: 37.62, lang: ru
Available parameters:
city
, city_id
, zip
, lat
, lon
, lang
!city: Paris, lang: fr
- Do not share your API keys or tokens publicly.
bot.log
is used for logging and should not be committed to the repository.
MIT License