aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdrian Kummerlaender2016-03-14 14:18:49 +0100
committerAdrian Kummerlaender2016-03-14 14:18:49 +0100
commit8be93e3e1b0a8504ff1ad4c9dce1359307a15fa9 (patch)
treea73ab482bbdb35edd24f1702bea1b07f0423b982
parente55f0c649d245e69a61a5e28f100d0214c258ce6 (diff)
downloadTelebot-8be93e3e1b0a8504ff1ad4c9dce1359307a15fa9.tar
Telebot-8be93e3e1b0a8504ff1ad4c9dce1359307a15fa9.tar.gz
Telebot-8be93e3e1b0a8504ff1ad4c9dce1359307a15fa9.tar.bz2
Telebot-8be93e3e1b0a8504ff1ad4c9dce1359307a15fa9.tar.lz
Telebot-8be93e3e1b0a8504ff1ad4c9dce1359307a15fa9.tar.xz
Telebot-8be93e3e1b0a8504ff1ad4c9dce1359307a15fa9.tar.zst
Telebot-8be93e3e1b0a8504ff1ad4c9dce1359307a15fa9.zip
Add documentation section to README.md
-rw-r--r--README.md17
-rw-r--r--telebot.scm4
2 files changed, 20 insertions, 1 deletions
diff --git a/README.md b/README.md
index 8a83c64..15b1253 100644
--- a/README.md
+++ b/README.md
@@ -6,6 +6,23 @@ In this context _basic_ means that the module currently consists of barely more
The maintanance of these API wrappers is simplified by an appropriate _Scheme_ macro that reduces the implementation of new API methods to basically slightly rewriting the documentation.
+## Documentation
+
+All _basic_ API wrappers are named the same as their method name and require the bot's token as their first argument. Further parameters are expected as named key value pairs. Note that the library currently only verifies that all required parameters are supplied at all while type verification is left to _Telegram's_ server side logic.
+
+ (sendMessage token
+ chat_id: chat_id
+ text: text)
+
+All API wrappers return the raw deserialized JSON results as to not limit the options for further parsing unnecessarily.
+
+The only non-API wrapper provided by this library is `pollUpdates` which enables passing updates acquired via long polling of `getUpdates` to an arbitrary function as follows:
+
+ (pollUpdates token
+ (lambda (u)
+ (begin (print-message u)
+ (echo-message u))))
+
## Example
`example/echo.scm` implements a bot that echoes all messages back to their sender.
diff --git a/telebot.scm b/telebot.scm
index 5c38fd3..c30d095 100644
--- a/telebot.scm
+++ b/telebot.scm
@@ -60,7 +60,9 @@
(wrap-api-method getUpdates
(required)
- (optional offset limit timeout))
+ (optional offset
+ limit
+ timeout))
(wrap-api-method sendMessage
(required chat_id