https://github.com/fukamachi/cl-line-bot-sdk
SDK for the LINE Messaging API for Common Lisp
https://github.com/fukamachi/cl-line-bot-sdk
common-lisp linebot
Last synced: 4 months ago
JSON representation
SDK for the LINE Messaging API for Common Lisp
- Host: GitHub
- URL: https://github.com/fukamachi/cl-line-bot-sdk
- Owner: fukamachi
- Created: 2016-10-22T16:40:48.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2016-12-03T15:04:08.000Z (over 9 years ago)
- Last Synced: 2025-10-26T20:28:08.777Z (8 months ago)
- Topics: common-lisp, linebot
- Language: Common Lisp
- Homepage:
- Size: 40 KB
- Stars: 12
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.markdown
Awesome Lists containing this project
README
# cl-line-bot-sdk
[](https://travis-ci.org/fukamachi/cl-line-bot-sdk)
[](https://coveralls.io/github/fukamachi/cl-line-bot-sdk?branch=master)
Common Lisp SDK for the [LINE Messaging API](https://devdocs.line.me/en/).
## Usage
```common-lisp
(ql:quickload :linebot/app)
(defclass echo-app (linebot/app:app) ())
(defmethod linebot:handle-message-event ((handler echo-app)
(event linebot:message-event)
(message linebot:text-message))
(linebot:reply-message
(make-instance 'linebot:text-send-message
:text (linebot:message-text message))))
(make-instance 'echo-app
:channel-secret ""
:channel-access-token ""
:callback "/callback")
```
```
$ clackup echo.lisp
```
## Testing
```common-lisp
(use-package :prove)
(use-package :linebot/tests)
(import '(assoc-utils:aget lack.request:request-body-parameters))
(plan 1)
(subtest-lineapp "echo"
(make-instance 'echo-app
:callback "/callback")
(emit-webhook
(linebot:make-event
`(("type" . "message")
("timestamp" . ,(current-timestamp))
("source" . (("type" . "user")
("userId" . ,(dummy-user-id))))
("replyToken" . ,(dummy-reply-token))
("message" . (("type" . "text")
("text" . "こんにちは"))))))
(let ((requests (lineapp-requests)))
(is (length requests) 1
"1 response")
(let ((params (request-body-parameters (aref requests 0))))
(is (length (aget params "messages")) 1
"Has 1 message")
(is (aget (first (aget params "messages")) "type") "text"
"The message is text one")
(is (aget (first (aget params "messages")) "text") "こんにちは"
"The message says こんにちは"))))
(finalize)
```
## Installation
```
$ ros install fukamachi/cl-line-bot-sdk
```
## Author
* Eitaro Fukamachi (e.arrows@gmail.com)
## Copyright
Copyright (c) 2016 Eitaro Fukamachi (e.arrows@gmail.com)
## License
Licensed under the BSD 2-Clause License.