ExGram.Model.Message (ex_gram v0.64.0)

Copy Markdown View Source

This object represents a message.

Check the documentation of this model on Telegram Bot API

  • message_id: Unique message identifier inside this chat. In specific instances (e.g., message containing a video sent to a big chat), the server might automatically schedule a message instead of sending it immediately. In such cases, this field will be 0 and the relevant message will be unusable until it is actually sent
  • date: Date the message was sent in Unix time. It is always a positive number, representing a valid date.
  • chat: Chat the message belongs to
  • message_thread_id (optional): Optional. Unique identifier of a message thread or forum topic to which the message belongs; for supergroups and private chats only
  • direct_messages_topic (optional): Optional. Information about the direct messages chat topic that contains the message
  • from (optional): Optional. Sender of the message; may be empty for messages sent to channels. For backward compatibility, if the message was sent on behalf of a chat, the field contains a fake sender user in non-channel chats
  • sender_chat (optional): Optional. Sender of the message when sent on behalf of a chat. For example, the supergroup itself for messages sent by its anonymous administrators or a linked channel for messages automatically forwarded to the channel's discussion group. For backward compatibility, if the message was sent on behalf of a chat, the field from contains a fake sender user in non-channel chats.
  • sender_boost_count (optional): Optional. If the sender of the message boosted the chat, the number of boosts added by the user
  • sender_business_bot (optional): Optional. The bot that actually sent the message on behalf of the business account. Available only for outgoing messages sent on behalf of the connected business account.
  • sender_tag (optional): Optional. Tag or custom title of the sender of the message; for supergroups only
  • business_connection_id (optional): Optional. Unique identifier of the business connection from which the message was received. If non-empty, the message belongs to a chat of the corresponding business account that is independent from any potential bot chat which might share the same identifier.
  • forward_origin (optional): Optional. Information about the original message for forwarded messages
  • is_topic_message (optional): Optional. True, if the message is sent to a topic in a forum supergroup or a private chat with the bot
  • is_automatic_forward (optional): Optional. True, if the message is a channel post that was automatically forwarded to the connected discussion group
  • reply_to_message (optional): Optional. For replies in the same chat and message thread, the original message. Note that the Message object in this field will not contain further reply_to_message fields even if it itself is a reply.
  • external_reply (optional): Optional. Information about the message that is being replied to, which may come from another chat or forum topic
  • quote (optional): Optional. For replies that quote part of the original message, the quoted part of the message
  • reply_to_story (optional): Optional. For replies to a story, the original story
  • reply_to_checklist_task_id (optional): Optional. Identifier of the specific checklist task that is being replied to
  • via_bot (optional): Optional. Bot through which the message was sent
  • edit_date (optional): Optional. Date the message was last edited in Unix time
  • has_protected_content (optional): Optional. True, if the message can't be forwarded
  • is_from_offline (optional): Optional. True, if the message was sent by an implicit action, for example, as an away or a greeting business message, or as a scheduled message
  • is_paid_post (optional): Optional. True, if the message is a paid post. Note that such posts must not be deleted for 24 hours to receive the payment and can't be edited.
  • media_group_id (optional): Optional. The unique identifier inside this chat of a media message group this message belongs to
  • author_signature (optional): Optional. Signature of the post author for messages in channels, or the custom title of an anonymous group administrator
  • paid_star_count (optional): Optional. The number of Telegram Stars that were paid by the sender of the message to send it
  • text (optional): Optional. For text messages, the actual UTF-8 text of the message
  • entities (optional): Optional. For text messages, special entities like usernames, URLs, bot commands, etc. that appear in the text
  • link_preview_options (optional): Optional. Options used for link preview generation for the message, if it is a text message and link preview options were changed
  • suggested_post_info (optional): Optional. Information about suggested post parameters if the message is a suggested post in a channel direct messages chat. If the message is an approved or declined suggested post, then it can't be edited.
  • effect_id (optional): Optional. Unique identifier of the message effect added to the message
  • animation (optional): Optional. Message is an animation, information about the animation. For backward compatibility, when this field is set, the document field will also be set
  • audio (optional): Optional. Message is an audio file, information about the file
  • document (optional): Optional. Message is a general file, information about the file
  • paid_media (optional): Optional. Message contains paid media; information about the paid media
  • photo (optional): Optional. Message is a photo, available sizes of the photo
  • sticker (optional): Optional. Message is a sticker, information about the sticker
  • story (optional): Optional. Message is a forwarded story
  • video (optional): Optional. Message is a video, information about the video
  • video_note (optional): Optional. Message is a video note, information about the video message
  • voice (optional): Optional. Message is a voice message, information about the file
  • caption (optional): Optional. Caption for the animation, audio, document, paid media, photo, video or voice
  • caption_entities (optional): Optional. For messages with a caption, special entities like usernames, URLs, bot commands, etc. that appear in the caption
  • show_caption_above_media (optional): Optional. True, if the caption must be shown above the message media
  • has_media_spoiler (optional): Optional. True, if the message media is covered by a spoiler animation
  • checklist (optional): Optional. Message is a checklist
  • contact (optional): Optional. Message is a shared contact, information about the contact
  • dice (optional): Optional. Message is a dice with random value
  • game (optional): Optional. Message is a game, information about the game. More about games »
  • poll (optional): Optional. Message is a native poll, information about the poll
  • venue (optional): Optional. Message is a venue, information about the venue. For backward compatibility, when this field is set, the location field will also be set
  • location (optional): Optional. Message is a shared location, information about the location
  • new_chat_members (optional): Optional. New members that were added to the group or supergroup and information about them (the bot itself may be one of these members)
  • left_chat_member (optional): Optional. A member was removed from the group, information about them (this member may be the bot itself)
  • chat_owner_left (optional): Optional. Service message: chat owner has left
  • chat_owner_changed (optional): Optional. Service message: chat owner has changed
  • new_chat_title (optional): Optional. A chat title was changed to this value
  • new_chat_photo (optional): Optional. A chat photo was change to this value
  • delete_chat_photo (optional): Optional. Service message: the chat photo was deleted
  • group_chat_created (optional): Optional. Service message: the group has been created
  • supergroup_chat_created (optional): Optional. Service message: the supergroup has been created. This field can't be received in a message coming through updates, because bot can't be a member of a supergroup when it is created. It can only be found in reply_to_message if someone replies to a very first message in a directly created supergroup.
  • channel_chat_created (optional): Optional. Service message: the channel has been created. This field can't be received in a message coming through updates, because bot can't be a member of a channel when it is created. It can only be found in reply_to_message if someone replies to a very first message in a channel.
  • message_auto_delete_timer_changed (optional): Optional. Service message: auto-delete timer settings changed in the chat
  • migrate_to_chat_id (optional): Optional. The group has been migrated to a supergroup with the specified identifier. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this identifier.
  • migrate_from_chat_id (optional): Optional. The supergroup has been migrated from a group with the specified identifier. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this identifier.
  • pinned_message (optional): Optional. Specified message was pinned. Note that the Message object in this field will not contain further reply_to_message fields even if it itself is a reply.
  • invoice (optional): Optional. Message is an invoice for a payment, information about the invoice. More about payments »
  • successful_payment (optional): Optional. Message is a service message about a successful payment, information about the payment. More about payments »
  • refunded_payment (optional): Optional. Message is a service message about a refunded payment, information about the payment. More about payments »
  • users_shared (optional): Optional. Service message: users were shared with the bot
  • chat_shared (optional): Optional. Service message: a chat was shared with the bot
  • gift (optional): Optional. Service message: a regular gift was sent or received
  • unique_gift (optional): Optional. Service message: a unique gift was sent or received
  • gift_upgrade_sent (optional): Optional. Service message: upgrade of a gift was purchased after the gift was sent
  • connected_website (optional): Optional. The domain name of the website on which the user has logged in. More about Telegram Login »
  • write_access_allowed (optional): Optional. Service message: the user allowed the bot to write messages after adding it to the attachment or side menu, launching a Web App from a link, or accepting an explicit request from a Web App sent by the method requestWriteAccess
  • passport_data (optional): Optional. Telegram Passport data
  • proximity_alert_triggered (optional): Optional. Service message. A user in the chat triggered another user's proximity alert while sharing Live Location.
  • boost_added (optional): Optional. Service message: user boosted the chat
  • chat_background_set (optional): Optional. Service message: chat background set
  • checklist_tasks_done (optional): Optional. Service message: some tasks in a checklist were marked as done or not done
  • checklist_tasks_added (optional): Optional. Service message: tasks were added to a checklist
  • direct_message_price_changed (optional): Optional. Service message: the price for paid messages in the corresponding direct messages chat of a channel has changed
  • forum_topic_created (optional): Optional. Service message: forum topic created
  • forum_topic_edited (optional): Optional. Service message: forum topic edited
  • forum_topic_closed (optional): Optional. Service message: forum topic closed
  • forum_topic_reopened (optional): Optional. Service message: forum topic reopened
  • general_forum_topic_hidden (optional): Optional. Service message: the 'General' forum topic hidden
  • general_forum_topic_unhidden (optional): Optional. Service message: the 'General' forum topic unhidden
  • giveaway_created (optional): Optional. Service message: a scheduled giveaway was created
  • giveaway (optional): Optional. The message is a scheduled giveaway message
  • giveaway_winners (optional): Optional. A giveaway with public winners was completed
  • giveaway_completed (optional): Optional. Service message: a giveaway without public winners was completed
  • paid_message_price_changed (optional): Optional. Service message: the price for paid messages has changed in the chat
  • suggested_post_approved (optional): Optional. Service message: a suggested post was approved
  • suggested_post_approval_failed (optional): Optional. Service message: approval of a suggested post has failed
  • suggested_post_declined (optional): Optional. Service message: a suggested post was declined
  • suggested_post_paid (optional): Optional. Service message: payment for a suggested post was received
  • suggested_post_refunded (optional): Optional. Service message: payment for a suggested post was refunded
  • video_chat_scheduled (optional): Optional. Service message: video chat scheduled
  • video_chat_started (optional): Optional. Service message: video chat started
  • video_chat_ended (optional): Optional. Service message: video chat ended
  • video_chat_participants_invited (optional): Optional. Service message: new participants invited to a video chat
  • web_app_data (optional): Optional. Service message: data sent by a Web App
  • reply_markup (optional): Optional. Inline keyboard attached to the message. login_url buttons are represented as ordinary url buttons.

