Raw.Message

Raw.Message

A message

message#94345242 flags:# out:flags.1?true mentioned:flags.4?true media_unread:flags.5?true silent:flags.13?true post:flags.14?true from_scheduled:flags.18?true legacy:flags.19?true edit_hide:flags.21?true pinned:flags.24?true noforwards:flags.26?true invert_media:flags.27?true flags2:# offline:flags2.1?true id:int from_id:flags.8?Peer from_boosts_applied:flags.29?int peer_id:Peer saved_peer_id:flags.28?Peer fwd_from:flags.2?MessageFwdHeader via_bot_id:flags.11?long via_business_bot_id:flags2.0?long reply_to:flags.3?MessageReplyHeader date:int message:string media:flags.9?MessageMedia reply_markup:flags.6?ReplyMarkup entities:flags.7?Vector<MessageEntity> views:flags.10?int forwards:flags.10?int replies:flags.23?MessageReplies edit_date:flags.15?int post_author:flags.16?string grouped_id:flags.17?long reactions:flags.20?MessageReactions restriction_reason:flags.22?Vector<RestrictionReason> ttl_period:flags.25?int quick_reply_shortcut_id:flags.30?int effect:flags2.2?long factcheck:flags2.3?FactCheck = Message;
export namespace Raw {
  export class Message {
    constructor(params: {
      out?: boolean;
      mentioned?: boolean;
      mediaUnread?: boolean;
      silent?: boolean;
      post?: boolean;
      fromScheduled?: boolean;
      legacy?: boolean;
      editHide?: boolean;
      pinned?: boolean;
      noforwards?: boolean;
      invertMedia?: boolean;
      offline?: boolean;
      id: number;
      fromId?: Raw.TypePeer;
      fromBoostsApplied?: number;
      peerId: Raw.TypePeer;
      savedPeerId?: Raw.TypePeer;
      fwdFrom?: Raw.TypeMessageFwdHeader;
      viaBotId?: bigint;
      viaBusinessBotId?: bigint;
      replyTo?: Raw.TypeMessageReplyHeader;
      date: number;
      message: string;
      media?: Raw.TypeMessageMedia;
      replyMarkup?: Raw.TypeReplyMarkup;
      entities?: Array<Raw.TypeMessageEntity>;
      views?: number;
      forwards?: number;
      replies?: Raw.TypeMessageReplies;
      editDate?: number;
      postAuthor?: string;
      groupedId?: bigint;
      reactions?: Raw.TypeMessageReactions;
      restrictionReason?: Array<Raw.TypeRestrictionReason>;
      ttlPeriod?: number;
      quickReplyShortcutId?: number;
      effect?: bigint;
      factcheck?: Raw.TypeFactCheck;
    }) {}
  }
}
🚫

This is a types constructor, you can’t use it as method when call invoke.

Layer: 185
Constructor ID: 0x94345242

Property

  • out : boolean or undefined

    Is this an outgoing message

  • mentioned : boolean or undefined

    Whether we were mentioned in this message

  • mediaUnread : boolean or undefined

    Whether there are unread media attachments in this message

  • silent : boolean or undefined

    Whether this is a silent message (no notification triggered)

  • post : boolean or undefined

    Whether this is a channel post

  • fromScheduled : boolean or undefined

    Whether this is a scheduled message

  • legacy : boolean or undefined

    This is a legacy message: it has to be refetched with the new layer

  • editHide : boolean or undefined

    Whether the message should be shown as not modified to the user, even if an edit date is present

  • pinned : boolean or undefined

    Whether this message is pinned

  • noforwards : boolean or undefined

    Whether this message is protected and thus cannot be forwarded; clients should also prevent users from saving attached media (i.e. videos should only be streamed, photos should be kept in ram, et cetera).

  • invertMedia : boolean or undefined

    If set, any eventual webpage preview will be shown on top of the message instead of at the bottom.

  • offline : boolean or undefined

    If set, the message was sent because of a scheduled action by the message sender, for example, as away, or a greeting service message.

  • id : number

    Id of the message

  • fromId : Raw.TypePeer or undefined

    Id of the sender of the message

  • fromBoostsApplied : number or undefined

    Supergroups only, contains the number of boosts this user has given the current supergroup, and should be shown in the ui in the header of the message. only present for incoming messages from non-anonymous supergroup members that have boosted the supergroup. note that this counter should be locally overridden for non-anonymous outgoing messages, according to the current value of channelfull.boostsApplied, to ensure the value is correct even for messages sent by the current user before a supergroup was boosted (or after a boost has expired or the number of boosts has changed); do not update this value for incoming messages from other users, even if their boosts have changed.

  • peerId : Raw.TypePeer

    Peer id, the chat where this message was sent

  • savedPeerId : Raw.TypePeer or undefined

    Messages fetched from a saved messages dialog will have peer=inputpeerself and the savedPeerId flag set to the id of the saved dialog.

  • fwdFrom : Raw.TypeMessageFwdHeader or undefined

    Info about forwarded messages

  • viaBotId : bigint or undefined

    Id of the inline bot that generated the message

  • viaBusinessBotId : bigint or undefined

    Whether the message was sent by the business bot specified in viaBotId on behalf of the user.

  • replyTo : Raw.TypeMessageReplyHeader or undefined

    Reply information

  • date : number

    Date of the message

  • message : string

    The message

  • media : Raw.TypeMessageMedia or undefined

    Media attachment

  • replyMarkup : Raw.TypeReplyMarkup or undefined

    Reply markup (bot/inline keyboards)

  • entities : Array of Raw.TypeMessageEntity or undefined

    Message entities for styled text

  • views : number or undefined

    View count for channel posts

  • forwards : number or undefined

    Forward counter

  • replies : Raw.TypeMessageReplies or undefined

    Info about post comments (for channels) or message replies (for groups)

  • editDate : number or undefined

    Last edit date of this message

  • postAuthor : string or undefined

    Name of the author of this message for channel posts (with signatures enabled)

  • groupedId : bigint or undefined

    Multiple media messages sent using messages.sendmultimedia with the same grouped id indicate an album or media group

  • reactions : Raw.TypeMessageReactions or undefined

    Reactions to this message

  • restrictionReason : Array of Raw.TypeRestrictionReason or undefined

    Contains the reason why access to this message must be restricted.

  • ttlPeriod : number or undefined

    Time to live of the message, once message.date+message.ttlPeriod === time(), the message will be deleted on the server, and must be deleted locally as well.

  • quickReplyShortcutId : number or undefined

    If set, this message is a quick reply shortcut message (note that quick reply shortcut messages sent to a private chat will not have this field set).

  • effect : bigint or undefined

    A message effect that should be played as specified here.

  • factcheck : Raw.TypeFactCheck or undefined

    Represents a fact-check.