unban_chat_member()¶
- async Client.unban_chat_member()¶
Unban a previously banned user in a supergroup or channel. The user will not return to the group or channel automatically, but will be able to join via link, etc. You must be an administrator for this to work.
Basic groups keep no ban list: a member removed from one can be added back or rejoin via link at any time, so unbanning there is a no-op that returns True.
Usable by Users Bots- Parameters:
chat_id (
int|str) – Unique identifier (int) or username (str) of the target chat.user_id (
int|str) – Unique identifier (int) or username (str) of the target user. For a contact that exists in your Telegram address book you can use his phone number (str).
- Returns:
bool– True on success.
Example
# Unban chat member right now await app.unban_chat_member(chat_id, user_id)