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

Time:07-31

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.

CodePudding user response:

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

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

CodePudding user response:

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

  • Related