Git Product home page Git Product logo

run-py-bot's Introduction

run-py-bot's People

Contributors

aahnik avatar allcontributors[bot] avatar gabrielesilinic avatar imgbotapp avatar smartmanoj avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

run-py-bot's Issues

Could not deploy to heroku using webhook

I have rewritten the bot and made it work in an asynchronous fashion. Currently (v0.1.0), the bot uses aiogram.

The bot is working fine when it is run via polling. I have tested the bot via polling mode both locally โœ”๏ธ and on Heroku โœ”๏ธ

The start.py is the script to start the bot. You must have an environment variable named BOT_API_TOKEN. The value of this should be equal to the token you obtained from @BotFather.

Tip: Instead of setting the env variable you may create a file token.txt in the root of the project, with the value of the token.

To start the bot via polling simply run the script start.py.


To run the bot via webhook:

You have to set some additional environment variables:
APP_NAME = subdomain ( the name of your Heroku project )
DOMAIN = domain ( like herokuapp )

            ( your URL will be https://{APP_NAME}.{DOMAIN}.com )

METHOD = 'webhook' ( start.py will start webhook, if this env variable is present )

While starting the bot via webhook, no errors are being shown, but the bot is not responding. For setting up webhook, I have followed this example given in the official repo of aiogram

Major Update

Work in Progress for a Major update:

Using asynchronous code.

No PRs to be accepted till this issue is closed.

Bot could not Handle certain exponentials

image

bot got hanged...

Why is the timeout restriction of 10 s not working? no, that should not happen as I have code to handle that

stdout, stderr  =  proc.communicate(timeout=10)

is output too long ?? But I have

if len(returned_val) > 2000:
            returned_val = returned_val[:2000]
            returned_val += '\n\n ๐Ÿ˜Ÿ Output was too long, truncated to 2000 characters'

Investigate the cause of the problem.

How to deploy to Heroku ?

First of all click on the deploy to Heroku button given in readme.

image

fill-up the form that appears, and click "deploy"

and voila! its deployed.

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.