API v2
CL-TELEGRAM-BOT2/ACTION
Classes
ACTION
Functions
Useful in cl-telegram-bot2/generics:process
handlers in case if
state has additional handler stored in the slot and this
slot can be either state or action.
This function is recursive, because processing of an action
could return another action and we should call FUNC
until
a new state or NIL
will be returned.
CL-TELEGRAM-BOT2/ACTIONS/EDIT-MESSAGE-MEDIA
Classes
EDIT-MESSAGE-MEDIA
Readers
Functions
CL-TELEGRAM-BOT2/ACTIONS/SEND-INVOICE
Classes
SEND-INVOICE
Readers
Functions
Types
Type of prices
arguments for send-invoice
class.
(SOFT-LIST-OF HASH-TABLE)
CL-TELEGRAM-BOT2/ACTIONS/SEND-PHOTO
Classes
SEND-PHOTO
Readers
Functions
CL-TELEGRAM-BOT2/ACTIONS/SEND-TEXT
Classes
SEND-TEXT
Readers
Supported values are: "Markdown"
, "MarkdownV2"
or "HTML"
. Read more about formatting options in the Telegram documentaion: https://core.telegram.org/bots/api#formatting-options
Functions
CL-TELEGRAM-BOT2/BOT
Macros
Use this macro to define a class of your Telegram bot.
Each bot has a state machine inside. The simplest bot has only one state:
(defbot test-bot ()
()
(:initial-state
(state (send-text "Hello world!"))))
This bot will green each who activates it.
To learn more about bot states and actions see States and Actions
section.
CL-TELEGRAM-BOT2/ERRORS
Classes
TELEGRAM-ERROR
Readers
CL-TELEGRAM-BOT2/GENERICS
Generics
Pre-checkout-query object will be passed as this single arguement and function should return a boolean. When the function return True, user may proceed to the payment.
Pre-checkout queries are not bound the the chat, so current-chat and current-state are not available during processing. This is why methods of this generic function should be defined on bot class.
You can use CL-TELEGRAM-BOT2/API:PRE-CHECKOUT-QUERY-INVOICE-PAYLOAD
function
to extract payload from the query and find associated invoice.
This method is called when some state exits and returns a result using cl-telegram-bot2/term/back:back
function.
This method is called when chat actor's state is changed to a given STATE
.
Such hook can be used to send some prompt to the user.
This method is called when chat actor's state is returned from a given STATE
back to the previous state.
The method is called only when state is removed from the stack. When a new state is added to the stack, this method will not be called for a previous state.
Such hook can be used to hide a keyboard or to delete temporary messages.
This method is called by when processing a single update. It is called multiple times on different parts of an update. Whole pipeline looks like that:
For each update we call: process(bot, update) process(actor-state, update)
CL-TELEGRAM-BOT2/HIGH
High level API
for implementing Telegram bots.
Classes
CHAT-STATE
Functions
Macros
Returns as the first value a list of messages created by reply
function called
during BODY
execution. Values returned by the BODY
code are returned as the second,
third and following arguments.
Also, messages are collected when these actions are called:
CL-TELEGRAM-BOT2/SERVER
Functions
Start processing new updates from the Telegram API
.
Pass bot instance as the first argument and maybe some other optional arguments.
If DEBUG
argument is T, then bot will ignore updates which it can't to process without errors.
Otherwise, an interactive debugger will popup.
CL-TELEGRAM-BOT2/SPEC
Classes
TELEGRAM-OBJECT
CL-TELEGRAM-BOT2/STATE
Classes
STATE
Readers
Functions
Types
Type of ON-CALLBACK-QUERY
argument of the state
class.
(SERAPEUM:SOFT-ALIST-OF STRING (OR WORKFLOW-BLOCK WORKFLOW-BLOCKS))
CL-TELEGRAM-BOT2/STATE-WITH-COMMANDS
Classes
COMMAND
GLOBAL-COMMAND
This command will be available during in all bot states.
STATE-WITH-COMMANDS-MIXIN
Readers
Functions
CL-TELEGRAM-BOT2/STATES/BASE
Classes
BASE-STATE
Readers
Accessors
Generics
Functions
CL-TELEGRAM-BOT2/STATES/WAIT-FOR-PAYMENT
Classes
WAIT-FOR-PAYMENT
Readers
Functions
CL-TELEGRAM-BOT2/TERM/BACK
Classes
BACK-TO-ID
Readers
BACK-TO-NTH-PARENT
Readers
BACK-TO
Readers
BACK
Readers
Functions
CL-TELEGRAM-BOT2/TYPES
Types
(OR CL-TELEGRAM-BOT2/API:REPLY-KEYBOARD-MARKUP
CL-TELEGRAM-BOT2/API:REPLY-KEYBOARD-REMOVE
CL-TELEGRAM-BOT2/API:INLINE-KEYBOARD-MARKUP
CL-TELEGRAM-BOT2/API:FORCE-REPLY)
CL-TELEGRAM-BOT2/UTILS
Generics
Does a general deep-copy on the given object and sub-pieces. Returns atoms, numbers and chars. Runs copy-tree on lists, and copy-seq on other sequences. Runs copy-structure on pathnames, hash tables and other structure-objects
Functions
If value is a fbound SYMBOL
, then calls as a function and then returns a result.
CL-TELEGRAM-BOT2/WORKFLOW
Types
(AND SYMBOL (SATISFIES FBOUNDP))
(OR FUNCALLABLE-SYMBOL BASE-STATE ACTION BACK)
(SOFT-LIST-OF WORKFLOW-BLOCK)