Whether the message is outgoing (i.e. you sent it from
another session) or incoming (i.e. someone else sent it).
Note that messages in your own chat are always incoming,
but this member will be true
if you send a message
to your own chat. Messages you forward to your chat are
not considered outgoing, just like official clients
display them.
Whether you were mentioned in this message or not. Note that replies to your own messages also count as mentions.
Whether you have read the media in this message or not, e.g. listened to the voice note media.
Whether the message should notify people with sound or not. Previously used in channels, but since 9 August 2019, it can also be used in private chats
Whether this message is a post in a broadcast channel or not.
Whether this message was originated from a previously-scheduled message or not.
Whether this is a legacy message or not.
Whether the edited mark of this message is edited should be hidden (e.g. in GUI clients) or shown.
Whether this message is currently pinned or not.
The ID of this message. This field is always present.
Any other member is optional and may be undefined
.
The peer who sent this message, which is either
Api.PeerUser, Api.PeerChat or Api.PeerChannel.
This value will be undefined
for anonymous messages.
The peer to which this message was sent, which is either Api.PeerUser, Api.PeerChat or Api.PeerChannel. This will always be present except for empty messages.
The original forward header if this message is a forward.
You should probably use the forward
property instead.
The ID of the bot used to send this message through its inline mode (e.g. "via @like").
The original reply header if this message is replying to another.
The timestamp indicating when this message was sent. This will always be present except for empty messages.
The string text of the message for Api.Message instances,
which will be undefined
for other types of messages.
The media sent with this message if any (such as photos, videos, documents, gifs, stickers, etc.).
You may want to access the photo
, document
etc. properties instead.
If the media was not present or it was Api.MessageMediaEmpty,
this member will instead be undefined
for convenience.
The reply markup for this message (which was sent either via a bot or by a bot).
You probably want to access buttons
instead.
The list of markup entities in this message, such as bold, italics, code, hyperlinks, etc.
The number of views this message from a broadcast channel has. This is also present in forwards.
The number of times this message has been forwarded.
The number of times another message has replied to this message.
The date when this message was last edited.
The display name of the message sender to show in messages sent to broadcast channels.
If this message belongs to a group of messages (photo albums or video albums), all of them will have the same value here.
An optional list of reasons why this message was restricted.
If the list is undefined
, this message has not been restricted.
The message action object of the message for Api.MessageService
instances, which will be undefined
for other types of messages.
The Time To Live period configured for this message. The message should be erased from wherever it's stored (memory, a local database, etc.) when this threshold is met.
Returns buttons
when that property fails (this is rarely needed).
Helper methods to set the buttons given the input sender and chat.
Returns the input peer of the bot that's needed for the reply markup.
This is necessary for KeyboardButtonSwitchInline
since we need
to know what bot we want to start. Raises Error
if the bot
cannot be found but is needed. Returns None
if it's not needed.
Returns a list of lists of MessageButton <MessageButton>
, if any.
Otherwise, it returns undefined
.
Generated using TypeDoc
This custom class aggregates both Api.Message and Api.MessageService to ease accessing their members.
Remember that this class implements ChatGetter and SenderGetter
which means you have access to all their sender and chat properties and methods.