Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save shoumoji/cb7f69beeb35dbc42d3c648e432e4d04 to your computer and use it in GitHub Desktop.

Select an option

Save shoumoji/cb7f69beeb35dbc42d3c648e432e4d04 to your computer and use it in GitHub Desktop.
const webhooksUrl = '<discord webhookのURL>'
function submitForm(e) {
let formResponses = e.response.getItemResponses();
// フォームの上から何番目の質問の解答を入れるか
// 詳しくは https://www.yukibnb.com/entry/form_responses 参照
let content = formResponses[1].getResponse();
sendObject = {
"content" : content
};
let options ={
'method' : 'POST',
'contentType': 'application/json',
'payload': JSON.stringify(sendObject)
};
UrlFetchApp.fetch(webhooksUrl, options);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment