-
How to get Telegram.WebApp.initDataUnsafe > chat_id with php not js |
Beta Was this translation helpful? Give feedback.
Answered by
revenkroz
Feb 1, 2023
Replies: 1 comment 7 replies
-
You can get fetch('/your-special-endpoint-to-recieve-data', {
method: 'POST',
body: Telegram.WebApp.initData, // data from telegram
})
`` |
Beta Was this translation helpful? Give feedback.
7 replies
Answer selected by
revenkroz
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You can get
chatId
when person starting bot for the first time — just take it fromUpdate
object. If you missed it you can send xhr-request withinitData
from frontend (web app) to some special endpoint like this: