All Projects → slackapi → template-announcement-approvals

slackapi / template-announcement-approvals

Licence: MIT license
Sample Slack app that uses the Events API and interactive message to implement an approvals workflow

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to template-announcement-approvals

template-actionable-notifications
Sample Slack app to illustrate how incoming webhooks and interactive messages can be used to build a helpdesk integration
Stars: ✭ 31 (-57.53%)
Mutual labels:  slack-api, slack-blueprint, slack-workflow-sample, slack-tutorial
template-action-and-dialog
A sample Slack app "ClipIt", which allows user to clip a message using a message action
Stars: ✭ 24 (-67.12%)
Mutual labels:  slack-api, slack-blueprint, slack-workflow-sample, slack-tutorial
Slack Black Theme
slack theme, dark theme for slack, black theme slack black theme
Stars: ✭ 531 (+627.4%)
Mutual labels:  slack-api
Sclack
The best CLI client for Slack, because everything is terrible!
Stars: ✭ 2,363 (+3136.99%)
Mutual labels:  slack-api
Slack Machine
A sexy, simple, yet powerful and extendable Slack bot
Stars: ✭ 91 (+24.66%)
Mutual labels:  slack-api
Slack Cli
Powerful Slack CLI via pure bash. Rich messaging, uploads, posts, piping, oh my!
Stars: ✭ 850 (+1064.38%)
Mutual labels:  slack-api
Slack Block Builder
Lightweight, no-dependency JavaScript library for creating Slack Block Kit UIs, with a builder syntax, inspired by SwiftUI.
Stars: ✭ 129 (+76.71%)
Mutual labels:  slack-api
Slacker
Slack Bot Framework
Stars: ✭ 495 (+578.08%)
Mutual labels:  slack-api
Bolt Python
A framework to build Slack apps using Python
Stars: ✭ 190 (+160.27%)
Mutual labels:  slack-api
Fantasy Football Metrics Weekly Report
Command line application to create weekly reports (containing stats, metrics, and rankings) for Fantasy Football leagues on the following platforms: Yahoo, Fleaflicker, Sleeper, ESPN.
Stars: ✭ 62 (-15.07%)
Mutual labels:  slack-api
Slack Poster
Simple gem to post messages on Slack using web hooks.
Stars: ✭ 49 (-32.88%)
Mutual labels:  slack-api
Slack Ruby Client
A Ruby and command-line client for the Slack Web, Real Time Messaging and Event APIs.
Stars: ✭ 957 (+1210.96%)
Mutual labels:  slack-api
Slack Api Specs
Open API specifications for platform products by Slack
Stars: ✭ 148 (+102.74%)
Mutual labels:  slack-api
Whatis
Whatis bot server for Slack!
Stars: ✭ 22 (-69.86%)
Mutual labels:  slack-api
Slacknimate
👯 Realtime text animation for Slack chatops
Stars: ✭ 250 (+242.47%)
Mutual labels:  slack-api
Slackpirate
Slack Enumeration and Extraction Tool - extract sensitive information from a Slack Workspace
Stars: ✭ 512 (+601.37%)
Mutual labels:  slack-api
Bolt Starter
A Bolt ⚡️ app template with useful settings for easier development
Stars: ✭ 37 (-49.32%)
Mutual labels:  slack-api
Slack cleaner2
📝 Python3 module for deleting Slack messages and files using the Slack REST API
Stars: ✭ 92 (+26.03%)
Mutual labels:  slack-api
node-tasks-app
Tasks App is a sample Task Management app built on the Slack Platform.
Stars: ✭ 59 (-19.18%)
Mutual labels:  slack-api
admissions
Admissions is the gateway to Elixir School's private Slack
Stars: ✭ 18 (-75.34%)
Mutual labels:  slack-api

"AnnounceBot" Approval Workflows with Modal

Updated October 2020: As we have introduced some new features, this tutorial and the code samples have been updated! All the changes from the previous version of this example, read the DIFF.md


This app lets its bot to post an approved message into a public channel- A user DMs to bot to create an announcement, and once it is approved by another user, the message will be posted to public.

User A ("girlie_mac") wants to announce about donuts on #random channel, and User B ("Slack Boss") approves it:

announcements_approvals

API & Features

This app uses:

  • Web API
    • chat.postMessage to post messages
    • conversations.open to send direct messages from the bot to a user
    • users.conversations to get channels the bot user is a member of
    • views.publish to publish a view to the Home tab
    • views.open to open a Block Kit modal and collect information for the announcement to be sent
    • conversations.history to view historical messages between the bot and user
  • Events API message.im to see when a DM message is sent
  • Block Kit messages with interactive buttons
  • Block Kit Modals API with dynamic menus

Setup

1. Clone this repo, or Remix this Glitch repo

Clone the repo (then npm install to install the dependencies), or if you'd like to work on Glitch, remix from the button below:

Remix on Glitch

2. Create a Slack app

  1. Create an app at api.slack.com/apps
  2. Navigate to the OAuth & Permissions page and add the following Bot token scopes:
    • channels:read
    • chat:write
    • im:write
    • im:history
  3. Enable the events (See below Enable the Events API)
  4. Enable the interactive messages (See below Enable Interactive Messages)
  5. Enable App Home (See below App Home)
  6. Click 'Save Changes' and install the app (You should get an OAuth access token after the installation

Enable the Events API

  1. Click on Events Subscriptions and enable events.
  2. Set the Request URL to your server (or Glitch URL) + /events (e.g. https://your-server.com/events)
  3. On the same page, go down to Subscribe to Bot Events section and subscribe to these events
    • message.im
    • app_home_opened
  4. Save

Enable Interactive Messages

To enable interactive UI components (This example uses buttons):

  1. Click on Interactive Components and enable the interactivity.
  2. Set the Request URL to your server (or Glitch URL) + /interactions

To dynamically populate a drop-down menu list in a dialog (This example uses a list of channels):

  1. Insert the Options Load URL (e.g. https://your-server.com/options) in the Message Menus section
  2. Save

Enable App Home

To enable App Home:

  1. Click on App Home and make sure both Home Tab and Messages Tab are enabled.

3. Run this App

Set Environment Variables and run:

  1. Set the following environment variables in .env (copy from .env.sample):
    • SLACK_ACCESS_TOKEN: Your app's xoxb- token (available on the Install App page after the installation)
    • SLACK_SIGNING_SECRET: Your app's Signing Secret (available on the Basic Information page)
  2. If you're running the app locally:
    • Start the app (npm start)

On Slack client, "invite" your bot to appropriate channels. The bot cannot post messages to the channels where the bot is not added.

The app sequence diagram

dialog

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].