Module Api.Command

module Command: sig .. end

type action = 
| Nothing
| GetMe of (Api.User.user Api.Result.result -> action)
| SendMessage of int * string
| SendPhoto of int * string * string option * int option
* (string Api.Result.result -> action)
| ResendPhoto of int * string * string option * int option
| SendAudio of int * string * string * string * int option
* (string Api.Result.result -> action)
| ResendAudio of int * string * string * string * int option
| SendVoice of int * string * int option * (string Api.Result.result -> action)
| ResendVoice of int * string * int option
| GetUpdates of (Api.Update.update list Api.Result.result -> action)
| PeekUpdate of (Api.Update.update Api.Result.result -> action)
| PopUpdate of (Api.Update.update Api.Result.result -> action)
| Chain of action * action
The actions that can be used by the bot's commands
type command = {
   name : string;
   description : string;
   mutable enabled : bool;
   run : Api.Message.message -> action;
}
This type is used to represent available commands. The `name` field is the command's name (without a slash) and the `description` field is the description to be used in the help message. `run` is the function called when invoking the command.
val is_command : Api.Update.update -> bool
Tests to see whether an update from the update queue invoked a command
val read_command : Api.Message.message -> command list -> action
Takes a message, known to represent a command, and a list of possible commands. These values are used to find the matching command and return the actions that it should perform
val read_update : Api.Update.update -> command list -> action
Reads a single update and, given a list of commands, matches it to a correct command that can be invoked
val tokenize : string -> string list
Turns a string into the args list that a command may choose to work with