SetDiscussionGroupRequest

Only users can use this request. See code examples.

---functions---
channels.setDiscussionGroup#40582bb2 broadcast:InputChannel group:InputChannel = Bool

Returns

Bool

This type has no instances available.

Parameters

broadcastInputChannelAnything entity-like will work if the library can find its Input version (e.g., usernames, Peer, User or Channel objects, etc.).
groupInputChannelAnything entity-like will work if the library can find its Input version (e.g., usernames, Peer, User or Channel objects, etc.).

Known RPC errors

This request can cause 4 known errors:

BroadcastIdInvalidErrorThe channel is invalid.
LinkNotModifiedErrorThe channel is already linked to this group.
MegagroupIdInvalidErrorThe group is invalid.
MegagroupPrehistoryHiddenErrorYou can't set this discussion group because it's history is hidden.

You can import these from telethon.errors.

Example

from telethon.sync import TelegramClient
from telethon import functions, types

with TelegramClient(name, api_id, api_hash) as client:
    result = client(functions.channels.SetDiscussionGroupRequest(
        broadcast='username',
        group='username'
    ))
    print(result)