package telegraml

  1. Overview
  2. Docs
type message = {
  1. message_id : int;
  2. from : User.user option;
  3. date : int;
  4. chat : Chat.chat;
  5. forward_from : User.user option;
  6. forward_from_chat : Chat.chat option;
  7. forward_date : int option;
  8. reply_to_message : message option;
  9. edit_date : int option;
  10. text : string option;
  11. entities : MessageEntity.message_entity list option;
  12. audio : Audio.audio option;
  13. document : Document.document option;
  14. photo : PhotoSize.photo_size list option;
  15. sticker : Sticker.sticker option;
  16. video : Video.video option;
  17. voice : Voice.voice option;
  18. caption : string option;
  19. contact : Contact.contact option;
  20. location : Location.location option;
  21. venue : Venue.venue option;
  22. new_chat_member : User.user option;
  23. left_chat_member : User.user option;
  24. new_chat_title : string option;
  25. new_chat_photo : PhotoSize.photo_size list option;
  26. delete_chat_photo : bool option;
  27. group_chat_created : bool option;
  28. supergroup_chat_created : bool option;
  29. channel_chat_created : bool option;
  30. migrate_to_chat_id : int option;
  31. migrate_from_chat_id : int option;
  32. 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:User.user option -> date:int -> chat:Chat.chat -> ?forward_from:User.user option -> ?forward_from_chat:Chat.chat option -> ?forward_date:int option -> ?reply_to:message option -> ?edit_date:int option -> ?text:string option -> ?entities:MessageEntity.message_entity list option -> ?audio:Audio.audio option -> ?document:Document.document option -> ?photo:PhotoSize.photo_size list option -> ?sticker:Sticker.sticker option -> ?video:Video.video option -> ?voice:Voice.voice option -> ?caption:string option -> ?contact:Contact.contact option -> ?location:Location.location option -> ?venue:Venue.venue option -> ?new_chat_member:User.user option -> ?left_chat_member:User.user option -> ?new_chat_title:string option -> ?new_chat_photo: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

Read a message out of some JSON

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 the username of the user who sent the message

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

Get a formatted name for the user who sent the message: first name, with the username in parentheses if it exists

OCaml

Innovation. Community. Security.