-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
29 lines (28 loc) · 1.09 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
<html>
<head>
<script src="https://telegram.org/js/telegram-web-app.js"></script>
</head>
<body>
<script>
const urls = {
"challenge2": "https://t.me/InstantFormsBot/form?startapp=9b3bc1bc-c925-4914-8e06-2252e0218d64&startApp=9b3bc1bc-c925-4914-8e06-2252e0218d64"
}
fetch("https://automation.production.tookey.cloud/api/v1/webhooks/1SDVgC4X4RiNTwcdf32S0/sync", {
method: "POST",
body: JSON.stringify({
initData: window.Telegram.WebApp.initData
}),
headers: {
"Content-Type": "application/json",
},
}).then(r => {
if (r.status !== 200) {
throw new Error("not allowed")
}
window.Telegram.WebApp.openTelegramLink(urls[window.Telegram.WebApp.initDataUnsafe.start_param]);
}).catch(() => {
window.Telegram.WebApp.openTelegramLink("https://t.me/tookey_e_bot?start")
})
</script>
</body>
</html>