cl-telegram-bot.asd | ||
cl-telegram-bot.lisp | ||
example.lisp | ||
LICENSE | ||
package.lisp | ||
README.md |
Telegram Bot API for Common Lisp
See the Telegram Bot API.
This library uses Drakma and CL-JSON with CLOS semantics.
This library has the following aliases: cl-telegram-bot, tl-bot, tg-bot, telegram-bot.
-
function
(make-bot token)
Returns a bot instance for a given token. To get a new token, see here. -
function
(access object &rest slot-list)
Convenience function to access nested fields in a JSON object. For example, to access update.message.from.id, you can use(access update 'message 'from 'id)
. This operation is linear in time, so I suggest keeping it at a minimum, reusing the fields multiple times, e.g. using a let*. You can use this function from any JSON field, so(access message 'from 'id)
from a previously accessed message field should be used when many nested fields share a common parent. -
function
(decode json-object)
Decode JSON object to CLOS object. Use to convert the return value of API calls when needed, e.g.(decode (send-message ...)
returns an object ready to be used (byaccess
, for example). -
function
(get-slot obj slot)
Returns slot from obj, NIL is unbound. Use with JSON CLOS object. -
error
request-error
Used (currently) by get-updates on HTTP error. -
function
(cl-telegram-bot::get-class-slots object)
(SBCL only) Use this function to inspect JSON objects. For debugging only. -
function
(cl-telegram-bot::make-request b method-name options-alist)
Make direct API request using Drakma. Use for debugging only. -
function
(get-updates bot &key limit timeout)
NOTE: The offset parameter is omitted as it is internally managed by the tl-bot:bot class.
API methods
NOTE: the keyword argument :reply from the official API was renamed to :reply in every function.
-
function
(send-message bot chat-id text &key parse-mode disable-web-page-preview disable-notification reply)
-
function
(forward-message bot chat-id from-chat-id message-id &key disable-notification)
-
function
(send-photo bot chat-id photo &key caption disable-notification reply reply-markup)
-
function
(send-audio bot chat-id audio &key duration performer title disable-notification reply reply-markup)
-
function
(send-document bot chat-id document &key caption disable-notification reply reply-markup)
-
function
(send-sticker bot chat-id sticker &key disable-notification reply reply-markup)
-
function
(send-voice bot chat-id voice &key duration disable-notification reply reply-markup)
-
function
(send-location bot chat-id latitude longitude &key disable-notification reply reply-markup)
-
function
(get-user-profile-photos bot user-id &key offset limit)
-
function
(get-file bot file-id)
-
function
(leave-chat bot chat-id)
-
function
(get-chat bot chat-id)
-
function
(get-chat-members-count bot chat-id)
-
function
(answer-callback-query bot callback-query-id &key text show-alert)
-
function
(edit-message-caption bot chat-id message-id inline-message-id &key caption reply-markup)
-
function
(edit-message-reply-markup bot chat-id message-id inline-message-id &key reply-markup)