Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface SendMessageParams

Interface for sending a message. only message is required

Hierarchy

  • SendMessageParams

Index

Properties

message?: MessageLike

The message to be sent, or another message object to resend as a copy.
The maximum length for a message is 35,000 bytes or 4,096 characters.
Longer messages will not be sliced automatically, and you should slice them manually if the text to send is longer than said length.

replyTo?: number | Message

Whether to reply to a message or not. If an integer is provided, it should be the ID of the message that it should reply to.

attributes?: TypeDocumentAttribute[]

Optional attributes that override the inferred ones, like DocumentAttributeFilename and so on.

parseMode?: any

See the parseMode property for allowed values. Markdown parsing will be used by default.

formattingEntities?: TypeMessageEntity[]

A list of message formatting entities. When provided, the parseMode is ignored.

linkPreview?: boolean

Should the link preview be shown?

file?: FileLike | FileLike[]

Sends a message with a file attached (e.g. a photo, video, audio or document). The message may be empty.

thumb?: FileLike

Optional JPEG thumbnail (for documents). Telegram will ignore this parameter unless you pass a .jpg file!
The file must also be small in dimensions and in disk size. Successful thumbnails were files below 20kB and 320x320px.
Width/height and dimensions/size ratios may be important. For Telegram to accept a thumbnail, you must provide the dimensions of the underlying media through attributes: with DocumentAttributesVideo.

forceDocument?: false

Whether to send the given file as a document or not.

clearDraft?: false

Whether the existing draft should be cleared or not.

buttons?: MarkupLike

The matrix (list of lists), row list or button to be shown after sending the message.
This parameter will only work if you have signed in as a bot. You can also pass your own ReplyMarkup here.

All the following limits apply together:

  • There can be 100 buttons at most (any more are ignored).
  • There can be 8 buttons per row at most (more are ignored).
  • The maximum callback data per button is 64 bytes.
  • The maximum data that can be embedded in total is just over 4KB, shared between inline callback data and text.
silent?: boolean

Whether the message should notify people in a broadcast channel or not. Defaults to false, which means it will notify them. Set it to True to alter this behaviour.

supportStreaming?: boolean

Whether the sent video supports streaming or not.
Note that Telegram only recognizes as streamable some formats like MP4, and others like AVI or MKV will not work.
You should convert these to MP4 before sending if you want them to be streamable. Unsupported formats will result in VideoContentTypeError.

schedule?: number

If set, the message won't send immediately, and instead it will be scheduled to be automatically sent at a later time.

noforwards?: boolean
commentTo?: number | Message

Similar to replyTo, but replies in the linked group of a broadcast channel instead (effectively leaving a "comment to" the specified message).

This parameter takes precedence over replyTo. If there is no linked chat, SG_ID_INVALID is thrown.

topMsgId?: number | Message

Used for threads to reply to a specific thread

Generated using TypeDoc