I have created a game bot to present my simple h5 game in telegram. I wonder how to get the telegram user info who is playing my h5 game?
What i have done:
- created bot to reply game to telegram
- created bot to handle callback message from telegram play game button(the callback message
from
will always be my bot) - the chatgpt said telegram will carry user info into the game url, then i try to print game url when game opened in telegram, but nothing got
- viewed the game integration doc but no related infomation found
2
Answers
Solved, the callback query carries the user info in the top field
from
like below:{
callback_query: {
id: "5035214419",
from: {
id: 5035214419,
is_bot: false,
first_name: "Ruth",
username: "@Rtmz0",
language_code: "xxxx"
},
message: {}
}
}