1
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

GASを用いたSlack Bot(対話型)の作り方

Last updated at Posted at 2020-07-12

alt

Slackアプリの作成

  1. https://api.slack.com/apps にアクセスし、アプリを作成。
  2. Incoming Webhooks/
  • Activate Incoming WebhooksをONにする。
  • Add New Webhook to Workspace
  • Webhook URLを控えておく。
  1. Basic Information/
  • Verification Tokenを控えておく。

GASプロジェクト(+スプレッドシート)の作成

  1. https://drive.google.com/drive/my-drive にアクセスし、スプレッドシートを作成。
  2. スプレッドシートの名前を決めて、ツールから<> スクリプト エディタを開く。
  3. ソースコードを書く。(参考: イベントオブジェクトの形式
  4. 公開/ウェブアプリケーションとして導入/
  • Project version: New
  • Execute the app as: Me
  • Who has access to the app: Anyone, even anonymous
  1. DeployしてCurrent web app URLを控えておく。

SlackアプリのWebhook設定

  1. https://api.slack.com/apps に戻り、本アプリのページへ。
  2. Event Subscriptions/
  • Enable EventsをONにする。
  • Request URLにGASプロジェクトのCurrent web app URLを設定。
  • Subscribe to events on behalf of usersmessage.channelsを設定。
  • Save Changesして、スナックバーからreinstall。
1
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?