Skip to content

Commit

Permalink
changed location
Browse files Browse the repository at this point in the history
  • Loading branch information
kondaurovDev committed Dec 22, 2024
1 parent 6e2df8d commit 8cfc4c6
Showing 1 changed file with 19 additions and 19 deletions.
38 changes: 19 additions & 19 deletions docs/telegram-bot-playground/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,25 @@
<script defer src="https://cdn.jsdelivr.net/npm/[email protected]/dist/cdn.min.js"></script>

<link rel="stylesheet" href="styles.css?v=oq5lin">

<script>
document.addEventListener('alpine:initialized', async () => {
await playground.start();
playground.onCodeChange(() => {
playground.runBot(botState);
});
playground.worker.onmessage = (e) => {
console.log('got message from worker', e?.data);
if (!e?.data) return;
if (e.data.botState) {
Object.assign(botState, e.data.botState)
}
botUpdates.push(e.data);
console.log('Scrolling', $refs.updates.scrollHeight);
$nextTick(() => { $refs.updates.scrollTop = $refs.updates.scrollHeight })
};
})
</script>
</head>

<body x-data="{
Expand Down Expand Up @@ -58,25 +77,6 @@ <h1>Telegram Bot Playground 🤖 </h1>
</div>
</div>

<script>
document.addEventListener('alpine:initialized', async () => {
await playground.start();
playground.onCodeChange(() => {
playground.runBot(botState);
});
playground.worker.onmessage = (e) => {
console.log('got message from worker', e?.data);
if (!e?.data) return;
if (e.data.botState) {
Object.assign(botState, e.data.botState)
}
botUpdates.push(e.data);
console.log('Scrolling', $refs.updates.scrollHeight);
$nextTick(() => { $refs.updates.scrollTop = $refs.updates.scrollHeight })
};
})
</script>

</body>

</html>

0 comments on commit 8cfc4c6

Please sign in to comment.