Coder Social home page Coder Social logo

Comments (10)

patrickelectric avatar patrickelectric commented on September 13, 2024 1

Same error..
I don't know if this can help, but running the local bot, and starting the vps bot, the local one returns:

January 01, 2018 -  21:17:49
Bottery version 0.0.1a9
Server running at http://localhost:7000
Quit the bot with CONTROL-C
Task exception was never retrieved
future: <Task finished coro=<TelegramEngine.polling() done, defined at /usr/lib/python3.6/site-packages/bottery/platform/telegram/engine.py:74> exception=KeyError('result',)>
Traceback (most recent call last):
  File "/usr/lib/python3.6/site-packages/bottery/platform/telegram/engine.py", line 91, in polling
    tasks = [self.message_handler(msg) for msg in updates['result']]
KeyError: 'result'

from bottery.

rougeth avatar rougeth commented on September 13, 2024

Hi @patrickelectric, you ran bottery startproject <name>, configured your bot token on settings.py and executed bottery run? This message indicates that something on configurations step didn't work (e.g. setting polling mode on Telegram platform).

I understand that the message isn't helpful at all. I'll take a look and try to make it better.

Thanks for opening the issue.

from bottery.

patrickelectric avatar patrickelectric commented on September 13, 2024

I have a local computer running the code without problems.
Maybe can be something related with my vps ? Both settings are identical.
Code struct:

wilson
├── bot.py
├── getnet.py
├── __pycache__
│   ├── bot.cpython-35.pyc
│   ├── getnet.cpython-35.pyc
│   └── settings.cpython-35.pyc
└── settings.py

You can check my settings here.

from bottery.

rougeth avatar rougeth commented on September 13, 2024

My guess would be something related to the polling mode. Since it keeps requesting updates from Telegram API, could the VPS be thinking your are DDoSing them?

I would suggest you to use webhook mode. Almost no changes on settings.py, but you would need to expose your bot on port 80 or 88 (ref) (we don't support SSL yet, sorry about that).

Update your version of bottery (0.1.0a10), I just published this --port feature (:
$ bottery run --port 80

HOSTNAME = 'your.vps.ip'  # changing here
     
SECRET_KEY = 'super-secret-key'
 
PLATFORMS = {
    'telegram': {
        'ENGINE': 'bottery.platform.telegram',
        'OPTIONS': {
            'token': 'I have my token here !',
            'mode': 'webhook',  # changing here
        }
    },
}

from bottery.

rougeth avatar rougeth commented on September 13, 2024

Oh, I thought it was working on your local machine. The token you put on settings.py is exactly as you got from BotFather? This is probably the case.

from bottery.

patrickelectric avatar patrickelectric commented on September 13, 2024

Sorry, probably I was not clear enough.
Yes, the bot is working in my local machine, this error appear in my local machine when I start the vps bot. My conclusion is that the vps bot start the communication with the telegram server, that's why my local bot exit. I don't know if this information can help, just a plus.

from bottery.

rougeth avatar rougeth commented on September 13, 2024

Alright, when you said same error did you mean the No tasks found problem? I don't know how Telegram reacts when there are two different machines making request for its API but I do know that it only works on one mode at the time, polling or webhook.

from bottery.

romulocollopy avatar romulocollopy commented on September 13, 2024

I have the same error running on heroku. I coundn't emulate it locally, thought.
It is very possible I've ran two machines at the same time with the bot, but I only get this error in production.
The worst part is heroku stops the process after some error, and the bot goes offiline for a while (from minutes to hours).

To me would be enough to silence this error and continue, but I'm yet studing how can I do this.

from bottery.

romulocollopy avatar romulocollopy commented on September 13, 2024

#168

from bottery.

romulocollopy avatar romulocollopy commented on September 13, 2024

I just realized that revoke the token and generate a new one can solve this problem

from bottery.

Related Issues (20)

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.