Airgram

Guides
/
/
Methods

api.sendMessage()

Sends a message. Returns the sent message

Parameters SendMessageParams:

NameTypeDescription
chatIdnumber Target chat
messageThreadIdnumber If not 0, a message thread identifier in which the message will be sent
replyToMessageIdnumber Identifier of the message to reply to or 0
options Options to be used to send the message; pass null to use default options
replyMarkup Markup for replying to the message; pass null if none; for bots only
inputMessageContent The content of the message to be sent
Returns ApiResponse interface:
interface ApiResponse {
  _: 'sendMessage' | 'error'
  airgram: Airgram
  request: {
    method: 'sendMessage'
    params: SendMessageParams
  }
  response:  | 
  setState: (nextState: Record<string, unknown>) => void
  getState: () => Record<string, unknown>
}