Summary

Types

t()

@type t() :: %ExGram.Model.Message{
  animation: ExGram.Model.Animation.t() | nil,
  audio: ExGram.Model.Audio.t() | nil,
  author_signature: String.t() | nil,
  boost_added: ExGram.Model.ChatBoostAdded.t() | nil,
  business_connection_id: String.t() | nil,
  caption: String.t() | nil,
  caption_entities: [ExGram.Model.MessageEntity.t()] | nil,
  channel_chat_created: boolean() | nil,
  chat: ExGram.Model.Chat.t(),
  chat_background_set: ExGram.Model.ChatBackground.t() | nil,
  chat_owner_changed: ExGram.Model.ChatOwnerChanged.t() | nil,
  chat_owner_left: ExGram.Model.ChatOwnerLeft.t() | nil,
  chat_shared: ExGram.Model.ChatShared.t() | nil,
  checklist: ExGram.Model.Checklist.t() | nil,
  checklist_tasks_added: ExGram.Model.ChecklistTasksAdded.t() | nil,
  checklist_tasks_done: ExGram.Model.ChecklistTasksDone.t() | nil,
  connected_website: String.t() | nil,
  contact: ExGram.Model.Contact.t() | nil,
  date: integer(),
  delete_chat_photo: boolean() | nil,
  dice: ExGram.Model.Dice.t() | nil,
  direct_message_price_changed:
    ExGram.Model.DirectMessagePriceChanged.t() | nil,
  direct_messages_topic: ExGram.Model.DirectMessagesTopic.t() | nil,
  document: ExGram.Model.Document.t() | nil,
  edit_date: integer() | nil,
  effect_id: String.t() | nil,
  entities: [ExGram.Model.MessageEntity.t()] | nil,
  external_reply: ExGram.Model.ExternalReplyInfo.t() | nil,
  forum_topic_closed: ExGram.Model.ForumTopicClosed.t() | nil,
  forum_topic_created: ExGram.Model.ForumTopicCreated.t() | nil,
  forum_topic_edited: ExGram.Model.ForumTopicEdited.t() | nil,
  forum_topic_reopened: ExGram.Model.ForumTopicReopened.t() | nil,
  forward_origin: ExGram.Model.MessageOrigin.t() | nil,
  from: ExGram.Model.User.t() | nil,
  game: ExGram.Model.Game.t() | nil,
  general_forum_topic_hidden: ExGram.Model.GeneralForumTopicHidden.t() | nil,
  general_forum_topic_unhidden:
    ExGram.Model.GeneralForumTopicUnhidden.t() | nil,
  gift: ExGram.Model.GiftInfo.t() | nil,
  gift_upgrade_sent: ExGram.Model.GiftInfo.t() | nil,
  giveaway: ExGram.Model.Giveaway.t() | nil,
  giveaway_completed: ExGram.Model.GiveawayCompleted.t() | nil,
  giveaway_created: ExGram.Model.GiveawayCreated.t() | nil,
  giveaway_winners: ExGram.Model.GiveawayWinners.t() | nil,
  group_chat_created: boolean() | nil,
  has_media_spoiler: boolean() | nil,
  has_protected_content: boolean() | nil,
  invoice: ExGram.Model.Invoice.t() | nil,
  is_automatic_forward: boolean() | nil,
  is_from_offline: boolean() | nil,
  is_paid_post: boolean() | nil,
  is_topic_message: boolean() | nil,
  left_chat_member: ExGram.Model.User.t() | nil,
  link_preview_options: ExGram.Model.LinkPreviewOptions.t() | nil,
  location: ExGram.Model.Location.t() | nil,
  media_group_id: String.t() | nil,
  message_auto_delete_timer_changed:
    ExGram.Model.MessageAutoDeleteTimerChanged.t() | nil,
  message_id: integer(),
  message_thread_id: integer() | nil,
  migrate_from_chat_id: integer() | nil,
  migrate_to_chat_id: integer() | nil,
  new_chat_members: [ExGram.Model.User.t()] | nil,
  new_chat_photo: [ExGram.Model.PhotoSize.t()] | nil,
  new_chat_title: String.t() | nil,
  paid_media: ExGram.Model.PaidMediaInfo.t() | nil,
  paid_message_price_changed: ExGram.Model.PaidMessagePriceChanged.t() | nil,
  paid_star_count: integer() | nil,
  passport_data: ExGram.Model.PassportData.t() | nil,
  photo: [ExGram.Model.PhotoSize.t()] | nil,
  pinned_message: ExGram.Model.MaybeInaccessibleMessage.t() | nil,
  poll: ExGram.Model.Poll.t() | nil,
  proximity_alert_triggered: ExGram.Model.ProximityAlertTriggered.t() | nil,
  quote: ExGram.Model.TextQuote.t() | nil,
  refunded_payment: ExGram.Model.RefundedPayment.t() | nil,
  reply_markup: ExGram.Model.InlineKeyboardMarkup.t() | nil,
  reply_to_checklist_task_id: integer() | nil,
  reply_to_message: t() | nil,
  reply_to_story: ExGram.Model.Story.t() | nil,
  sender_boost_count: integer() | nil,
  sender_business_bot: ExGram.Model.User.t() | nil,
  sender_chat: ExGram.Model.Chat.t() | nil,
  sender_tag: String.t() | nil,
  show_caption_above_media: boolean() | nil,
  sticker: ExGram.Model.Sticker.t() | nil,
  story: ExGram.Model.Story.t() | nil,
  successful_payment: ExGram.Model.SuccessfulPayment.t() | nil,
  suggested_post_approval_failed:
    ExGram.Model.SuggestedPostApprovalFailed.t() | nil,
  suggested_post_approved: ExGram.Model.SuggestedPostApproved.t() | nil,
  suggested_post_declined: ExGram.Model.SuggestedPostDeclined.t() | nil,
  suggested_post_info: ExGram.Model.SuggestedPostInfo.t() | nil,
  suggested_post_paid: ExGram.Model.SuggestedPostPaid.t() | nil,
  suggested_post_refunded: ExGram.Model.SuggestedPostRefunded.t() | nil,
  supergroup_chat_created: boolean() | nil,
  text: String.t() | nil,
  unique_gift: ExGram.Model.UniqueGiftInfo.t() | nil,
  users_shared: ExGram.Model.UsersShared.t() | nil,
  venue: ExGram.Model.Venue.t() | nil,
  via_bot: ExGram.Model.User.t() | nil,
  video: ExGram.Model.Video.t() | nil,
  video_chat_ended: ExGram.Model.VideoChatEnded.t() | nil,
  video_chat_participants_invited:
    ExGram.Model.VideoChatParticipantsInvited.t() | nil,
  video_chat_scheduled: ExGram.Model.VideoChatScheduled.t() | nil,
  video_chat_started: ExGram.Model.VideoChatStarted.t() | nil,
  video_note: ExGram.Model.VideoNote.t() | nil,
  voice: ExGram.Model.Voice.t() | nil,
  web_app_data: ExGram.Model.WebAppData.t() | nil,
  write_access_allowed: ExGram.Model.WriteAccessAllowed.t() | nil
}

Functions

decode_as()