I have a bot that needs to warn and ban users in a group. But I cannot ban them if someone writes as a channel. I want to ban the channel, not the owner
message.from_user
returns a fallback value, which points to @Channel_Bot for backwards compatibility. I kept identifying the wrong user
Is there a correct way of identifying such users?
I have a bot that needs to warn and ban users in a group. But I cannot ban them if someone writes as a channel. I want to ban the channel, not the owner
message.from_user
returns a fallback value, which points to @Channel_Bot for backwards compatibility. I kept identifying the wrong user
Is there a correct way of identifying such users?
Messages sent on behalf of a chat has the field sender_chat
which contains the ID of the used chat of the sent message. See: https://core.telegram.org/bots/api#message.