From 069a5b223fe1430c13b67b577c9c5f05d86b4ae3 Mon Sep 17 00:00:00 2001 From: Kavalar Date: Fri, 3 Jan 2025 18:34:03 +0300 Subject: [PATCH] js --- app/modules/tgbot/views/tgbot/layout/main.php | 3 +++ resources/main/js/tg.js | 5 +++++ 2 files changed, 8 insertions(+) create mode 100644 resources/main/js/tg.js diff --git a/app/modules/tgbot/views/tgbot/layout/main.php b/app/modules/tgbot/views/tgbot/layout/main.php index e79f5cd..7e2e07d 100644 --- a/app/modules/tgbot/views/tgbot/layout/main.php +++ b/app/modules/tgbot/views/tgbot/layout/main.php @@ -20,6 +20,7 @@ + @@ -66,6 +67,7 @@ +
@@ -74,5 +76,6 @@ + \ No newline at end of file diff --git a/resources/main/js/tg.js b/resources/main/js/tg.js new file mode 100644 index 0000000..2edb3ce --- /dev/null +++ b/resources/main/js/tg.js @@ -0,0 +1,5 @@ +document.addEventListener("DOMContentLoaded", () => { + let tg = window.Telegram.WebApp; + let username_tag = document.getElementById("username_tag") + username_tag.innerHTML = tg.initDataUnsafe.user.username; +}); \ No newline at end of file