This commit is contained in:
Kavalar 2025-01-04 02:04:39 +03:00
parent 6180fb52ae
commit 9e7ded8b15
2 changed files with 3 additions and 0 deletions

View File

@ -68,6 +68,7 @@
</div>
<?php endif; ?>
<div id="username_tag"></div>
<div id="user_id_tag"></div>
<?= $content ?>
</div>
</div>

View File

@ -1,7 +1,9 @@
document.addEventListener("DOMContentLoaded", () => {
let tg = window.Telegram.WebApp;
let username_tag = document.getElementById("username_tag")
let user_id_tag = document.getElementById("user_id_tag")
username_tag.innerHTML = tg.initDataUnsafe.user.username;
user_id_tag.innerHTML = tg.initDataUnsafe.user.id;
console.log(tg.initDataUnsafe)
});