Airgram

Guides
/
/
Methods

api.addLocalMessage()

Adds a local message to a chat. The message is persistent across application restarts only if the message database is used. Returns the added message

Parameters AddLocalMessageParams:

NameTypeDescription
chatIdnumber Target chat
senderId Identifier of the sender of the message
replyToMessageIdnumber Identifier of the message to reply to or 0
disableNotificationboolean Pass true to disable notification for the message
inputMessageContent The content of the message to be added
Returns ApiResponse interface:
interface ApiResponse {
  _: 'addLocalMessage' | 'error'
  airgram: Airgram
  request: {
    method: 'addLocalMessage'
    params: AddLocalMessageParams
  }
  response:  | 
  setState: (nextState: Record<string, unknown>) => void
  getState: () => Record<string, unknown>
}