Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var POST_URL = "https://discordapp.com/api/webhooks/467762739180339204/sEbIS-utJLiJybVzx6pADUG3JgCp9Qz8FvMJC3AAu85bgY7-oYdRQTuu9JnhCulUYmV2";
- function onSubmit(e) {
- var response = e.response.getItemResponses();
- var items = [];
- for (var i = 0; i < response.length ; i++) {
- var question = response[i].getItem().getTitle();
- var answer = response[i].getResponse();
- var parts = answer.match(/[\s\S]{1,1024}/g) || [];
- if (answer == "") {continue;}
- for (var j = 0; j< parts.length; j++) {
- if (j == 0) {
- items.push({"name": question, "value": parts[j], "inline": false});
- } else {
- items.push({"name": question.concat(" (cont.)"), "value": parts[j], "inline": false});
- }
- }
- }
- var options = {
- "method" : "post",
- "payload": JSON.stringify({
- "content": '<@&336428142035992596>',
- "embeds": [
- {
- "title":"**New bugreport submitted.**",
- "fields":items,
- "footer":{"text": "/End of form"}
- }
- ]
- }
- )
- };
- UrlFetchApp.fetch(POST_URL, options);
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement