Skip to content

Commit 8cfc4c6

Browse files
committed
changed location
1 parent 6e2df8d commit 8cfc4c6

File tree

1 file changed

+19
-19
lines changed

1 file changed

+19
-19
lines changed

docs/telegram-bot-playground/index.html

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,25 @@
1010
<script defer src="https://cdn.jsdelivr.net/npm/[email protected]/dist/cdn.min.js"></script>
1111

1212
<link rel="stylesheet" href="styles.css?v=oq5lin">
13+
14+
<script>
15+
document.addEventListener('alpine:initialized', async () => {
16+
await playground.start();
17+
playground.onCodeChange(() => {
18+
playground.runBot(botState);
19+
});
20+
playground.worker.onmessage = (e) => {
21+
console.log('got message from worker', e?.data);
22+
if (!e?.data) return;
23+
if (e.data.botState) {
24+
Object.assign(botState, e.data.botState)
25+
}
26+
botUpdates.push(e.data);
27+
console.log('Scrolling', $refs.updates.scrollHeight);
28+
$nextTick(() => { $refs.updates.scrollTop = $refs.updates.scrollHeight })
29+
};
30+
})
31+
</script>
1332
</head>
1433

1534
<body x-data="{
@@ -58,25 +77,6 @@ <h1>Telegram Bot Playground 🤖 </h1>
5877
</div>
5978
</div>
6079

61-
<script>
62-
document.addEventListener('alpine:initialized', async () => {
63-
await playground.start();
64-
playground.onCodeChange(() => {
65-
playground.runBot(botState);
66-
});
67-
playground.worker.onmessage = (e) => {
68-
console.log('got message from worker', e?.data);
69-
if (!e?.data) return;
70-
if (e.data.botState) {
71-
Object.assign(botState, e.data.botState)
72-
}
73-
botUpdates.push(e.data);
74-
console.log('Scrolling', $refs.updates.scrollHeight);
75-
$nextTick(() => { $refs.updates.scrollTop = $refs.updates.scrollHeight })
76-
};
77-
})
78-
</script>
79-
8080
</body>
8181

8282
</html>

0 commit comments

Comments
 (0)