Module TelegramApi.Message

module Message: sig .. end

type message = {
   message_id : int;
   from : TelegramApi.User.user option;
   date : int;
   chat : TelegramApi.Chat.chat;
   forward_from : TelegramApi.User.user option;
   forward_from_chat : TelegramApi.Chat.chat option;
   forward_date : int option;
   reply_to_message : message option;
   edit_date : int option;
   text : string option;
   entities : TelegramApi.MessageEntity.message_entity list option;
   audio : TelegramApi.Audio.audio option;
   document : TelegramApi.Document.document option;
   photo : TelegramApi.PhotoSize.photo_size list option;
   sticker : TelegramApi.Sticker.sticker option;
   video : TelegramApi.Video.video option;
   voice : TelegramApi.Voice.voice option;
   caption : string option;
   contact : TelegramApi.Contact.contact option;
   location : TelegramApi.Location.location option;
   venue : TelegramApi.Venue.venue option;
   new_chat_member : TelegramApi.User.user option;
   left_chat_member : TelegramApi.User.user option;
   new_chat_title : string option;
   new_chat_photo : TelegramApi.PhotoSize.photo_size list option;
   delete_chat_photo : bool option;
   group_chat_created : bool option;
   supergroup_chat_created : bool option;
   channel_chat_created : bool option;
   migrate_to_chat_id : int option;
   migrate_from_chat_id : int option;
   pinned_message : message option;
}
Represents a message in a chat. Note that photo should be a list of PhotoSize.photo_sizes if it exists
val create : message_id:int ->
?from:TelegramApi.User.user option ->
date:int ->
chat:TelegramApi.Chat.chat ->
?forward_from:TelegramApi.User.user option ->
?forward_from_chat:TelegramApi.Chat.chat option ->
?forward_date:int option ->
?reply_to:message option ->
?edit_date:int option ->
?text:string option ->
?entities:TelegramApi.MessageEntity.message_entity list option ->
?audio:TelegramApi.Audio.audio option ->
?document:TelegramApi.Document.document option ->
?photo:TelegramApi.PhotoSize.photo_size list option ->
?sticker:TelegramApi.Sticker.sticker option ->
?video:TelegramApi.Video.video option ->
?voice:TelegramApi.Voice.voice option ->
?caption:string option ->
?contact:TelegramApi.Contact.contact option ->
?location:TelegramApi.Location.location option ->
?venue:TelegramApi.Venue.venue option ->
?new_chat_member:TelegramApi.User.user option ->
?left_chat_member:TelegramApi.User.user option ->
?new_chat_title:string option ->
?new_chat_photo:TelegramApi.PhotoSize.photo_size list option ->
?delete_chat_photo:bool option ->
?group_chat_created:bool option ->
?supergroup_chat_created:bool option ->
?channel_chat_created:bool option ->
?migrate_to_chat_id:int option ->
?migrate_from_chat_id:int option ->
?pinned_message:message option ->
unit -> message
Create a message in a concise manner

Read a message out of some JSON

val read : Yojson.Safe.json -> message
val get_sender_first_name : message -> string
Get the first name of the user who sent the message

Get the username of the user who sent the message

val get_sender_username : message -> string
Get a formatted name for the user who sent the message: first name, with the username in parentheses if it exists
val get_sender : message -> string