Google Forms
Over the years we have needed to make google forms for various reasons, most common being new moderator applications. This is the snippet used to send the application to a discord channel
function onFormSubmit(e) {
var discordPayload = {
content: "New form submitted",
embeds: [{
type: "rich",
title: "Form submission",
color: 65392,
fields: [],
}],
};
e.response.getItemResponses().forEach(function (i) {
var v = i.getResponse() || "None";
discordPayload.embeds[0].fields.push({
name: i.getItem().getTitle(),
value: v,
});
});
UrlFetchApp.fetch("https://discord.com/api/webhooks/", {
method: "post",
payload: JSON.stringify(discordPayload),
contentType: "application/json",
});
}
The procedure for using google forms when adding new moderators is as follows:
- Get permission from a super mod
- Create a new private discord channel with a webhook in the scheme
#forms_${month_short_code}_${year}
- Create the google form and use the snippet above and the webhook URL
- Test the form
- Post the form in #announcements
Tags: