Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/yhay81/GASlacker
Google App Script interface for Slack API
https://github.com/yhay81/GASlacker
Last synced: 3 months ago
JSON representation
Google App Script interface for Slack API
- Host: GitHub
- URL: https://github.com/yhay81/GASlacker
- Owner: yhay81
- License: mit
- Created: 2018-03-19T13:22:06.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2023-01-04T21:37:13.000Z (about 2 years ago)
- Last Synced: 2024-08-01T06:20:44.275Z (6 months ago)
- Language: TypeScript
- Size: 2.86 MB
- Stars: 26
- Watchers: 3
- Forks: 11
- Open Issues: 26
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
- awesome-apps-script - Slack API interface
README
# GASlacker
Google Apps Script interface for Slack API
## Usage
### Easy way
1. Create a new Apps Script.
2. Copy entire file of /dist/bundle.js and Paste it to the new apps script.
3. Publish your App Script from Apps Script web editor as an API and copy the key.
4. Create Another App Script and import the library which you created from `Resources>Library`.
5. You can Add your token to your Properties in your scripts and get it and use the library like the Example below.### Developer way
1. Clone this repository.
2. Change scriptId in .clasp.json to your new empty Apps Script.
3. Do `npm run deploy`.
4. Publish your App Script from Apps Script web editor as an API and copy the key.
5. Create Another App Script and import the library which you created from `Resources>Library`.
6. You can Add your token to your Properties in your scripts and get it and use the library like the Example below.#### Example
```JavaScript
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);
}
}
```## Documentation
https://api.slack.com/methods
## Reference
- 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## License
This software is released under the MIT License, see [LICENSE.txt](LICENSE.txt).
## Contributing
Any Issue and PR for better software is wellcome.