package telegraml

  1. Overview
  2. Docs

A module that exposes convenience functions for bot actions, equivalent to TelegramActions

include module type of struct include TelegramActions end

Chains two commands together (do one, then the other)

val (/>) : (and_then:'a -> 'b) -> 'c -> 'd

Pipes one command into the next (do one, and use its result)

val finish : 'a -> TelegramApi.Command.action

Finish a sequence of commands using (/>)

Sequence a list of commands in the provided order

Examples:

  • command /> fun _ -> command2 /> finish
  • command /+ command2
  • sequence [ command; command2 ]
val send_message : chat_id:int -> ?parse_mode:TelegramApi.ParseMode.parse_mode -> ?disable_web_page_preview:bool -> ?disable_notification:bool -> ?reply_to:int -> ?reply_markup:TelegramApi.ReplyMarkup.reply_markup -> ('a, unit, string, TelegramApi.Command.action) format4 -> 'a
val forward_message : chat_id:int -> from_chat_id:int -> ?disable_notification:bool -> message_id:int -> TelegramApi.Command.action
val send_chat_action : chat_id:int -> TelegramApi.ChatAction.action -> TelegramApi.Command.action
val send_photo : chat_id:int -> ?caption:string -> ?disable_notification:bool -> ?reply_to:int -> ?reply_markup:TelegramApi.ReplyMarkup.reply_markup -> string -> and_then:(string TelegramApi.Result.result -> TelegramApi.Command.action) -> TelegramApi.Command.action
val resend_photo : chat_id:int -> ?caption:string -> ?disable_notification:bool -> ?reply_to:int -> ?reply_markup:TelegramApi.ReplyMarkup.reply_markup -> string -> TelegramApi.Command.action
val send_audio : chat_id:int -> performer:string -> title:string -> ?disable_notification:bool -> ?reply_to:int -> ?reply_markup:TelegramApi.ReplyMarkup.reply_markup -> string -> and_then:(string TelegramApi.Result.result -> TelegramApi.Command.action) -> TelegramApi.Command.action
val resend_audio : chat_id:int -> performer:string -> title:string -> ?disable_notification:bool -> ?reply_to:int -> ?reply_markup:TelegramApi.ReplyMarkup.reply_markup -> string -> TelegramApi.Command.action
val send_document : chat_id:int -> ?disable_notification:bool -> ?reply_to:int -> ?reply_markup:TelegramApi.ReplyMarkup.reply_markup -> string -> and_then:(string TelegramApi.Result.result -> TelegramApi.Command.action) -> TelegramApi.Command.action
val resend_document : chat_id:int -> ?disable_notification:bool -> ?reply_to:int -> ?reply_markup:TelegramApi.ReplyMarkup.reply_markup -> string -> TelegramApi.Command.action
val send_sticker : chat_id:int -> ?disable_notification:bool -> ?reply_to:int -> ?reply_markup:TelegramApi.ReplyMarkup.reply_markup -> string -> and_then:(string TelegramApi.Result.result -> TelegramApi.Command.action) -> TelegramApi.Command.action
val resend_sticker : chat_id:int -> ?disable_notification:bool -> ?reply_to:int -> ?reply_markup:TelegramApi.ReplyMarkup.reply_markup -> string -> TelegramApi.Command.action
val send_video : chat_id:int -> ?duration:int -> ?caption:string -> ?disable_notification:bool -> ?reply_to:int -> ?reply_markup:TelegramApi.ReplyMarkup.reply_markup -> string -> and_then:(string TelegramApi.Result.result -> TelegramApi.Command.action) -> TelegramApi.Command.action
val resend_video : chat_id:int -> ?duration:int -> ?caption:string -> ?disable_notification:bool -> ?reply_to:int -> ?reply_markup:TelegramApi.ReplyMarkup.reply_markup -> string -> TelegramApi.Command.action
val send_voice : chat_id:int -> ?disable_notification:bool -> ?reply_to:int -> ?reply_markup:TelegramApi.ReplyMarkup.reply_markup -> string -> and_then:(string TelegramApi.Result.result -> TelegramApi.Command.action) -> TelegramApi.Command.action
val resend_voice : chat_id:int -> ?disable_notification:bool -> ?reply_to:int -> ?reply_markup:TelegramApi.ReplyMarkup.reply_markup -> string -> TelegramApi.Command.action
val send_location : chat_id:int -> ?disable_notification:bool -> ?reply_to:int -> ?reply_markup:TelegramApi.ReplyMarkup.reply_markup -> latitude:float -> longitude:float -> TelegramApi.Command.action
val send_venue : chat_id:int -> ?disable_notification:bool -> ?reply_to:int -> ?reply_markup:TelegramApi.ReplyMarkup.reply_markup -> latitude:float -> longitude:float -> title:string -> address:string -> foursquare_id:string option -> TelegramApi.Command.action
val send_contact : chat_id:int -> ?disable_notification:bool -> ?reply_to:int -> ?reply_markup:TelegramApi.ReplyMarkup.reply_markup -> phone_number:string -> first_name:string -> last_name:string option -> TelegramApi.Command.action
val get_user_profile_photos : ?offset:int -> ?limit:int -> int -> and_then: (TelegramApi.UserProfilePhotos.user_profile_photos TelegramApi.Result.result -> TelegramApi.Command.action) -> TelegramApi.Command.action
val get_file' : string -> and_then:(string option -> TelegramApi.Command.action) -> TelegramApi.Command.action
val download_file : TelegramApi.File.file -> and_then:(string option -> TelegramApi.Command.action) -> TelegramApi.Command.action
val kick_chat_member : chat_id:int -> user_id:int -> TelegramApi.Command.action
val leave_chat : chat_id:int -> TelegramApi.Command.action
val unban_chat_member : chat_id:int -> user_id:int -> TelegramApi.Command.action
val get_chat_members_count : chat_id:int -> and_then:(int TelegramApi.Result.result -> TelegramApi.Command.action) -> TelegramApi.Command.action
val answer_callback_query : ?text:string -> ?show_alert:bool -> string -> TelegramApi.Command.action
val answer_inline_query : ?cache_time:int -> ?is_personal:bool -> ?next_offset:string -> string -> TelegramApi.InlineQuery.Out.inline_query_result list -> TelegramApi.Command.action
val edit_message_text : id:[ `ChatMessageId of string * int | `InlineMessageId of string ] -> ?parse_mode:TelegramApi.ParseMode.parse_mode -> ?disable_web_page_preview:bool -> ?reply_markup:TelegramApi.ReplyMarkup.reply_markup -> ('a, unit, string, TelegramApi.Command.action) format4 -> 'a
val edit_message_caption : id:[ `ChatMessageId of string * int | `InlineMessageId of string ] -> ?reply_markup:TelegramApi.ReplyMarkup.reply_markup -> ('a, unit, string, TelegramApi.Command.action) format4 -> 'a
val edit_message_reply_markup : id:[ `ChatMessageId of string * int | `InlineMessageId of string ] -> reply_markup:TelegramApi.ReplyMarkup.reply_markup -> TelegramApi.Command.action
  • parameter run_commands:

    true by default. States whether to evaluate commands, inline queries, chat events, and callback queries

OCaml

Innovation. Community. Security.