sig
exception ApiException of string
module ParseMode :
sig
type parse_mode = Markdown | Html
val string_of_parse_mode : TelegramApi.ParseMode.parse_mode -> string
end
module User :
sig
type user = {
id : int;
first_name : string;
last_name : string option;
username : string option;
}
val create :
id:int ->
first_name:string ->
?last_name:string option ->
?username:string option -> unit -> TelegramApi.User.user
val read : Yojson.Safe.json -> TelegramApi.User.user
end
module Chat :
sig
type chat_type = Private | Group | Supergroup | Channel
val read_type : string -> TelegramApi.Chat.chat_type
type chat = {
id : int;
chat_type : TelegramApi.Chat.chat_type;
title : string option;
username : string option;
first_name : string option;
last_name : string option;
}
val create :
id:int ->
chat_type:TelegramApi.Chat.chat_type ->
?title:string option ->
?username:string option ->
?first_name:string option ->
?last_name:string option -> unit -> TelegramApi.Chat.chat
val read : Yojson.Safe.json -> TelegramApi.Chat.chat
end
module InputFile :
sig
val load : string -> string Lwt.t
val multipart_body :
(string * string) list ->
string * string * string -> string -> string Lwt.t
end
module MessageEntity :
sig
type entity_type =
Mention
| Hashtag
| BotCommand
| Url
| Email
| Bold
| Italic
| Code
| Pre
| TextLink of string
| TextMention of TelegramApi.User.user
val entity_type_of_string :
string option ->
TelegramApi.User.user option ->
string -> TelegramApi.MessageEntity.entity_type
type message_entity = {
entity_type : TelegramApi.MessageEntity.entity_type;
offset : int;
length : int;
}
val create :
entity_type:TelegramApi.MessageEntity.entity_type ->
offset:int ->
length:int -> unit -> TelegramApi.MessageEntity.message_entity
val read : Yojson.Safe.json -> TelegramApi.MessageEntity.message_entity
end
module KeyboardButton :
sig
type keyboard_button = {
text : string;
request_contact : bool option;
request_location : bool option;
}
val create :
text:string ->
?request_contact:bool option ->
?request_location:bool option ->
unit -> TelegramApi.KeyboardButton.keyboard_button
val prepare :
TelegramApi.KeyboardButton.keyboard_button -> Yojson.Safe.json
end
module InlineKeyboardButton :
sig
type inline_keyboard_button = {
text : string;
url : string option;
callback_data : string option;
switch_inline_query : string option;
}
val create :
text:string ->
?url:string option ->
?callback_data:string option ->
?switch_inline_query:string option ->
unit -> TelegramApi.InlineKeyboardButton.inline_keyboard_button
val prepare :
TelegramApi.InlineKeyboardButton.inline_keyboard_button ->
Yojson.Safe.json
end
module ReplyMarkup :
sig
type reply_keyboard_markup = {
keyboard : TelegramApi.KeyboardButton.keyboard_button list list;
resize_keyboard : bool option;
one_time_keyboard : bool option;
selective : bool option;
}
type inline_keyboard_markup = {
inline_keyboard :
TelegramApi.InlineKeyboardButton.inline_keyboard_button list list;
}
type reply_keyboard_hide = { selective : bool option; }
type force_reply = { selective : bool option; }
type reply_markup =
ReplyKeyboardMarkup of
TelegramApi.ReplyMarkup.reply_keyboard_markup
| InlineKeyboardMarkup of
TelegramApi.ReplyMarkup.inline_keyboard_markup
| ReplyKeyboardHide of TelegramApi.ReplyMarkup.reply_keyboard_hide
| ForceReply of TelegramApi.ReplyMarkup.force_reply
val prepare : TelegramApi.ReplyMarkup.reply_markup -> Yojson.Safe.json
val create_reply_keyboard_markup :
keyboard:TelegramApi.KeyboardButton.keyboard_button list list ->
?resize_keyboard:bool option ->
?one_time_keyboard:bool option ->
?selective:bool option ->
unit -> TelegramApi.ReplyMarkup.reply_markup
val create_inline_keyboard_markup :
inline_keyboard:TelegramApi.InlineKeyboardButton.inline_keyboard_button
list list ->
unit -> TelegramApi.ReplyMarkup.reply_markup
val create_reply_keyboard_hide :
?selective:bool option ->
unit -> TelegramApi.ReplyMarkup.reply_markup
val create_force_reply :
?selective:bool option ->
unit -> TelegramApi.ReplyMarkup.reply_markup
end
module PhotoSize :
sig
type photo_size = {
file_id : string;
width : int;
height : int;
file_size : int option;
}
val create :
file_id:string ->
width:int ->
height:int ->
?file_size:int option -> unit -> TelegramApi.PhotoSize.photo_size
val read : Yojson.Safe.json -> TelegramApi.PhotoSize.photo_size
module Out :
sig
type photo_size = {
chat_id : int;
photo : string;
caption : string option;
disable_notification : bool;
reply_to_message_id : int option;
reply_markup : TelegramApi.ReplyMarkup.reply_markup option;
}
val create :
chat_id:int ->
photo:string ->
?caption:string option ->
?disable_notification:bool ->
?reply_to:int option ->
?reply_markup:TelegramApi.ReplyMarkup.reply_markup option ->
unit -> TelegramApi.PhotoSize.Out.photo_size
val prepare : TelegramApi.PhotoSize.Out.photo_size -> string
val prepare_multipart :
TelegramApi.PhotoSize.Out.photo_size -> string -> string Lwt.t
end
end
module Audio :
sig
type audio = {
file_id : string;
duration : int;
performer : string option;
title : string option;
mime_type : string option;
file_size : int option;
}
val create :
file_id:string ->
duration:int ->
?performer:string option ->
?title:string option ->
?mime_type:string option ->
?file_size:int option -> unit -> TelegramApi.Audio.audio
val read : Yojson.Safe.json -> TelegramApi.Audio.audio
module Out :
sig
type audio = {
chat_id : int;
audio : string;
duration : int option;
performer : string;
title : string;
disable_notification : bool;
reply_to_message_id : int option;
reply_markup : TelegramApi.ReplyMarkup.reply_markup option;
}
val create :
chat_id:int ->
audio:string ->
?duration:int option ->
performer:string ->
title:string ->
?disable_notification:bool ->
?reply_to:int option ->
?reply_markup:TelegramApi.ReplyMarkup.reply_markup option ->
unit -> TelegramApi.Audio.Out.audio
val prepare : TelegramApi.Audio.Out.audio -> string
val prepare_multipart :
TelegramApi.Audio.Out.audio -> string -> string Lwt.t
end
end
module Document :
sig
type document = {
file_id : string;
thumb : TelegramApi.PhotoSize.photo_size option;
file_name : string option;
mime_type : string option;
file_size : int option;
}
val create :
file_id:string ->
?thumb:TelegramApi.PhotoSize.photo_size option ->
?file_name:string option ->
?mime_type:string option ->
?file_size:int option -> unit -> TelegramApi.Document.document
val read : Yojson.Safe.json -> TelegramApi.Document.document
module Out :
sig
type document = {
chat_id : int;
document : string;
disable_notification : bool;
reply_to_message_id : int option;
reply_markup : TelegramApi.ReplyMarkup.reply_markup option;
}
val create :
chat_id:int ->
document:string ->
?disable_notification:bool ->
?reply_to:int option ->
?reply_markup:TelegramApi.ReplyMarkup.reply_markup option ->
unit -> TelegramApi.Document.Out.document
val prepare : TelegramApi.Document.Out.document -> string
val prepare_multipart :
TelegramApi.Document.Out.document -> string -> string Lwt.t
end
end
module Sticker :
sig
type sticker = {
file_id : string;
width : int;
height : int;
thumb : TelegramApi.PhotoSize.photo_size option;
emoji : string option;
file_size : int option;
}
val create :
file_id:string ->
width:int ->
height:int ->
?thumb:TelegramApi.PhotoSize.photo_size option ->
?emoji:string option ->
?file_size:int option -> unit -> TelegramApi.Sticker.sticker
val read : Yojson.Safe.json -> TelegramApi.Sticker.sticker
module Out :
sig
type sticker = {
chat_id : int;
sticker : string;
disable_notification : bool;
reply_to_message_id : int option;
reply_markup : TelegramApi.ReplyMarkup.reply_markup option;
}
val create :
chat_id:int ->
sticker:string ->
?disable_notification:bool ->
?reply_to:int option ->
?reply_markup:TelegramApi.ReplyMarkup.reply_markup option ->
unit -> TelegramApi.Sticker.Out.sticker
val prepare : TelegramApi.Sticker.Out.sticker -> string
val prepare_multipart :
TelegramApi.Sticker.Out.sticker -> string -> string Lwt.t
end
end
module Video :
sig
type video = {
file_id : string;
width : int;
height : int;
duration : int;
thumb : TelegramApi.PhotoSize.photo_size option;
mime_type : string option;
file_size : int option;
}
val create :
file_id:string ->
width:int ->
height:int ->
duration:int ->
?thumb:TelegramApi.PhotoSize.photo_size option ->
?mime_type:string option ->
?file_size:int option -> unit -> TelegramApi.Video.video
val read : Yojson.Safe.json -> TelegramApi.Video.video
module Out :
sig
type video = {
chat_id : int;
video : string;
duration : int option;
caption : string option;
disable_notification : bool;
reply_to_message_id : int option;
reply_markup : TelegramApi.ReplyMarkup.reply_markup option;
}
val create :
chat_id:int ->
video:string ->
?duration:int option ->
?caption:string option ->
?disable_notification:bool ->
?reply_to:int option ->
?reply_markup:TelegramApi.ReplyMarkup.reply_markup option ->
unit -> TelegramApi.Video.Out.video
val prepare : TelegramApi.Video.Out.video -> string
val prepare_multipart :
TelegramApi.Video.Out.video -> string -> string Lwt.t
end
end
module Voice :
sig
type voice = {
file_id : string;
duration : int;
mime_type : string option;
file_size : int option;
}
val create :
file_id:string ->
duration:int ->
?mime_type:string option ->
?file_size:int option -> unit -> TelegramApi.Voice.voice
val read : Yojson.Safe.json -> TelegramApi.Voice.voice
module Out :
sig
type voice = {
chat_id : int;
voice : string;
duration : int option;
disable_notification : bool;
reply_to_message_id : int option;
reply_markup : TelegramApi.ReplyMarkup.reply_markup option;
}
val create :
chat_id:int ->
voice:string ->
?duration:int option ->
?disable_notification:bool ->
?reply_to:int option ->
?reply_markup:TelegramApi.ReplyMarkup.reply_markup option ->
unit -> TelegramApi.Voice.Out.voice
val prepare : TelegramApi.Voice.Out.voice -> string
val prepare_multipart :
TelegramApi.Voice.Out.voice -> string -> string Lwt.t
end
end
module Contact :
sig
type contact = {
phone_number : string;
first_name : string;
last_name : string option;
user_id : int option;
}
val create :
phone_number:string ->
first_name:string ->
?last_name:string option ->
?user_id:int option -> unit -> TelegramApi.Contact.contact
val read : Yojson.Safe.json -> TelegramApi.Contact.contact
module Out :
sig
type contact = {
chat_id : int;
phone_number : string;
first_name : string;
last_name : string option;
disable_notification : bool;
reply_to_message_id : int option;
reply_markup : TelegramApi.ReplyMarkup.reply_markup option;
}
val create :
chat_id:int ->
phone_number:string ->
first_name:string ->
?last_name:string option ->
?disable_notification:bool ->
?reply_to:int option ->
?reply_markup:TelegramApi.ReplyMarkup.reply_markup option ->
unit -> TelegramApi.Contact.Out.contact
val prepare : TelegramApi.Contact.Out.contact -> string
end
end
module Location :
sig
type location = { longitude : float; latitude : float; }
val create :
longitude:float ->
latitude:float -> unit -> TelegramApi.Location.location
val read : Yojson.Safe.json -> TelegramApi.Location.location
module Out :
sig
type location = {
chat_id : int;
latitude : float;
longitude : float;
disable_notification : bool;
reply_to_message_id : int option;
reply_markup : TelegramApi.ReplyMarkup.reply_markup option;
}
val create :
chat_id:int ->
latitude:float ->
longitude:float ->
?disable_notification:bool ->
?reply_to:int option ->
?reply_markup:TelegramApi.ReplyMarkup.reply_markup option ->
unit -> TelegramApi.Location.Out.location
val prepare : TelegramApi.Location.Out.location -> string
end
end
module Venue :
sig
type venue = {
location : TelegramApi.Location.location;
title : string;
address : string;
foursquare_id : string option;
}
val create :
location:TelegramApi.Location.location ->
title:string ->
address:string ->
?foursquare_id:string option -> unit -> TelegramApi.Venue.venue
val read : Yojson.Safe.json -> TelegramApi.Venue.venue
module Out :
sig
type venue = {
chat_id : int;
latitude : float;
longitude : float;
title : string;
address : string;
foursquare_id : string option;
disable_notification : bool;
reply_to_message_id : int option;
reply_markup : TelegramApi.ReplyMarkup.reply_markup option;
}
val create :
chat_id:int ->
latitude:float ->
longitude:float ->
title:string ->
address:string ->
?foursquare_id:string option ->
?disable_notification:bool ->
reply_to:int option ->
reply_markup:TelegramApi.ReplyMarkup.reply_markup option ->
unit -> TelegramApi.Venue.Out.venue
val prepare : TelegramApi.Venue.Out.venue -> string
end
end
module UserProfilePhotos :
sig
type user_profile_photos = {
total_count : int;
photos : TelegramApi.PhotoSize.photo_size list list;
}
val create :
total_count:int ->
photos:TelegramApi.PhotoSize.photo_size list list ->
unit -> TelegramApi.UserProfilePhotos.user_profile_photos
val read :
Yojson.Safe.json -> TelegramApi.UserProfilePhotos.user_profile_photos
end
module Message :
sig
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 : TelegramApi.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 : TelegramApi.Message.message option;
}
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:TelegramApi.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:TelegramApi.Message.message option ->
unit -> TelegramApi.Message.message
val read : Yojson.Safe.json -> TelegramApi.Message.message
val get_sender_first_name : TelegramApi.Message.message -> string
val get_sender_username : TelegramApi.Message.message -> string
val get_sender : TelegramApi.Message.message -> string
end
module File :
sig
type file = {
file_id : string;
file_size : int option;
file_path : string option;
}
val create :
file_id:string ->
?file_size:int option ->
?file_path:string option -> unit -> TelegramApi.File.file
val read : Yojson.Safe.json -> TelegramApi.File.file
val download : string -> TelegramApi.File.file -> string Lwt.t option
end
module CallbackQuery :
sig
type callback_query = {
id : string;
from : TelegramApi.User.user;
message : TelegramApi.Message.message option;
inline_message_id : string option;
data : string;
}
val create :
id:string ->
from:TelegramApi.User.user ->
?message:TelegramApi.Message.message option ->
?inline_message_id:string option ->
data:string -> unit -> TelegramApi.CallbackQuery.callback_query
val read : Yojson.Safe.json -> TelegramApi.CallbackQuery.callback_query
end
module ChatMember :
sig
type status = Creator | Administrator | Member | Left | Kicked
val status_of_string : string -> TelegramApi.ChatMember.status
type chat_member = {
user : TelegramApi.User.user;
status : TelegramApi.ChatMember.status;
}
val create :
user:TelegramApi.User.user ->
status:TelegramApi.ChatMember.status ->
unit -> TelegramApi.ChatMember.chat_member
val read : Yojson.Safe.json -> TelegramApi.ChatMember.chat_member
end
module InputMessageContent :
sig
type text = {
message_text : string;
parse_mode : TelegramApi.ParseMode.parse_mode option;
disable_web_page_preview : bool;
}
type location = { latitude : float; longitude : float; }
type venue = {
latitude : float;
longitude : float;
title : string;
address : string;
foursquare_id : string option;
}
type contact = {
phone_number : string;
first_name : string;
last_name : string option;
}
type input_message_content =
Text of TelegramApi.InputMessageContent.text
| Location of TelegramApi.InputMessageContent.location
| Venue of TelegramApi.InputMessageContent.venue
| Contact of TelegramApi.InputMessageContent.contact
val create_text :
message_text:string ->
?parse_mode:TelegramApi.ParseMode.parse_mode ->
?disable_web_page_preview:bool ->
unit -> TelegramApi.InputMessageContent.input_message_content
val create_location :
latitude:float ->
longitude:float ->
unit -> TelegramApi.InputMessageContent.input_message_content
val create_venue :
latitude:float ->
longitude:float ->
title:string ->
address:string ->
?foursquare_id:string ->
unit -> TelegramApi.InputMessageContent.input_message_content
val create_contact :
phone_number:string ->
first_name:string ->
?last_name:string ->
unit -> TelegramApi.InputMessageContent.input_message_content
val prepare :
TelegramApi.InputMessageContent.input_message_content ->
Yojson.Safe.json
end
module InlineQuery :
sig
type inline_query = {
id : string;
from : TelegramApi.User.user;
query : string;
offset : string;
}
val create :
id:string ->
from:TelegramApi.User.user ->
query:string ->
offset:string -> unit -> TelegramApi.InlineQuery.inline_query
val read : Yojson.Safe.json -> TelegramApi.InlineQuery.inline_query
type chosen_inline_result = {
result_id : string;
from : TelegramApi.User.user;
query : string;
}
val read_chosen_inline_result :
Yojson.Safe.json -> TelegramApi.InlineQuery.chosen_inline_result
module Out :
sig
type article = {
id : string;
title : string;
input_message_content :
TelegramApi.InputMessageContent.input_message_content;
reply_markup : TelegramApi.ReplyMarkup.reply_markup option;
url : string option;
hide_url : bool option;
description : string option;
thumb_url : string option;
thumb_width : int option;
thumb_height : int option;
}
type photo = {
id : string;
photo_url : string;
thumb_url : string;
photo_width : int option;
photo_height : int option;
title : string option;
description : string option;
caption : string option;
reply_markup : TelegramApi.ReplyMarkup.reply_markup option;
input_message_content :
TelegramApi.InputMessageContent.input_message_content option;
}
type gif = {
id : string;
gif_url : string;
gif_width : int option;
gif_height : int option;
thumb_url : string;
title : string option;
caption : string option;
reply_markup : TelegramApi.ReplyMarkup.reply_markup option;
input_message_content :
TelegramApi.InputMessageContent.input_message_content option;
}
type mpeg4gif = {
id : string;
mpeg4_url : string;
mpeg4_width : int option;
mpeg4_height : int option;
thumb_url : string;
title : string option;
caption : string option;
reply_markup : TelegramApi.ReplyMarkup.reply_markup option;
input_message_content :
TelegramApi.InputMessageContent.input_message_content option;
}
type video = {
id : string;
video_url : string;
mime_type : string;
thumb_url : string;
title : string;
caption : string option;
video_width : int option;
video_height : int option;
video_duration : int option;
description : string option;
reply_markup : TelegramApi.ReplyMarkup.reply_markup option;
input_message_content :
TelegramApi.InputMessageContent.input_message_content option;
}
type audio = {
id : string;
audio_url : string;
title : string;
performer : string option;
audio_duration : int option;
reply_markup : TelegramApi.ReplyMarkup.reply_markup option;
input_message_content :
TelegramApi.InputMessageContent.input_message_content option;
}
type voice = {
id : string;
voice_url : string;
title : string;
voice_duration : int option;
reply_markup : TelegramApi.ReplyMarkup.reply_markup option;
input_message_content :
TelegramApi.InputMessageContent.input_message_content option;
}
type document = {
id : string;
title : string;
caption : string option;
document_url : string;
mime_type : string;
description : string option;
reply_markup : TelegramApi.ReplyMarkup.reply_markup option;
input_message_content :
TelegramApi.InputMessageContent.input_message_content option;
thumb_url : string option;
thumb_width : int option;
thumb_height : int option;
}
type location = {
id : string;
latitude : float;
longitude : float;
title : string;
reply_markup : TelegramApi.ReplyMarkup.reply_markup option;
input_message_content :
TelegramApi.InputMessageContent.input_message_content option;
thumb_url : string option;
thumb_width : int option;
thumb_height : int option;
}
type venue = {
id : string;
latitude : float;
longitude : float;
title : string;
address : string;
foursquare_id : string option;
reply_markup : TelegramApi.ReplyMarkup.reply_markup option;
input_message_content :
TelegramApi.InputMessageContent.input_message_content option;
thumb_url : string option;
thumb_width : int option;
thumb_height : int option;
}
type contact = {
id : string;
phone_number : string;
first_name : string;
last_name : string option;
reply_markup : TelegramApi.ReplyMarkup.reply_markup option;
input_message_content :
TelegramApi.InputMessageContent.input_message_content option;
thumb_url : string option;
thumb_width : int option;
thumb_height : int option;
}
type cached_photo = {
id : string;
photo_file_id : string;
title : string option;
description : string option;
caption : string option;
reply_markup : TelegramApi.ReplyMarkup.reply_markup option;
input_message_content :
TelegramApi.InputMessageContent.input_message_content option;
}
type cached_gif = {
id : string;
gif_file_id : string;
title : string option;
caption : string option;
reply_markup : TelegramApi.ReplyMarkup.reply_markup option;
input_message_content :
TelegramApi.InputMessageContent.input_message_content option;
}
type cached_mpeg4gif = {
id : string;
mpeg4_file_id : string;
title : string option;
caption : string option;
reply_markup : TelegramApi.ReplyMarkup.reply_markup option;
input_message_content :
TelegramApi.InputMessageContent.input_message_content option;
}
type cached_sticker = {
id : string;
sticker_file_id : string;
reply_markup : TelegramApi.ReplyMarkup.reply_markup option;
input_message_content :
TelegramApi.InputMessageContent.input_message_content option;
}
type cached_document = {
id : string;
title : string;
document_file_id : string;
description : string option;
caption : string option;
reply_markup : TelegramApi.ReplyMarkup.reply_markup option;
input_message_content :
TelegramApi.InputMessageContent.input_message_content option;
}
type cached_video = {
id : string;
video_file_id : string;
title : string;
description : string option;
caption : string option;
reply_markup : TelegramApi.ReplyMarkup.reply_markup option;
input_message_content :
TelegramApi.InputMessageContent.input_message_content option;
}
type cached_voice = {
id : string;
voice_file_id : string;
title : string;
reply_markup : TelegramApi.ReplyMarkup.reply_markup option;
input_message_content :
TelegramApi.InputMessageContent.input_message_content option;
}
type cached_audio = {
id : string;
audio_file_id : string;
reply_markup : TelegramApi.ReplyMarkup.reply_markup option;
input_message_content :
TelegramApi.InputMessageContent.input_message_content option;
}
type inline_query_result =
Article of TelegramApi.InlineQuery.Out.article
| Photo of TelegramApi.InlineQuery.Out.photo
| Gif of TelegramApi.InlineQuery.Out.gif
| Mpeg4Gif of TelegramApi.InlineQuery.Out.mpeg4gif
| Video of TelegramApi.InlineQuery.Out.video
| Audio of TelegramApi.InlineQuery.Out.audio
| Voice of TelegramApi.InlineQuery.Out.voice
| Document of TelegramApi.InlineQuery.Out.document
| Location of TelegramApi.InlineQuery.Out.location
| Venue of TelegramApi.InlineQuery.Out.venue
| Contact of TelegramApi.InlineQuery.Out.contact
| CachedPhoto of TelegramApi.InlineQuery.Out.cached_photo
| CachedGif of TelegramApi.InlineQuery.Out.cached_gif
| CachedMpeg4Gif of TelegramApi.InlineQuery.Out.cached_mpeg4gif
| CachedSticker of TelegramApi.InlineQuery.Out.cached_sticker
| CachedDocument of TelegramApi.InlineQuery.Out.cached_document
| CachedVideo of TelegramApi.InlineQuery.Out.cached_video
| CachedVoice of TelegramApi.InlineQuery.Out.cached_voice
| CachedAudio of TelegramApi.InlineQuery.Out.cached_audio
val create_article :
id:string ->
title:string ->
input_message_content:TelegramApi.InputMessageContent.input_message_content ->
?reply_markup:TelegramApi.ReplyMarkup.reply_markup ->
?url:string ->
?hide_url:bool ->
?description:string ->
?thumb_url:string ->
?thumb_width:int ->
?thumb_height:int ->
unit -> TelegramApi.InlineQuery.Out.inline_query_result
val create_photo :
id:string ->
photo_url:string ->
thumb_url:string ->
?photo_width:int ->
?photo_height:int ->
?title:string ->
?description:string ->
?caption:string ->
?reply_markup:TelegramApi.ReplyMarkup.reply_markup ->
?input_message_content:TelegramApi.InputMessageContent.input_message_content ->
unit -> TelegramApi.InlineQuery.Out.inline_query_result
val create_gif :
id:string ->
gif_url:string ->
?gif_width:int ->
?gif_height:int ->
thumb_url:string ->
?title:string ->
?caption:string ->
?reply_markup:TelegramApi.ReplyMarkup.reply_markup ->
?input_message_content:TelegramApi.InputMessageContent.input_message_content ->
unit -> TelegramApi.InlineQuery.Out.inline_query_result
val create_mpeg4gif :
id:string ->
mpeg4_url:string ->
?mpeg4_width:int ->
?mpeg4_height:int ->
thumb_url:string ->
?title:string ->
?caption:string ->
?reply_markup:TelegramApi.ReplyMarkup.reply_markup ->
?input_message_content:TelegramApi.InputMessageContent.input_message_content ->
unit -> TelegramApi.InlineQuery.Out.inline_query_result
val create_video :
id:string ->
video_url:string ->
mime_type:string ->
thumb_url:string ->
title:string ->
?caption:string ->
?video_width:int ->
?video_height:int ->
?video_duration:int ->
?description:string ->
?reply_markup:TelegramApi.ReplyMarkup.reply_markup ->
?input_message_content:TelegramApi.InputMessageContent.input_message_content ->
unit -> TelegramApi.InlineQuery.Out.inline_query_result
val create_audio :
id:string ->
audio_url:string ->
title:string ->
?performer:string ->
?audio_duration:int ->
?reply_markup:TelegramApi.ReplyMarkup.reply_markup ->
?input_message_content:TelegramApi.InputMessageContent.input_message_content ->
unit -> TelegramApi.InlineQuery.Out.inline_query_result
val create_voice :
id:string ->
voice_url:string ->
title:string ->
?voice_duration:int ->
?reply_markup:TelegramApi.ReplyMarkup.reply_markup ->
?input_message_content:TelegramApi.InputMessageContent.input_message_content ->
unit -> TelegramApi.InlineQuery.Out.inline_query_result
val create_document :
id:string ->
title:string ->
?caption:string ->
document_url:string ->
mime_type:string ->
?description:string ->
?reply_markup:TelegramApi.ReplyMarkup.reply_markup ->
?input_message_content:TelegramApi.InputMessageContent.input_message_content ->
?thumb_url:string ->
?thumb_width:int ->
?thumb_height:int ->
unit -> TelegramApi.InlineQuery.Out.inline_query_result
val create_location :
id:string ->
latitude:float ->
longitude:float ->
title:string ->
?reply_markup:TelegramApi.ReplyMarkup.reply_markup ->
?input_message_content:TelegramApi.InputMessageContent.input_message_content ->
?thumb_url:string ->
?thumb_width:int ->
?thumb_height:int ->
unit -> TelegramApi.InlineQuery.Out.inline_query_result
val create_venue :
id:string ->
latitude:float ->
longitude:float ->
title:string ->
address:string ->
?foursquare_id:string ->
?reply_markup:TelegramApi.ReplyMarkup.reply_markup ->
?input_message_content:TelegramApi.InputMessageContent.input_message_content ->
?thumb_url:string ->
?thumb_width:int ->
?thumb_height:int ->
unit -> TelegramApi.InlineQuery.Out.inline_query_result
val create_contact :
id:string ->
phone_number:string ->
first_name:string ->
?last_name:string ->
?reply_markup:TelegramApi.ReplyMarkup.reply_markup ->
?input_message_content:TelegramApi.InputMessageContent.input_message_content ->
?thumb_url:string ->
?thumb_width:int ->
?thumb_height:int ->
unit -> TelegramApi.InlineQuery.Out.inline_query_result
val create_cached_photo :
id:string ->
photo_file_id:string ->
?title:string ->
?description:string ->
?caption:string ->
?reply_markup:TelegramApi.ReplyMarkup.reply_markup ->
?input_message_content:TelegramApi.InputMessageContent.input_message_content ->
unit -> TelegramApi.InlineQuery.Out.inline_query_result
val create_cached_gif :
id:string ->
gif_file_id:string ->
?title:string ->
?caption:string ->
?reply_markup:TelegramApi.ReplyMarkup.reply_markup ->
?input_message_content:TelegramApi.InputMessageContent.input_message_content ->
unit -> TelegramApi.InlineQuery.Out.inline_query_result
val create_cached_mpeg4gif :
id:string ->
mpeg4_file_id:string ->
?title:string ->
?caption:string ->
?reply_markup:TelegramApi.ReplyMarkup.reply_markup ->
?input_message_content:TelegramApi.InputMessageContent.input_message_content ->
unit -> TelegramApi.InlineQuery.Out.inline_query_result
val create_cached_sticker :
id:string ->
sticker_file_id:string ->
?reply_markup:TelegramApi.ReplyMarkup.reply_markup ->
?input_message_content:TelegramApi.InputMessageContent.input_message_content ->
unit -> TelegramApi.InlineQuery.Out.inline_query_result
val create_cached_document :
id:string ->
title:string ->
document_file_id:string ->
?description:string ->
?caption:string ->
?reply_markup:TelegramApi.ReplyMarkup.reply_markup ->
?input_message_content:TelegramApi.InputMessageContent.input_message_content ->
unit -> TelegramApi.InlineQuery.Out.inline_query_result
val create_cached_video :
id:string ->
video_file_id:string ->
title:string ->
?description:string ->
?caption:string ->
?reply_markup:TelegramApi.ReplyMarkup.reply_markup ->
?input_message_content:TelegramApi.InputMessageContent.input_message_content ->
unit -> TelegramApi.InlineQuery.Out.inline_query_result
val create_cached_voice :
id:string ->
voice_file_id:string ->
title:string ->
?reply_markup:TelegramApi.ReplyMarkup.reply_markup ->
?input_message_content:TelegramApi.InputMessageContent.input_message_content ->
unit -> TelegramApi.InlineQuery.Out.inline_query_result
val create_cached_audio :
id:string ->
audio_file_id:string ->
?reply_markup:TelegramApi.ReplyMarkup.reply_markup ->
?input_message_content:TelegramApi.InputMessageContent.input_message_content ->
unit -> TelegramApi.InlineQuery.Out.inline_query_result
val prepare :
TelegramApi.InlineQuery.Out.inline_query_result ->
Yojson.Safe.json
end
end
module ChatAction :
sig
type action =
Typing
| UploadPhoto
| RecordVideo
| UploadVideo
| RecordAudio
| UploadAudio
| UploadDocument
| FindLocation
val to_string : TelegramApi.ChatAction.action -> string
end
module Update :
sig
type update =
Message of int * TelegramApi.Message.message
| EditedMessage of int * TelegramApi.Message.message
| InlineQuery of int * TelegramApi.InlineQuery.inline_query
| ChosenInlineResult of int *
TelegramApi.InlineQuery.chosen_inline_result
| CallbackQuery of int * TelegramApi.CallbackQuery.callback_query
val read : Yojson.Safe.json -> TelegramApi.Update.update
val get_id : TelegramApi.Update.update -> int
end
module Result :
sig
type 'a result = Success of 'a | Failure of string
val return : 'a -> 'a TelegramApi.Result.result
val default : 'a -> 'a TelegramApi.Result.result -> 'a
val ( >>= ) :
'a TelegramApi.Result.result ->
('a -> 'b TelegramApi.Result.result) -> 'b TelegramApi.Result.result
val ( <$> ) :
('a -> 'b) ->
'a TelegramApi.Result.result -> 'b TelegramApi.Result.result
end
module Command :
sig
type action =
Nothing
| GetMe of
(TelegramApi.User.user TelegramApi.Result.result ->
TelegramApi.Command.action)
| SendMessage of int * string * bool * int option *
TelegramApi.ReplyMarkup.reply_markup option
| ForwardMessage of int * int * bool * int
| SendChatAction of int * TelegramApi.ChatAction.action
| SendPhoto of int * string * string option * bool * int option *
TelegramApi.ReplyMarkup.reply_markup option *
(string TelegramApi.Result.result -> TelegramApi.Command.action)
| ResendPhoto of int * string * string option * bool * int option *
TelegramApi.ReplyMarkup.reply_markup option
| SendAudio of int * string * string * string * bool * int option *
TelegramApi.ReplyMarkup.reply_markup option *
(string TelegramApi.Result.result -> TelegramApi.Command.action)
| ResendAudio of int * string * string * string * bool * int option *
TelegramApi.ReplyMarkup.reply_markup option
| SendDocument of int * string * bool * int option *
TelegramApi.ReplyMarkup.reply_markup option *
(string TelegramApi.Result.result -> TelegramApi.Command.action)
| ResendDocument of int * string * bool * int option *
TelegramApi.ReplyMarkup.reply_markup option
| SendSticker of int * string * bool * int option *
TelegramApi.ReplyMarkup.reply_markup option *
(string TelegramApi.Result.result -> TelegramApi.Command.action)
| ResendSticker of int * string * bool * int option *
TelegramApi.ReplyMarkup.reply_markup option
| SendVideo of int * string * int option * string option * bool *
int option * TelegramApi.ReplyMarkup.reply_markup option *
(string TelegramApi.Result.result -> TelegramApi.Command.action)
| ResendVideo of int * string * int option * string option *
bool * int option * TelegramApi.ReplyMarkup.reply_markup option
| SendVoice of int * string * bool * int option *
TelegramApi.ReplyMarkup.reply_markup option *
(string TelegramApi.Result.result -> TelegramApi.Command.action)
| ResendVoice of int * string * bool * int option *
TelegramApi.ReplyMarkup.reply_markup option
| SendLocation of int * float * float * bool * int option *
TelegramApi.ReplyMarkup.reply_markup option
| SendVenue of int * float * float * string * string *
string option * bool * int option *
TelegramApi.ReplyMarkup.reply_markup option
| SendContact of int * string * string * string option * bool *
int option * TelegramApi.ReplyMarkup.reply_markup option
| GetUserProfilePhotos of int * int option * int option *
(TelegramApi.UserProfilePhotos.user_profile_photos
TelegramApi.Result.result -> TelegramApi.Command.action)
| GetFile of string *
(TelegramApi.File.file TelegramApi.Result.result ->
TelegramApi.Command.action)
| GetFile' of string * (string option -> TelegramApi.Command.action)
| DownloadFile of TelegramApi.File.file *
(string option -> TelegramApi.Command.action)
| KickChatMember of int * int
| LeaveChat of int
| UnbanChatMember of int * int
| GetChat of int *
(TelegramApi.Chat.chat TelegramApi.Result.result ->
TelegramApi.Command.action)
| GetChatAdministrators of int *
(TelegramApi.ChatMember.chat_member list
TelegramApi.Result.result -> TelegramApi.Command.action)
| GetChatMembersCount of int *
(int TelegramApi.Result.result -> TelegramApi.Command.action)
| GetChatMember of int * int *
(TelegramApi.ChatMember.chat_member TelegramApi.Result.result ->
TelegramApi.Command.action)
| AnswerCallbackQuery of string * string option * bool
| AnswerInlineQuery of string *
TelegramApi.InlineQuery.Out.inline_query_result list *
int option * bool option * string option
| EditMessageText of
[ `ChatMessageId of string * int | `InlineMessageId of string ] *
string * TelegramApi.ParseMode.parse_mode option * bool *
TelegramApi.ReplyMarkup.reply_markup option
| EditMessageCaption of
[ `ChatMessageId of string * int | `InlineMessageId of string ] *
string * TelegramApi.ReplyMarkup.reply_markup option
| EditMessageReplyMarkup of
[ `ChatMessageId of string * int | `InlineMessageId of string ] *
TelegramApi.ReplyMarkup.reply_markup option
| GetUpdates of
(TelegramApi.Update.update list TelegramApi.Result.result ->
TelegramApi.Command.action)
| PeekUpdate of
(TelegramApi.Update.update TelegramApi.Result.result ->
TelegramApi.Command.action)
| PopUpdate of
(TelegramApi.Update.update TelegramApi.Result.result ->
TelegramApi.Command.action)
| Chain of TelegramApi.Command.action * TelegramApi.Command.action
type command = {
name : string;
description : string;
mutable enabled : bool;
run : TelegramApi.Message.message -> TelegramApi.Command.action;
}
val is_command : TelegramApi.Update.update -> bool
val read_command :
string option ->
TelegramApi.Message.message ->
TelegramApi.Command.command list -> TelegramApi.Command.action
val read_update :
string option ->
TelegramApi.Update.update ->
TelegramApi.Command.command list -> TelegramApi.Command.action
val tokenize : string -> string list
val with_auth :
command:(TelegramApi.Message.message -> TelegramApi.Command.action) ->
TelegramApi.Message.message -> TelegramApi.Command.action
end
module type BOT =
sig
val token : string
val command_postfix : string option
val commands : TelegramApi.Command.command list
val inline :
TelegramApi.InlineQuery.inline_query -> TelegramApi.Command.action
val callback :
TelegramApi.CallbackQuery.callback_query ->
TelegramApi.Command.action
val new_chat_member :
TelegramApi.Chat.chat ->
TelegramApi.User.user -> TelegramApi.Command.action
val left_chat_member :
TelegramApi.Chat.chat ->
TelegramApi.User.user -> TelegramApi.Command.action
val new_chat_title :
TelegramApi.Chat.chat -> string -> TelegramApi.Command.action
val new_chat_photo :
TelegramApi.Chat.chat ->
TelegramApi.PhotoSize.photo_size list -> TelegramApi.Command.action
val delete_chat_photo :
TelegramApi.Chat.chat -> TelegramApi.Command.action
val group_chat_created :
TelegramApi.Chat.chat -> TelegramApi.Command.action
val supergroup_chat_created :
TelegramApi.Chat.chat -> TelegramApi.Command.action
val channel_chat_created :
TelegramApi.Chat.chat -> TelegramApi.Command.action
val migrate_to_chat_id :
TelegramApi.Chat.chat -> int -> TelegramApi.Command.action
val migrate_from_chat_id :
TelegramApi.Chat.chat -> int -> TelegramApi.Command.action
val pinned_message :
TelegramApi.Chat.chat ->
TelegramApi.Message.message -> TelegramApi.Command.action
end
module type TELEGRAM_BOT =
sig
val url : string
val commands : TelegramApi.Command.command list
val inline :
TelegramApi.InlineQuery.inline_query -> TelegramApi.Command.action
val callback :
TelegramApi.CallbackQuery.callback_query ->
TelegramApi.Command.action
val get_me : TelegramApi.User.user TelegramApi.Result.result Lwt.t
val send_message :
chat_id:int ->
text:string ->
?disable_notification:bool ->
reply_to:int option ->
reply_markup:TelegramApi.ReplyMarkup.reply_markup option ->
unit TelegramApi.Result.result Lwt.t
val forward_message :
chat_id:int ->
from_chat_id:int ->
?disable_notification:bool ->
message_id:int -> unit TelegramApi.Result.result Lwt.t
val send_chat_action :
chat_id:int ->
action:TelegramApi.ChatAction.action ->
unit TelegramApi.Result.result Lwt.t
val send_photo :
chat_id:int ->
photo:string ->
?caption:string option ->
?disable_notification:bool ->
reply_to:int option ->
reply_markup:TelegramApi.ReplyMarkup.reply_markup option ->
string TelegramApi.Result.result Lwt.t
val resend_photo :
chat_id:int ->
photo:string ->
?caption:string option ->
?disable_notification:bool ->
reply_to:int option ->
reply_markup:TelegramApi.ReplyMarkup.reply_markup option ->
unit TelegramApi.Result.result Lwt.t
val send_audio :
chat_id:int ->
audio:string ->
performer:string ->
title:string ->
?disable_notification:bool ->
reply_to:int option ->
reply_markup:TelegramApi.ReplyMarkup.reply_markup option ->
string TelegramApi.Result.result Lwt.t
val resend_audio :
chat_id:int ->
audio:string ->
performer:string ->
title:string ->
?disable_notification:bool ->
reply_to:int option ->
reply_markup:TelegramApi.ReplyMarkup.reply_markup option ->
unit TelegramApi.Result.result Lwt.t
val send_document :
chat_id:int ->
document:string ->
?disable_notification:bool ->
reply_to:int option ->
reply_markup:TelegramApi.ReplyMarkup.reply_markup option ->
string TelegramApi.Result.result Lwt.t
val resend_document :
chat_id:int ->
document:string ->
?disable_notification:bool ->
reply_to:int option ->
reply_markup:TelegramApi.ReplyMarkup.reply_markup option ->
unit TelegramApi.Result.result Lwt.t
val send_sticker :
chat_id:int ->
sticker:string ->
?disable_notification:bool ->
reply_to:int option ->
reply_markup:TelegramApi.ReplyMarkup.reply_markup option ->
string TelegramApi.Result.result Lwt.t
val resend_sticker :
chat_id:int ->
sticker:string ->
?disable_notification:bool ->
reply_to:int option ->
reply_markup:TelegramApi.ReplyMarkup.reply_markup option ->
unit TelegramApi.Result.result Lwt.t
val send_video :
chat_id:int ->
video:string ->
?duration:int option ->
?caption:string option ->
?disable_notification:bool ->
reply_to:int option ->
reply_markup:TelegramApi.ReplyMarkup.reply_markup option ->
string TelegramApi.Result.result Lwt.t
val resend_video :
chat_id:int ->
video:string ->
?duration:int option ->
?caption:string option ->
?disable_notification:bool ->
reply_to:int option ->
reply_markup:TelegramApi.ReplyMarkup.reply_markup option ->
unit TelegramApi.Result.result Lwt.t
val send_voice :
chat_id:int ->
voice:string ->
?disable_notification:bool ->
reply_to:int option ->
reply_markup:TelegramApi.ReplyMarkup.reply_markup option ->
string TelegramApi.Result.result Lwt.t
val resend_voice :
chat_id:int ->
voice:string ->
?disable_notification:bool ->
reply_to:int option ->
reply_markup:TelegramApi.ReplyMarkup.reply_markup option ->
unit TelegramApi.Result.result Lwt.t
val send_location :
chat_id:int ->
latitude:float ->
longitude:float ->
?disable_notification:bool ->
reply_to:int option ->
reply_markup:TelegramApi.ReplyMarkup.reply_markup option ->
unit TelegramApi.Result.result Lwt.t
val send_venue :
chat_id:int ->
latitude:float ->
longitude:float ->
title:string ->
address:string ->
foursquare_id:string option ->
?disable_notification:bool ->
reply_to:int option ->
reply_markup:TelegramApi.ReplyMarkup.reply_markup option ->
unit TelegramApi.Result.result Lwt.t
val send_contact :
chat_id:int ->
phone_number:string ->
first_name:string ->
last_name:string option ->
?disable_notification:bool ->
reply_to:int option ->
reply_markup:TelegramApi.ReplyMarkup.reply_markup option ->
unit TelegramApi.Result.result Lwt.t
val get_user_profile_photos :
user_id:int ->
offset:int option ->
limit:int option ->
TelegramApi.UserProfilePhotos.user_profile_photos
TelegramApi.Result.result Lwt.t
val get_file :
file_id:string ->
TelegramApi.File.file TelegramApi.Result.result Lwt.t
val get_file' : file_id:string -> string option Lwt.t
val download_file : file:TelegramApi.File.file -> string option Lwt.t
val kick_chat_member :
chat_id:int -> user_id:int -> unit TelegramApi.Result.result Lwt.t
val leave_chat : chat_id:int -> unit TelegramApi.Result.result Lwt.t
val unban_chat_member :
chat_id:int -> user_id:int -> unit TelegramApi.Result.result Lwt.t
val get_chat :
chat_id:int -> TelegramApi.Chat.chat TelegramApi.Result.result Lwt.t
val get_chat_administrators :
chat_id:int ->
TelegramApi.ChatMember.chat_member list TelegramApi.Result.result
Lwt.t
val get_chat_members_count :
chat_id:int -> int TelegramApi.Result.result Lwt.t
val get_chat_member :
chat_id:int ->
user_id:int ->
TelegramApi.ChatMember.chat_member TelegramApi.Result.result Lwt.t
val answer_callback_query :
callback_query_id:string ->
?text:string option ->
?show_alert:bool -> unit -> unit TelegramApi.Result.result Lwt.t
val answer_inline_query :
inline_query_id:string ->
results:TelegramApi.InlineQuery.Out.inline_query_result list ->
?cache_time:int option ->
?is_personal:bool option ->
?next_offset:string option ->
unit -> unit TelegramApi.Result.result Lwt.t
val edit_message_text :
?chat_id:string option ->
?message_id:int option ->
?inline_message_id:string option ->
text:string ->
parse_mode:TelegramApi.ParseMode.parse_mode option ->
disable_web_page_preview:bool ->
reply_markup:TelegramApi.ReplyMarkup.reply_markup option ->
unit -> unit TelegramApi.Result.result Lwt.t
val edit_message_caption :
?chat_id:string option ->
?message_id:int option ->
?inline_message_id:string option ->
caption:string ->
reply_markup:TelegramApi.ReplyMarkup.reply_markup option ->
unit -> unit TelegramApi.Result.result Lwt.t
val edit_message_reply_markup :
?chat_id:string option ->
?message_id:int option ->
?inline_message_id:string option ->
reply_markup:TelegramApi.ReplyMarkup.reply_markup option ->
unit -> unit TelegramApi.Result.result Lwt.t
val get_updates :
TelegramApi.Update.update list TelegramApi.Result.result Lwt.t
val peek_update :
TelegramApi.Update.update TelegramApi.Result.result Lwt.t
val pop_update :
?run_cmds:bool ->
unit -> TelegramApi.Update.update TelegramApi.Result.result Lwt.t
val run : ?log:bool -> unit -> unit
end
module Mk : functor (B : BOT) -> TELEGRAM_BOT
end