-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
68 lines (62 loc) · 1.95 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Discord Webhook Spammer</title>
</head>
<body>
<script>
var wh = document.getElementById('wh');
var un = document.getElementById('un');
var msg = document.getElementById('msg');
var int;
function send() {
if (msg.value.length > 0 && wh.value.length > 0 && un.value.length > 0) {
if ("/discord.com\/api\/webhooks\/([^\/]+)\/([^\/]+)/".test(wh.value)) {
var request = new XMLHttpRequest();
request.open("POST", wh.value);
request.setRequestHeader('Content-type', 'application/json');
var params = {
username: un.value,
avatar_url: "",
content: msg.value + "\n-Sent using https://discord-webhook-spammer.netlify.app!"
};
request.send(JSON.stringify(params));
int = setInterval(send, 2000);
} else {
alert("invalid webhook");
}
} else {
alert("missing input(s)");
}
}
function stop(){
clearInterval(int);
};
function save() {
if ("/discord.com\/api\/webhooks\/([^\/]+)\/([^\/]+)/".test(wh.value)) {
localStorage.setItem("webhook", wh.value);
} else {
alert("invalid webhook");
document.getElementById('cb').checked = false;
}
}
window.onload = function() {
if (localStorage.getItem("webhook") === null) {
console.log("no webhook saved");
} else {
wh.value = localStorage.getItem("webhook");
}
};
</script>
<input placeholder="Username" id="un"/>
<br/>
<input placeholder="Message" id="msg"/>
<br/>
<input type="url" placeholder="Webhook" id="wh"/>
<input id="cb" type="checkbox" onclick='save()'>Save Webhook</input>
<br/>
<input id="send" onclick="send()" type="button" value="send"/><input id="stop" onclick="stop()" type="button" value="stop"/>
</body>
</html>