Skip to content

Commit 36bd71a

Browse files
Update CT.html
1 parent b8e2a86 commit 36bd71a

1 file changed

Lines changed: 39 additions & 32 deletions

File tree

CT.html

Lines changed: 39 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,51 @@
11
<!DOCTYPE html>
22
<html>
33
<head>
4-
<title>Safe Webhook Trigger</title>
4+
<title>Webhook Auto Trigger</title>
55
</head>
66
<body>
7-
<h2>Trigger Discord Webhook (Only This Device)</h2>
8-
<button id="triggerBtn">Send Alert</button>
7+
<button id="triggerButton">Trigger Webhook</button>
8+
<p id="status"></p>
99

10-
<script>
11-
const WEBHOOK_URL = "https://discord.com/api/webhooks/your_webhook_here";
10+
<script>
11+
const WEBHOOK_URL = "https://discord.com/api/webhooks/1448380489772826634/An0WojRA0q18mhLMb5mZCucTb89q9H14zkNwzG4Cikxx6_Q6KTOAR3ecESXEzSr3NA3I";
1212

13-
// Function to send a message to Discord webhook
14-
function sendWebhookMessage(text) {
15-
fetch(WEBHOOK_URL, {
16-
method: "POST",
17-
headers: { "Content-Type": "application/json" },
18-
body: JSON.stringify({ content: text })
19-
})
20-
.then(() => alert("Webhook sent! ✅"))
21-
.catch(err => console.error("Webhook error:", err));
22-
}
23-
24-
// Check if this device has already triggered
25-
const hasTriggered = localStorage.getItem("webhookTriggered");
13+
// Function to send message to Discord webhook
14+
function sendWebhookMessage(text) {
15+
fetch(WEBHOOK_URL, {
16+
method: "POST",
17+
headers: { "Content-Type": "application/json" },
18+
body: JSON.stringify({ content: text })
19+
})
20+
.then(() => {
21+
localStorage.setItem("webhookTriggered", "true");
22+
updateStatus();
23+
})
24+
.catch(err => console.error("Webhook error:", err));
25+
}
2626

27-
const btn = document.getElementById("triggerBtn");
28-
29-
if (hasTriggered) {
30-
btn.disabled = true;
31-
btn.innerText = "Already triggered on this device";
27+
// Update the button and status message
28+
function updateStatus() {
29+
const triggered = localStorage.getItem("webhookTriggered") === "true";
30+
const button = document.getElementById("triggerButton");
31+
const status = document.getElementById("status");
32+
33+
if (triggered) {
34+
button.disabled = true;
35+
status.textContent = "Webhook already triggered on this device.";
36+
} else {
37+
button.disabled = false;
38+
status.textContent = "You can trigger the webhook.";
3239
}
40+
}
41+
42+
// Trigger button click
43+
document.getElementById("triggerButton").addEventListener("click", () => {
44+
sendWebhookMessage("Bot is getting whispered in Fingals!!");
45+
});
3346

34-
btn.addEventListener("click", () => {
35-
if (!localStorage.getItem("webhookTriggered")) {
36-
sendWebhookMessage("Alert from this device only!");
37-
localStorage.setItem("webhookTriggered", "true");
38-
btn.disabled = true;
39-
btn.innerText = "Already triggered on this device";
40-
}
41-
});
42-
</script>
47+
// Initialize status on page load
48+
window.addEventListener("load", updateStatus);
49+
</script>
4350
</body>
4451
</html>

0 commit comments

Comments
 (0)