Skip to main content

channels.exportMessageLink

Get link and embed info of a message in a channel/supergroup

func (c *Client) ChannelsExportMessageLink(ctx context.Context, request *ChannelsExportMessageLinkRequest) (*ExportedMessageLink, error)

Calling this method

client.Run(ctx, func(ctx context.Context) error {
api := client.API()

res, err := api.ChannelsExportMessageLink(ctx, &tg.ChannelsExportMessageLinkRequest{
// see Parameters
})
if err != nil {
return err
}
_ = res // *ExportedMessageLink
return nil
})

Parameters

NameTypeRequiredDescription
GroupedboolWhether to include other grouped media (for albums)
ThreadboolWhether to also include a thread ID, if available, inside of the link
ChannelInputChannelClassyesChannel
IDintyesMessage ID

Returns

*ExportedMessageLink

Possible errors

CodeTypeDescription
400CHANNEL_INVALIDThe provided channel is invalid.
400CHANNEL_PRIVATEYou haven't joined this channel/supergroup.
400MESSAGE_ID_INVALIDThe provided message id is invalid.
400MSG_ID_INVALIDInvalid message ID provided.

References