set_chat_direct_messages_group()#
- Client.set_chat_direct_messages_group()#
Change direct messages group settings for a channel chat.
Usable by Users BotsRequires owner privileges in the chat.
- Parameters:
chat_id (
int
|str
) – Unique identifier (int) or username (str) of the target chat.is_enabled (
bool
, optional) – Pass True if the direct messages group is enabled for the channel chat. Pass False otherwise.paid_message_star_count (
bool
) – The new number of Telegram Stars that must be paid for each message that is sent to the direct messages chat unless the sender is an administrator of the channel chat, 0-stars_paid_message_amount_max
.
- Returns:
Message
|bool
– On success, a service message will be returned (when applicable), otherwise, in case a message object couldn’t be returned, True is returned.- Raises:
RPCError – In case of a Telegram RPC error.
Example
# Enable direct messages await app.set_chat_direct_messages_group(chat_id, is_enabled=True)