GithubHelp home page GithubHelp logo

lexxx42 / yandex-weather-bot Goto Github PK

View Code? Open in Web Editor NEW
2.0 1.0 1.0 83 KB

Simple weather bot python-telegram-bot v20.0b0

Python 95.23% Dockerfile 4.77%
python-telegram-bot weather yandex-weather-api

yandex-weather-bot's Introduction

weather-bot

  • Simple weather bot python-telegram-bot v20.0b0

Used libraries


How to start the bot?

  1. Created new bot from https://t.me/BotFather if you don't have one
  2. Get token for API Yandex Weather https://yandex.com/dev/weather/
  3. Install all requirements from requirements.txt
pip install -r requirements.txt  
  1. Create file .env in project root
  2. Copy the line into you .env file with token provided by BotFather
BOT_TOKEN=YOUR_BOT_TOKEN  
  1. Copy the line into you .env file with token provided by Yandex.Weather API
TOKEN_YANDEX_WEATHER=YOUR_API_YANDEX_WEATHER_TOKEN  

New features with docker

If there is an error about lack of access, add current user to the docker group:

sudo usermod -a -G docker [user]
newgrp docker

Use this sequence of commands to run the container:

  1. To run the application in docker, you need to install docker-compose:
sudo apt install docker-compose 
  1. Clone the repository
git clone https://github.com/Lexxx42/yandex-weather-bot.git
  1. Change directory to project dir
cd yandex-weather-bot/
  1. Add your tokens for telegram bot and yandex weather
nano .env
BOT_TOKEN=YOUR_BOT_TOKEN
TOKEN_YANDEX_WEATHER=YOUR_API_YANDEX_WEATHER_TOKEN

Don't forget to save changes!

  1. Start the build
docker-compose up --build

Added docker image to public repository

Docker Hub

If you are using docker image from DockerHub use following commands:

  1. To pull repository use:
docker pull alex42konukhov/yandex-weather-bot:debian-bullseye
  1. Create a container from the image. Should be an error message.
docker run alex42konukhov/yandex-weather-bot:debian-bullseye
  1. Create .env file and add your telegram token and yandex weather api key
BOT_TOKEN=
TOKEN_YANDEX_WEATHER=
  1. Copy the modified configuration file from your host machine to the container's file system:
docker cp .env docker_container_id:/app/.env
  1. Run docker container in detached mode
docker start container_id

yandex-weather-bot's People

Contributors

lexxx42 avatar

Stargazers

 avatar  avatar

Watchers

 avatar

Forkers

cullinanchik

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.