Skip to content

get chatid with php #5

Answered by revenkroz
DeAref asked this question in Q&A
Feb 1, 2023 · 1 comments · 7 replies
Discussion options

You must be logged in to vote

You can get chatId when person starting bot for the first time — just take it from Update object. If you missed it you can send xhr-request with initData from frontend (web app) to some special endpoint like this:

fetch('/your-special-endpoint-to-recieve-data', {
    method: 'POST',
    body: Telegram.WebApp.initData, // data from telegram
})
``

Replies: 1 comment 7 replies

Comment options

You must be logged in to vote
7 replies
@revenkroz
Comment options

@revenkroz
Comment options

@DeAref
Comment options

@revenkroz
Comment options

@CrazyTapok-bit
Comment options

Answer selected by revenkroz
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants