Giter VIP home page Giter VIP logo

asyncvoter-slack-bot's Issues

persist the vote info

As an admin or user
So that we don't lose critical vote information
I would like the vote information to be persisted

Could be sent to RESTful endpoint

add cucumber testing

We've got a yada outline in place, but needs some work to hook it out and help make the high level stories nice and clear

add error handling

@chaiwa-berian makes a great point that we should have some general error handling when instructions fail, so the bot can respond with some helpful instructions when there's a fail

failure on server

When @mtc2013 was testing we got this failure:

ubuntu@ip-172-31-35-239:~/async_slack_bot$ { type: 'message',
  channel: 'D35B4MGCU',
  user: 'U02B6JMJ6',
  text: 'vote results',
  ts: '1481754694.000008',
  team: 'T0285CSTT',
  event: 'direct_message',
  match: [ 'vote', index: 0, input: 'vote results' ] }

/home/ubuntu/async_slack_bot/server.js:57
  vote = message.text.match(/\d+/)[0]
                                  ^
TypeError: Cannot read property '0' of null
    at Object.controller.hears.response (/home/ubuntu/async_slack_bot/server.js:57:35)
    at Object.<anonymous> (/home/ubuntu/async_slack_bot/node_modules/botkit/lib/CoreBot.js:852:28)
    at Object.Botkit.botkit.trigger (/home/ubuntu/async_slack_bot/node_modules/botkit/lib/CoreBot.js:879:49)
    at Object.<anonymous> (/home/ubuntu/async_slack_bot/node_modules/botkit/lib/SlackBot.js:720:34)
    at Object.Botkit.botkit.trigger (/home/ubuntu/async_slack_bot/node_modules/botkit/lib/CoreBot.js:879:49)
    at /home/ubuntu/async_slack_bot/node_modules/botkit/lib/CoreBot.js:983:32
    at Object.bot.findConversation (/home/ubuntu/async_slack_bot/node_modules/botkit/lib/Slackbot_worker.js:678:9)
    at /home/ubuntu/async_slack_bot/node_modules/botkit/lib/CoreBot.js:979:21
    at next (/home/ubuntu/async_slack_bot/node_modules/botkit/node_modules/ware/lib/index.js:82:27)
    at Ware.run (/home/ubuntu/async_slack_bot/node_modules/botkit/node_modules/ware/lib/index.js:88:3)

bug: name not found

{ type: 'message',
  channel: 'D33U268KG',
  user: 'U0292M7AC',
  text: 'vote 3',
  ts: '1480511500.000046',
  team: 'T0285CSTT',
  event: 'direct_message',
  match: [ 'vote', index: 0, input: 'vote 3' ] }
info: ** API CALL: https://slack.com/api/chat.postMessage
info: ** API CALL: https://slack.com/api/chat.postMessage
info: ** API CALL: https://slack.com/api/chat.postMessage
info: ** API CALL: https://slack.com/api/chat.postMessage
start new vote "API - create user"  <https://www.pivotaltracker.com/story/show/134581147>

/home/ubuntu/async_slack_bot/server.js:50
  story.name = match[1]
                    ^
TypeError: Cannot read property '1' of null
    at Object.controller.hears.vote (/home/ubuntu/async_slack_bot/server.js:50:21)
    at Object.<anonymous> (/home/ubuntu/async_slack_bot/node_modules/botkit/lib/CoreBot.js:852:28)
    at Object.Botkit.botkit.trigger (/home/ubuntu/async_slack_bot/node_modules/botkit/lib/CoreBot.js:879:49)
    at Object.<anonymous> (/home/ubuntu/async_slack_bot/node_modules/botkit/lib/SlackBot.js:739:38)
    at Object.Botkit.botkit.trigger (/home/ubuntu/async_slack_bot/node_modules/botkit/lib/CoreBot.js:879:49)
    at /home/ubuntu/async_slack_bot/node_modules/botkit/lib/CoreBot.js:983:32
    at Object.bot.findConversation (/home/ubuntu/async_slack_bot/node_modules/botkit/lib/Slackbot_worker.js:678:9)
    at /home/ubuntu/async_slack_bot/node_modules/botkit/lib/CoreBot.js:979:21
    at next (/home/ubuntu/async_slack_bot/node_modules/botkit/node_modules/ware/lib/index.js:82:27)
    at Ware.run (/home/ubuntu/async_slack_bot/node_modules/botkit/node_modules/ware/lib/index.js:88:3)

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.