Airgram

Guides
/
/
Methods

api.getMessageLink()

Returns an HTTPS link to a message in a chat. Available only for already sent messages in supergroups and channels, or if message.can_get_media_timestamp_links and a media timestamp link is generated. This is an offline request

Parameters GetMessageLinkParams:

NameTypeDescription
chatIdnumber Identifier of the chat to which the message belongs
messageIdnumber Identifier of the message
mediaTimestampnumber If not 0, timestamp from which the video/audio/video note/voice note playing must start, in seconds. The media can be in the message content or in its web page preview
forAlbumboolean Pass true to create a link for the whole media album
forCommentboolean Pass true to create a link to the message as a channel post comment, or from a message thread
Returns ApiResponse interface:
interface ApiResponse {
  _: 'getMessageLink' | 'error'
  airgram: Airgram
  request: {
    method: 'getMessageLink'
    params: GetMessageLinkParams
  }
  response:  | 
  setState: (nextState: Record<string, unknown>) => void
  getState: () => Record<string, unknown>
}