This is a telegram bot written in Python using the aiogram asynchronous framework for Telegram Bot API.
It provides the following options:
-
Сurrent weather - you can find out the current weather in the cities from the proposed list. In this case there has been used simple and fast and free weather API from OpenWeatherMap
-
Exchange rates - you can find out the actual exchange rates for today or a specific date. This functionality is supported by using the API of the National Bank of the Republic of Belarus
In this context, a token is a string that authenticates your bot (not your account) on the bot API. Each bot has a unique token which can also be revoked at any time via @BotFather.
Obtaining a token is as simple as contacting @BotFather, issuing the /newbot
command
and following the steps until you're given a new token. You can find a step-by-step guide
here.
Your token will look something like this:
4839574812:AAFD39kkdpWt3ywyRZergyOLMaJhac60qc
The API key is all you need to call any of our weather APIs. Once you sign up using your email, the API key (APPID) will be sent to you in a confirmation email. Your API keys can always be found on your account page, where you can also generate additional API keys if needed. Check our documentation page to find all technical information for each product. Documentation is an essential guide with actual examples and comprehensive description of API calls, responses and parameters.
- Follow the link @getmyid_bot
- Click on the "Start" button to start the bot.
- Your ID will be displayed immediately in the reply message. See the first line, which starts with "Your user".
- Clone git repository:
https://github.com/KirylDumanski/aiogram-weather-currency-bot.git
- Execute in terminal:
python pip install -r requirements.txt
- In
data
folder find and rename.env.dist
to.env
. Paste your credentials into it:
BOT_TOKEN=123456789:YouR_Bot_TokEn
WEATHER_TOKEN=Your_openweather_api_token
ADMIN=YOUR_TG_ID
- Execute in terminal to run app:
python app.py