Skip to main content

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

NameTypeRequiredDescription
ForPaidReactionsboolIf set, fetches the list of peers that can be used to send paid reactions to messages of a specific peer.
ForLiveStoriesboolForLiveStories field of ChannelsGetSendAsRequest.
PeerInputPeerClassyesThe group where we intend to send messages

Returns

*ChannelsSendAsPeers

Possible errors

CodeTypeDescription
400CHANNEL_INVALIDThe provided channel is invalid.
400CHANNEL_PRIVATEYou haven't joined this channel/supergroup.
400CHAT_ID_INVALIDThe provided chat id is invalid.
400PEER_ID_INVALIDThe provided peer id is invalid.

References