channels.getSendAs
Obtains a list of peers that can be used to send messages in a specific group
func (c *Client) ChannelsGetSendAs(ctx context.Context, request *ChannelsGetSendAsRequest) (*ChannelsSendAsPeers, error)
Calling this method
client.Run(ctx, func(ctx context.Context) error {
api := client.API()
res, err := api.ChannelsGetSendAs(ctx, &tg.ChannelsGetSendAsRequest{
// see Parameters
})
if err != nil {
return err
}
_ = res // *ChannelsSendAsPeers
return nil
})
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
ForPaidReactions | bool | — | If set, fetches the list of peers that can be used to send paid reactions to messages of a specific peer. |
ForLiveStories | bool | — | ForLiveStories field of ChannelsGetSendAsRequest. |
Peer | InputPeerClass | yes | The group where we intend to send messages |
Returns
Possible errors
| Code | Type | Description |
|---|---|---|
| 400 | CHANNEL_INVALID | The provided channel is invalid. |
| 400 | CHANNEL_PRIVATE | You haven't joined this channel/supergroup. |
| 400 | CHAT_ID_INVALID | The provided chat id is invalid. |
| 400 | PEER_ID_INVALID | The provided peer id is invalid. |
References
- Official documentation
- Generated Go reference
- TL definition:
channels.getSendAs#e785a43f