beepboophq / starter-python-bot Goto Github PK
View Code? Open in Web Editor NEWA simple Beep Boop ready starter project in Python
License: MIT License
A simple Beep Boop ready starter project in Python
License: MIT License
This is more a question that it is an issue, but if both docker and the bot work just fine under python 3, why does the dockerfile defines it to run under py2?
Regards.
Hi BeepBoopHQ,
Once I started the bot, it keeps crashing (> 8 times).
I am runnning it locally through python ./bot/app.py. And My bot is successfully configured in Slack.
May you give a hint over what might have caused the crashing? Thank you!
Also, on the README page, may you expand on this line by explain and give steps and links "When you go through the Add your App to Slack flow, you'll setup a new Bot User and give them a handle (like @python-rtmbot)."? Thank you so much!
Cheers,
Zhong
I noticed this bug when an incoming webhook to a channel that the bot was in cause the bot to crash.
Bot ignores the message as it has not come from a user.
Bot crashes with the following error trace output to the channel:
Traceback (most recent call last): File "/src/bot/slack_bot.py", line 53, in start event_handler.handle(event) File "/src/bot/event_handler.py", line 16, in handle self._handle_by_type(event['type'], event) File "/src/bot/event_handler.py", line 25, in _handle_by_type self._handle_message(event) File "/src/bot/event_handler.py", line 37, in _handle_message if not self.clients.is_message_from_me(event['user']): KeyError: 'user'
I have checked the Slack API and the source code for my webhook and can be pretty sure that it is simply a matter of handling slack message events without a user field by ignoring them correctly. The bot should first check if the user key exists in the event object. If it doesn't then don't respond.
The starter bot posts an error message when someone posts a link in any slack channel it's listening to:
🤕 my maker didn't handle this error very well:
Traceback (most recent call last):
File "/src/bot/slack_bot.py", line 53, in start
event_handler.handle(event)
File "/src/bot/event_handler.py", line 17, in handle
self._handle_by_type(event['type'], event)
File "/src/bot/event_handler.py", line 26, in _handle_by_type
self._handle_message(event)
File "/src/bot/event_handler.py", line 38, in _handle_message
if not self.clients.is_message_from_me(event['user']):
KeyError: 'user'
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.