Лайфхаки

Маленькие, полезные хитрости

Бот для приема

Download the latest Python 3 package from the official website .

Run the installation with the default configuration. Take note of where python is being installed , we will need this later. Take a screenshot of it, or write it down somewhere.

After the installation has completed, we will need to add the python package manager to the system path, in order to install the python-telegram-bot package. First, find the 'advanced system settings' through the control panel. We recommend you use the search function.

Then, click on 'environment variables'.

Select the ' Path ' variable, and click edit.

Telegram can be used for chatops using the extensive Bot API provided.Its user base,availability of mobile and web app support makes it good candidate for personal and small business use,if not enterprise.

Interestingly Telegram provides us an official Bot BotFather to request our Bot creation.Open the link in Telegram and request your Bot.

Telegram бот на python3. Building simple Telegram Bot in Python

Request Unsplash API key

With the Bot now available we need Unsplash API key for our Bot to access and request images.The procedure is simple.

Visit Unsplash Developer page Register and request API key for your account.


Создаём папку Bot, в которой потом создаём файл bot.py. Здесь будет код нашего бота.Открываем консоль и переходим в директорию с файлом, устанавливаем python-telegram-bot .pip install python-telegram-bot --upgradeПосле установки мы уже можем написать «основу», которая пока что будет просто отвечать однотипными сообщениями. Импортируем необходимые модули и прописываем наш токен API:

Код настроек и импорта

Готовый чат-бот на python. Поиск ближайших соседей