Git Product home page Git Product logo

run-py-bot's Introduction

thumbnail

run-py-bot

Run python code from your telegram chat!

GitHub license made-with-python telegram-chat badge-youtube

UPDATE I am no longer running this bot on my server. Please deploy your own instance to use.

Featured in ๐Ÿ˜

  1. Tweet by Dev Community
  2. Tweet by The Python Dev
  3. Dor Moshe's Newsletter
  4. My YouTube Video Chatting with Python

Example Use ๐Ÿ”€

You may use pythonic expressions to easily calculate any complex problem. Or you may test your algorithms on the go.

demo

How to run ๐Ÿค–

You can easily run your own instance of the bot.

You can run on any OS (windows/mac/linux). For better reliability, you may deploy to a VPS like Digital Ocean Droplet. You can even run on Android, using the Termux app.

Open your terminal and follow the instructions to run the bot.

Note: Use python 3.8

  • Make sure you have git, python and pip.

    # the following commands should not produce error
    git --version
    python --version # 3.8 is recommended
    pip --version

    Note: In some systems python version 3 is availaible as python3

  • First of all, clone the repository and move into the run-py-bot directory.

    git clone https://github.com/aahnik/run-py-bot.git && cd run-py-bot
  • Create a python virtual enviroment and activate it.

    python -m venv .venv # create
    source .venv/bin/activate # activate (unix)
    # the command to activate virtual environment is different for Windows, google search
  • Install the requirements.

    pip install -r requirements.txt
  • Set API_TOKEN environment variable. Write the following into a file named .env.

    API_TOKEN=1234fsjksjfls23r4
    # use your own real token

    You can create a new bot and get token from @BotFather.

  • Run the start.py, and you are good to go.

    python start.py

Deploy to Heroku ๐Ÿš€

You can click this button to deploy to Heroku.

Deploy

For more details read the guide about Heroku deployment.

Changelog ๐Ÿ”–

See the Releases tab for more info.

Contributing โœจ

Issues and PRs welcome!

If planning to contribute code, Read the docstrings in the code for details. You will find lots of helpful links to stack overflow and documentation of libraries used.

Here are some useful links:

  1. How to deploy a telegram bot to Heroku
  2. Telegram Bot API Documentaion
  3. Aiogram Examples
  4. The Heroku Procfile
  5. What are webhooks
  6. How to use an API to run a piece of Python code

run-py-bot's People

Contributors

aahnik avatar abhijitkar avatar allcontributors[bot] avatar gabrielesilinic avatar imgbotapp avatar smartmanoj 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.