Rahul Anand
Rahul Anand

Reputation: 57

I have a problem with InlineKeyboardButton in python telegram API

This is what my bot will do: If someone sends a command like \sendFriendReq to my bot, then my bot will send a message with their details and an Inline Button with with "yes" and "no".

The problem I'm facing: How can i know who send those messages other than formatting the text with their details, is there a way to send their chat id along with the inline button so i can use that chat id to send a reply to my bot users

Disclaimer: This is not the actual problem but the solution to this problem could solve my problem so alternate solution to send friend req won't help me

Upvotes: 0

Views: 387

Answers (1)

AMiWR
AMiWR

Reputation: 41

This would give you pretty much every detail about the incomming message:

userid = update.message.from_user.id
firstname = update.message.from_user.first_name
lastname = update.message.from_user.last_name
fullname = update.message.from_user.full_name
username = update.message.from_user.name
message = update.message.text
chatid = update.message.chat_id

Upvotes: 1

Related Questions