Git Product home page Git Product logo

bedlam-slack's Introduction

Hello, World! I'm Martin Peck👋

I'm a developer at heart, and an engineering manager by trade. I work for Microsoft, in the UK, where I manage a team of excellent engineers.

I've used many programming languages but have fallen in love with Python.

You can find me in various places. I'm martinpeck in most places. On Mastodon I'm @[email protected]

My Linktree lists the rest.

bedlam-slack's People

Contributors

dependabot[bot] avatar martinpeck avatar stevehaigh avatar waffle-iron avatar

Watchers

 avatar  avatar

bedlam-slack's Issues

Refactor Responses

At present, the code builds slack responses inline.

Given that responses all have the same structure and, often, share common properties it would be better to have a single place in the code where responses are generated (or, at least, template responses are generated).

Add Validation of Slack Team and Slack Token

When slash commands are POSTed to the app there are two POST form values that can be used to validate that the request came from a recognised Slack instance:

  • token (contains a value generated when the slash command is added to Slack)
  • team_id (contains the team ID for the Slack instance)

We should be validating these incoming values with those stored in the environment variables SLACK_TOKEN and SLACK_TEAM (defined in .env, or defined in Heroku)

See https://api.slack.com/slash-commands#how_do_commands_work for details

Add CI Integration

Add CI (suggest Travis) to run tests on check in to master.
Once in place, update Heroku to only deploy on a green build.

Add Tests

Add some tests so that we can validate things are working prior to deployment

Create Voting Slash Command

The Idea

Allow a user to create a vote in a channel.

  • votes are attached to a channel and a user
  • any number of draft votes can exist
  • only one can be active in the channel
  • multi choice options are supplied
  • voting starts when the owner says so
  • entire channel gets to vote
  • voting stops when the owner of the vote closes the polls
  • once closed, a summary of the results is shown
  • once closed, other votes can be started

Commands:

/vote start
/vote option [option]
/vote option list
/vote start
/vote [option]
/vote close
/vote list
/vote result [vote id]

How it might work:

/vote create When shall we meet for beers?

(ephemeral message)

what are the options? Use \vote options [option text] to create them, then \vote start to start voting in this channel or \vote quit to abort

/vote option Monday (enter)

(ephemeral message)

you've added the option "Monday"

/vote option Wednesday (enter)

(ephemeral message)

you've added the option "Wednesday"

/vote option Monday (enter)

(ephemeral message)

you've already added this option. Please make your options unique. Friday` (enter)

/vote option Friday (enter)

(ephemeral message)

you've added the option "Friday"

/vote start (enter)

@martinpeck wants you to vote on something!
@martinpeck asks "When shall we meet for beers?"
Your options are:
/vote 1 for Monday
/vote 2 for Tuesday
/vote 3 for Friday

/vote options will remind you of the options

To end voting, @martinpeck can use /vote close and I'll show you the results

/vote start
(ephemeral message)

There is already a vote taking place in this channel

/vote 1
(ephemeral message)

Thanks! Your vote has been counted! Any previous votes will be ignored.

/vote 1
(ephemeral message)

Thanks! Your vote has been counted! Any previous votes will be ignored.

/vote close

Voting has closed on Martin's vote "When shall we meet for beers?"
Here are the results:

Monday: 1 vote
Wednesday: 0 votes
Friday: 0 votes

It looks like the option "Monday" has won!

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.