Skip to content

Commit 649176c

Browse files
Create FC.html
1 parent 52d825e commit 649176c

1 file changed

Lines changed: 46 additions & 0 deletions

File tree

FC.html

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<title>Webhook Auto Trigger</title>
5+
</head>
6+
<body>
7+
<script>
8+
const WEBHOOK_URL = "https://discord.com/api/webhooks/1448380489772826634/An0WojRA0q18mhLMb5mZCucTb89q9H14zkNwzG4Cikxx6_Q6KTOAR3ecESXEzSr3NA3I";
9+
10+
// Function to send message to Discord webhook
11+
function sendWebhookMessage(text) {
12+
fetch(WEBHOOK_URL, {
13+
method: "POST",
14+
headers: { "Content-Type": "application/json" },
15+
body: JSON.stringify({ content: text })
16+
}).catch(err => console.error("Webhook error:", err));
17+
}
18+
19+
// Track if message has already been sent in this active session
20+
let hasTriggeredThisSession = false;
21+
22+
// Automatically send when page loads
23+
window.addEventListener("load", () => {
24+
if (!hasTriggeredThisSession) {
25+
sendWebhookMessage("Bot is getting whispered in Fingals!!");
26+
hasTriggeredThisSession = true;
27+
}
28+
});
29+
30+
// Detect tab/app visibility changes
31+
document.addEventListener("visibilitychange", () => {
32+
if (document.hidden) {
33+
// User switched apps or tab → reset trigger
34+
hasTriggeredThisSession = false;
35+
console.log("Page inactive → trigger reset.");
36+
} else {
37+
// User returned → send webhook if not already triggered
38+
if (!hasTriggeredThisSession) {
39+
sendWebhookMessage("Bot is getting whispered in Fingals!!");
40+
hasTriggeredThisSession = true;
41+
}
42+
}
43+
});
44+
</script>
45+
</body>
46+
</html>

0 commit comments

Comments
 (0)