/GASlacker

Google App Script interface for Slack API

Primary LanguageTypeScriptMIT LicenseMIT

GASlacker

Google Apps Script interface for Slack API

Usage

Add This Library from Google Apps Script.(Libraries are in Resources tab)
MCPiGxYANiZlb7LnYOqREqeJzI9uQ3ses

Examples

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," + event.message.username;
    slack.chat.postMessage(event.channel, text);
  }
}

Documentation

https://api.slack.com/methods

Reference

License

This software is released under the MIT License, see LICENSE.txt.