<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Discord Spammer</title>
    <link rel="stylesheet" href="styles.css">
    <script>
        function sendRequest(url, method, headers, data) {
            return fetch(url, {
                method: method,
                headers: headers,
                body: data ? JSON.stringify(data) : null
            })
            .then(response => response.json())
            .catch(error => console.error('Error:', error));
        }

        function startSpamming() {
            const message = document.getElementById("message_content").value;
            const channelId = document.getElementById("channel_id").value;
            const tokens = document.getElementById("tokens").value.split(',');
            const spamChoice = document.getElementById("spam_choice").checked;

            if (!spamChoice) return;

            const url = `https://discord.com/api/v9/channels/${channelId}/messages`;
            const headers = {
                'Content-Type': 'application/json',
                'Authorization': 'YOUR_DISCORD_TOKEN'
            };

            function sendSpam(token) {
                const data = { content: message };
                headers['Authorization'] = token.trim();

                setInterval(() => {
                    sendRequest(url, 'POST', headers, data)
                        .then(response => {
                            if (response.status !== 200) {
                                console.error("Error sending message:", response.status);
                            }
                        });
                }, 100); // Send every 100ms
            }

            tokens.forEach(token => {
                sendSpam(token);
            });
        }
    </script>
</head>
<body>
    <h1>Discord Spammer</h1>
    <label for="server_id">Enter Discord Server ID:</label>
    <input type="text" id="server_id"><br><br>

    <label for="channel_id">Enter Discord Channel ID:</label>
    <input type="text" id="channel_id"><br><br>

    <label for="tokens">Enter Your Authorization Tokens (comma separated):</label>
    <input type="text" id="tokens"><br><br>

    <label for="message_content">Enter Message Content:</label>
    <input type="text" id="message_content"><br><br>

    <label for="spam_choice">Do you want to spam the message?</label>
    <input type="checkbox" id="spam_choice"><br><br>

    <button onclick="startSpamming()">Start Spamming</button>
</body>
</html>
