set_chat_discussion_group()¶
- async Client.set_chat_discussion_group()¶
Link or unlink a discussion group to a channel.
Requires the
can_change_infoadministrator right in the channel, and thecan_pin_messagesmember right in the group.Usable by Users Bots- Parameters:
chat_id (
int|str, optional) – Unique identifier (int) or username (str) of the target channel. Pass None to unlink the group given indiscussion_chat_idfrom its channel.discussion_chat_id (
int|str, optional) – Unique identifier (int) or username (str) of the discussion group. Pass None to remove the current discussion group of the channel.
- Returns:
bool– On success, True is returned.- Raises:
ValueError – In case both arguments are None, or one of them does not belong to a channel.
Example
await app.set_chat_discussion_group("@channel", "@group") await app.set_chat_discussion_group(chat_id="@channel")