Giter Site home page Giter Site logo

starter-python-bot's People

Contributors

dvanduzer avatar mbrevoort avatar randompi avatar selfcontained avatar thundergolfer-two 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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

starter-python-bot's Issues

Dockerfile defaults to 2.7

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.

Crashing Bot

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

Bot fails to handle message events which do not contain a "user" field

I noticed this bug when an incoming webhook to a channel that the bot was in cause the bot to crash.

Steps to reproduce

  1. Fork this repo and install the bot as per instructions
  2. Connect the bot to a team and invite it to a channel
  3. Send a message into the channel without a user field in the message payload.

Expected Result

Bot ignores the message as it has not come from a user.

Actual Result

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'

Related Issue - #10

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.

Error message when someone posts a link

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'

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.