Can I find the contents of a message with message id and chat_id?
Yes, you can.
What is the name of the function?
@cho060303 have you tried searching?
I could not find it in the document.
sorry
Thank you. I'll try searching again.
Have you found it yet?
client(AddChatUserRequest(
chat_id,
user_id,
fwd_limit=10
))
i also have an issue like you, where can i find chat_id
@bf-dev here is an example (using bot, mostly the same for client version of the code)
bot = TelegramClient('bot', API_ID, API_HASH).start(bot_token=BOT_TOKEN)
result = await bot(functions.messages.GetMessagesRequest(id=[message_id]))
message = result.messages[0]
print(message.text)
Check documentation for more
@ngodanghuuha if you want to get current chat id use get_chat
@bot.on(events.NewMessage)
async def any_message_arrived_handler(event):
chat = await event.get_chat()
full_chat = await bot(functions.messages.GetFullChatRequest(
chat_id=chat.id
))
example above shows how to get full chat too which contains a lot of extra information
Most helpful comment
Yes, you can.