diff --git a/td/telegram/ContactsManager.cpp b/td/telegram/ContactsManager.cpp index 218c8c006..678b31ed0 100644 --- a/td/telegram/ContactsManager.cpp +++ b/td/telegram/ContactsManager.cpp @@ -4390,6 +4390,10 @@ void ContactsManager::change_channel_participant_status_impl(ChannelId channel_i DialogParticipantStatus status, DialogParticipantStatus old_status, Promise &&promise) { + if (td_->auth_manager_->is_bot() && status.is_restricted() && status.is_member() && !old_status.is_member()) { + // allow bots to restrict left chat members without trying to add them + status.set_is_member(false); + } if (old_status == status) { return promise.set_value(Unit()); }