Giter Club home page Giter Club logo

choice-slash-command's Introduction

clasp ci

What is this?

This bot will run the slack slash command and select a few words that are specified.
This bot runs as a web app within a Google app script.
You can make this bot work by registering it as a request URL for the Slack API slash command.

Slack slash command

  • When you let them choose a word
/choice keyword1 keyword2 keyword3

REQUIREMENTS

USAGE

To use it, you need to set up Google apps scripts, and Slack API.

Install Google apps scripts

  1. Enable Google Apps Script API
    https://script.google.com/home/usersettings
  2. make push
  3. make deploy
  4. Grant the necessary privileges
    make open
    Publish > Deploy as web app.. > Update
    Grant access

The URL of the current web app after deployment will be used as the request URL for the OAuth authentication screen and Slack message action.

Register with the Slack API

Setting Script properties

In order to run the application and change its behavior, you need to set the following Google Apps scripts property.

Property name Required Setting Value Description
VERIFICATION_TOKEN Basic Information > App Credentials > Verification Token A token that easily authenticates the source of a hooked request
CLIENT_ID Basic Information > App Credentials > Client ID Use with OAuth
CLIENT_SECRET Basic Information > App Credentials > Client Secret Use with OAuth
  1. Open Project
    $ make open
  2. Add Scirpt properties
    File > Project properties > Scirpt properties > Add row
    Setting Property & Value

OAuth Authentication

Settings OAuth & Permissions

  • Redirect URLs
    Add New Redirect URL > Add Redirect URL > Save URLs
    ex) https://script.google.com/macros/s/miserarenaiyo/usercallback
    You can check the Redirect URL in the following way. The RedirectUri of the displayed page.
    $ make application

  • Bot Token Scopes
    Click Add an OAuth Scope to select the following permissions

  • Install App to Workspace
    You must specify a destination channel that bot can post to as an app.

Install App to Workspace

  1. Open web application
    $ make application
    The browser will be launched with the following URL:
    example) https://script.google.com/macros/s/miserarenaiyo/exec
  2. Click Authorize.
    You must specify a destination channel that bot can post to as an app.
  3. Click Allow
    The following message is displayed when OAuth authentication is successful
Success!
Setting EventSubscriptions
Setting Slash Commands
Setting Interactivity & Shortcuts

When prompted, click the Setting Slash Commands to set up an Slash Commands.

Settings Slash Commands

choice-slash-command's People

Contributors

k2tzumi avatar

Stargazers

yudai-tsukamoto-LITALICO avatar

Watchers

James Cloos avatar  avatar

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.