Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // A bot that defends Touchy
- // Author: Sean Hoyt (Deadman96385)
- var botId = "f420373372741ca5114624cbb0";
- function sendText(text){
- UrlFetchApp.fetch("https://api.groupme.com/v3/bots/post", {"method":"post", "payload":'{"bot_id":"' + botId + '","text":"' + text + '"}'})
- }
- //respond to messages sent to the group. Recieved as POST
- function doPost(e){
- var post = JSON.parse(e.postData.getDataAsString());
- var text = post.text;
- var name = post.name
- //check if server is running (diagnostics)
- if(text.indexOf("touchy") > -1)
- sendText("Do not make fun of my brother! " + name);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement