Git Product home page Git Product logo

asyncvoter-slack-bot's Introduction

Asynchronous Voting Bot (SPIKE)

A slack bot to handle asynchronous planning poker

Setup

Set an environment variable equal to ASYNC_VOTER_SLACK_BOT_TOKEN to be your custom bot token. Set in your .bashrc or prefix the bot command with ASYNC_VOTER_SLACK_BOT_TOKEN=<your-token>

Running

Edit the code to manually set the vote topic, start the bot up with:

$ node server.js

and then say to the bot in a channel (or in DM if you want to just test it):

@<bot-name> start new vote

and the bot will say:


Async VoterBOT	[11:02 AM]  
@channel NEW ASYNC VOTE on "Project Page Redesign" https://github.com/AgileVentures/WebsiteOne/issues/797 Please DM me with: `vote 1` (Simple), `vote 2` (Medium) or `vote 3` (Hard) - Discussion in ticket or here as you prefer. :slightly_smiling_face:

now anyone wishing to vote can DM the bot like so:

vote 1

and the vote will be stored and the channel notified of the update like so:

@here ASYNC VOTE UPDATE 1 vote so far [@tansaku ] on "Project Page Redesign" https://github.com/AgileVentures/WebsiteOne/issues/797 Please DM me with: `vote 1` (Simple), `vote 2` (Medium) or `vote 3` (Hard) - Discussion in ticket or here as you prefer. :slightly_smiling_face:

finally say to the bot:

@<bot-name> result

to get the results posted to the channel where the vote was started:

votes so far:

@edmilsonefs voted: 2
@arreche voted: 2
@tansaku voted: 2

asyncvoter-slack-bot's People

Contributors

arreche avatar marianmosley avatar mtc2013 avatar tansaku avatar ygt-abooth avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

asyncvoter-slack-bot's Issues

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

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)

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 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

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.