Last active
March 6, 2019 07:30
-
-
Save pizzacat83/d645636ddc1d23290c7f0952dd8969c1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
global.doPost = (e: GASWebEvent): GoogleAppsScript.Content.TextOutput => { | |
const command: string = e.parameter.command; | |
if (command) { | |
/* register commands like | |
global.slackCommands.command = (params: SlackCommansParams): {} => {}; */ | |
const res = global.slackCommands[command.substr(1)](e.parameter); // '/command' -> 'command' | |
const response = ContentService.createTextOutput(); | |
response.setMimeType(ContentService.MimeType.JSON); | |
response.setContent(JSON.stringify(res)); | |
return response; | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment