Coder Social home page Coder Social logo

rota-slack-app's Introduction

Rota Slack Bot

A slack bot to help you manage your team's rotas.

Usage

Say for example, that you have a team standup every weekday at 9:30, you could create a rota with the following commands:

@Rota create my-team-standup
@Rota add my-team-standup @user1 @user2 @user3
@Rota assign @user1 my-team-standup

The bot can then be invoked by the reminders slackbot command to schedule common operations:

/remind #my-team-channel @Rota who my-team-standup every weekday at 9:20
/remind #my-team-channel @Rota rotate my-team-standup every weekday at 9:45

You may want to schedule these operations from a separate channel (e.g. #rota-integration) to reduce the noise in your team channel.

Commands

  • ๐ŸŽจ @Rota create [rota-name] "[optional rota description]" create a new rota. [rota-name] can only contain lowercase letters, numbers, and hyphens. "[optional rota description]" must be enclosed in double quotes if given.
  • โ›” @Rota delete [rota-name] delete a rota.
  • ๐Ÿ“‹ @Rota list display a list of all rotas.
  • ๐Ÿ‘€ @Rota show [rota-name] show info about a rota.
  • ๐Ÿ‘ฅ @Rota add [rota-name] [user1 user2 user3] add users to a rota.
  • ๐Ÿ™‹โ€โ™€๏ธ @Rota assign [user] [rota-name] assign user to rota.
  • ๐Ÿ”„ @Rota rotate [rota-name] rotate a rota.
  • ๐Ÿ”” @Rota who [rota-name] who is assigned to a rota.
  • ๐Ÿ’ @Rota help show this list of commands.

Implementation

  • The app is written in Typescript using the bolt-js framework.
  • Uses the Events API to receive events from Slack, via the app_mention event with app_mentions:read permissions.
  • Uses the Slack Web API to send messages, via the say function with chat:write permissions.
  • Uses the yargs parsing library to parse commands from the message text.
  • Makes outbound requests to the hosted API, see rota-api for more info.

Development

Prerequisites

Run

# Install dependencies
npm install

# Run the app
npm start

# Run tests
npm test

# (optional) expose an ngrok tunnel to your local machine
ngrok http 3000

Notes

  • Authorization/authentication has not yet been implemented (both client-side and server-side), so the bot has not yet been published on the slack app store, and will currently only work in workspaces that have installed the app manually.

rota-slack-app's People

Contributors

russellyeo avatar

Watchers

 avatar

rota-slack-app's Issues

Authentication

App: rota-slack-app

This is a feature branch for several issues related to authentication

Create staging environment

In order to test changes without breaking things in production, I would like to have a separate staging environment for the rota slack app

Requirements

  • Create a new application on fly.io for the staging application, with the necessary secrets to point to slack app in my personal workspace and the production API (for now, until we set up staging API)
  • Split the fly.toml configuration into 2 files (fly.production.toml and fly.staging.toml) pointing the latter to the new application
  • Update Makefile with commands to deploy to each environment
  • Deploy application
  • Update slack events subscription URL to point to new application ({SLACK_APP_URL}/slack/events)

Fly CLI commands

fly apps create --name xxxx
fly secrets set --app=xxxx NAME=VALUE
fly deploy --config fly.staging.toml
fly logs -a xxxx

Resources

Add say command

Add a say command that repeats the message back to the user

@Rota say "Hello, World!"

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.