GithubHelp home page GithubHelp logo

avishekbhattacharjee / anti_covid19bot Goto Github PK

View Code? Open in Web Editor NEW

This project forked from gridl/anti_covid19bot

0.0 0.0 0.0 28 KB

COVID-19 statistics - Telegram bot

License: GNU General Public License v3.0

Dockerfile 0.84% Python 90.08% HTML 9.08%

anti_covid19bot's Introduction

anti_covid19bot LOGO

My personal chat bot with COVID-19 statistics feature
Can be found at @anticovid19statbot


Requirements:

  • Python 3.7+
  • MongoDB 4.0+

Libraries:

How to run

  • install Docker Desktop
  • install MongoDb
  • install Pycharm
  • git clone https://github.com/Oskar987/anti_covid19bot.git
  • cd anti_covid19bot
  • run Pycharm
  • edit environment variables
  • change telegram api connection from webhook to long polling
# set web hook
server = Flask(__name__)


@server.route('/' + token, methods=['POST'])
def get_messages():
    bot.process_new_updates([telebot.types.Update.de_json(request.stream.read().decode('utf-8'))])
    return '!', 200


@server.route('/')
def web_hook():
    bot.remove_webhook()
    bot.set_webhook(url=os.getenv('HEROKU_URL') + token)
    return '!', 200


# application entry point
if __name__ == '__main__':
    server.run(host='0.0.0.0', port=int(os.environ.get('PORT', 8443)))
# application entry point
if __name__ == '__main__':
    bot.polling(none_stop=True, interval=0)
  • run project in Pycharm

Note that anti_covid19bot will run in development mode. Do not try to use this in production.

Available functions:

  • /start - start communicating with bot
  • /help - get help information
  • /country - get covid-19 statistics by country which you enter the next step
  • /contacts - get contacts information
  • /statistics - get statistics of the bot usage

anti_covid19bot's People

Contributors

oskar987 avatar

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.