Advertisement
Guest User

Untitled

a guest
Aug 30th, 2014
314
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. // A bot that defends Touchy
  2. // Author: Sean Hoyt (Deadman96385)
  3. var botId = "f420373372741ca5114624cbb0";
  4. function sendText(text){
  5. UrlFetchApp.fetch("https://api.groupme.com/v3/bots/post", {"method":"post", "payload":'{"bot_id":"' + botId + '","text":"' + text + '"}'})
  6. }
  7.  
  8. //respond to messages sent to the group. Recieved as POST
  9. function doPost(e){
  10. var post = JSON.parse(e.postData.getDataAsString());
  11. var text = post.text;
  12. var name = post.name
  13.  
  14. //check if server is running (diagnostics)
  15. if(text.indexOf("touchy") > -1)
  16. sendText("Do not make fun of my brother! " + name);
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement