Comments (10)
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.
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.
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.
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.
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.
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.
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.
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.
from bottery.
I just realized that revoke the token and generate a new one can solve this problem
from bottery.
Related Issues (20)
- Create Issue and Pull Request templates
- Use pytest-deadfixtures on CI HOT 1
- View should be able to not response any message
- Middlewares
- Issue and Pull Request templates should not use markdown features
- Middleware example should be async HOT 3
- Warnings at test_bottery.test_default_properties
- Handler instances should returns the selected view
- Messenger considering wrong payload from Facebook webhook
- Move platforms modules outside platform module
- Allow hot-reload HOT 1
- Add Python 3.7 to tox.ini HOT 2
- Remove module dependency from settings HOT 1
- Create option on settings to change default module for msg handlers
- Remove `settings_module` param of Bottery
- Warnings: coroutine 'ClientSession.close' was never awaited
- Is there any roadmap for this project? HOT 1
- Add tox to the dev dependencies HOT 1
- Handle Telegram API response in case of failure
- Fix regex strings in tests and docs
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bottery.