Code Monkey home page Code Monkey logo

template-slash-command-and-dialogs's Introduction

Slash Command and Dialogs Modals blueprint

โœจ Updated October 2019: 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

Creating a helpdesk ticket using a Slash Command and a Dialog Modal

Use a slash command and a dialog to create a helpdesk ticket in a 3rd-party system. Once it has been created, send a message to the user with information about their ticket.

helpdesk-dialog

Setup

Create a Slack app

  1. Create an app at https://api.slack.com/apps
  2. Add a Slash command (See Add a Slash Command section below)
  3. Enable Interactive components (See Enable Interactive Components below)
  4. Navigate to the OAuth & Permissions page and select the following bot token scopes:
    • commands
    • chat:write
    • users:read
    • users:read.email
    • im:write
  5. Click 'Save Changes' and install the app (You should get an OAuth access token after the installation)

Add a Slash Command

  1. Go back to the app settings and click on Slash Commands.
  2. Click the 'Create New Command' button and fill in the following:
    • Command: /helpdesk
    • Request URL: Your server or Glitch URL + /command
    • Short description: Create a helpdesk ticket
    • Usage hint: [the problem you're having]

If you did "Remix" on Glitch, it auto-generate a new URL with two random words, so your Request URL should be like: https://fancy-feast.glitch.me/command.

Enable Interactive Components

  1. Go back to the app settings and click on Interactive Components.
  2. Set the Request URL to your server or Glitch URL + /interactive.
  3. Save the change.

Set Your Credentials

  1. Set the following environment variables to .env (see .env.sample):
    • SLACK_ACCESS_TOKEN: Your bot token, xoxb- (available on the OAuth & Permissions once you install the app)
    • SLACK_SIGNING_SECRET: Your app's Signing Secret (available on the Basic Information page)
  2. If you're running the app locally, run the app (npm start). Or if you're using Glitch, it automatically starts the app.

Run the app

  1. Get the code
    • Clone this repo and run npm install
  2. Set the following environment variables to .env (see .env.sample):
    • SLACK_ACCESS_TOKEN: Your bot token, xoxb- (available on the OAuth & Permissions once you install the app)
    • SLACK_SIGNING_SECRET: Your app's Signing Secret (available on the Basic Information page)
  3. If you're running the app locally, run the app (npm start).

If you want to run it locally, I recommend creating a localhost tunnel with ngrok!

App Flow Diagram

diagram

template-slash-command-and-dialogs's People

Contributors

arku avatar colmdoyle avatar girliemac avatar pichsenmeister avatar sachinr avatar seratch avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

template-slash-command-and-dialogs's Issues

Command time out

I am running the app through Glitch and it initially worked well, but every now and then it times out and take a few attempts to launch.

Any idea what is causing this?

[Limited list of approvers to choose from]

Description

Is there a way to have a specific list of approvers rather than everyone in the workspace?

Requirements (place an x in each of the [ ])

  • I've read and understood the Contributing guidelines and have done my best effort to follow them.
  • I've read and agree to the Code of Conduct.
  • I've searched for any related issues and avoided creating a duplicate issue.

Deprecated method im.open

Describe the bug

Method im.open is deprecated and should be replaced by conversations.open

https://api.slack.com/changelog/2020-01-deprecating-antecedents-to-the-conversations-api

What type of issue is this? (place an x in one of the [ ])

  • bug

Requirements (place an x in each of the [ ])**

  • I've read and understood the Contributing guidelines and have done my best effort to follow them.
  • I've read and agree to the Code of Conduct.
  • I've searched for any related issues and avoided creating a duplicate issue.

Serverless deployment

How to deploy this code serverlessly using was lambda and api gateway?
If you have any idea than please respond?

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.