Skip to main content

channels.getMessages

Get channel/supergroup messages

func (c *Client) ChannelsGetMessages(ctx context.Context, request *ChannelsGetMessagesRequest) (MessagesMessagesClass, error)

Calling this method

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

res, err := api.ChannelsGetMessages(ctx, &tg.ChannelsGetMessagesRequest{
// see Parameters
})
if err != nil {
return err
}
_ = res // MessagesMessagesClass
return nil
})

Parameters

NameTypeRequiredDescription
ChannelInputChannelClassyesChannel/supergroup
ID[]InputMessageClassyesIDs of messages to get

Returns

MessagesMessagesClass

Possible errors

CodeTypeDescription
400CHANNEL_INVALIDThe provided channel is invalid.
406CHANNEL_PRIVATEYou haven't joined this channel/supergroup.
400CHAT_NOT_MODIFIEDNo changes were made to chat information because the new information you passed is identical to the current information.
400FROZEN_PARTICIPANT_MISSINGThe current account is frozen, and cannot access the specified peer.
400MESSAGE_IDS_EMPTYNo message ids were provided.
400MSG_ID_INVALIDInvalid message ID provided.
400USER_BANNED_IN_CHANNELYou're banned from sending messages in supergroups/channels.

References