Google Apps Script interface for Slack API
- Create a new Apps Script.
- Copy entire file of /dist/bundle.js and Paste it to the new apps script.
- Publish your App Script from Apps Script web editor as an API and copy the key.
- Create Another App Script and import the library which you created from
Resources>Library
. - You can Add your token to your Properties in your scripts and get it and use the library like the Example below.
- Clone this repository.
- Change scriptId in .clasp.json to your new empty Apps Script.
- Do
npm run deploy
. - Publish your App Script from Apps Script web editor as an API and copy the key.
- Create Another App Script and import the library which you created from
Resources>Library
. - You can Add your token to your Properties in your scripts and get it and use the library like the Example below.
var token = PropertiesService.getScriptProperties().getProperty('SLACK_ACCESS_TOKEN');
var slack = GASlacker.methods(token);
function doPost(e){
var event = JSON.parse(e.postData.contents).event;
if(event.text.match(/hello/)){
var text = "Hello World";
slack.chat.postMessage(event.channel, text);
}
}
-
https://github.com/os/slacker
Python Interface (GASlacker interface imitated this.) -
https://github.com/soundTricker/SlackApp
GAS Library for same purpose in CoffeeScript (not updated) -
https://github.com/howdy39/gas-clasp-starter
Starter to develop GAS with git
This software is released under the MIT License, see LICENSE.txt.
Any Issue and PR for better software is wellcome.