简体   繁体   中英

How to get name of the channel in other's chat group in telegram bot python?

I'am trying to get the name of the channel that sending message into other channel's chat. For example: I have channel named Cat and Cat chat; also I have a channel Dog. I've send the message using Dog into Cat chat and I wanna to get name Dog into variable. I've tried message.from_user.username and message.from_user.first_name but it printed Channel_bot and Channel. There is example of other channel commenting in my chat

So nickname "gdfgd" should be saved in variable. Is there any method that doing it? I'm using python and aiogram.

https://core.telegram.org/bots/api#chat

I think you need a key 'message.chat.title'

I found method message.sender_chat.title that prints what i wanted!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM