40 lines
1.1 KiB
HTML
40 lines
1.1 KiB
HTML
---
|
|
title: question candy
|
|
---
|
|
|
|
<h2>Send your comments and questions directly to me, and I'll put them here if they're funny</h2><br>
|
|
|
|
<textarea cols="50" id="username" placeholder="give me ur name"></textarea>
|
|
<textarea cols="50" id="question" placeholder="say something funny or you'll regret it"></textarea>
|
|
<br>
|
|
<button id="send">send</button>
|
|
|
|
<script>
|
|
async function sendQuestion() {
|
|
var questionfield = document.getElementById("question");
|
|
var userfield = document.getElementById("username");
|
|
|
|
let tohook = await fetch("https://discord.com/api/webhooks/1299830086165332040/85jxFM4ZtRYKRzGw7QQRyDldrV38f4iaDtuERF9CASJkokFX1skF4kFC84WvuNeqUbbu", {
|
|
method: "POST",
|
|
headers: { "Content-Type": "application/json" },
|
|
body: JSON.stringify({
|
|
username: userfield.value,
|
|
content: "<@661044029110091776>\n" + questionfield.value,
|
|
})
|
|
})
|
|
|
|
console.log(tohook.status);
|
|
if(!tohook.ok)
|
|
{
|
|
alert(`HTTP error: ${tohook.status}`);
|
|
}
|
|
else
|
|
{
|
|
questionfield.value = "";
|
|
userfield.value = "";
|
|
}
|
|
}
|
|
|
|
document.getElementById('send').onclick = sendQuestion;
|
|
</script>
|