line-notify-api
Client for LINE notifiy API by Crystal.
The specifications of the Line Notify API can be checked at the following URL.
https://notify-bot.line.me/doc/en/
Installation
-
Add the dependency to your
shard.yml
:dependencies: line_notify_api: github: ktanaka101/line-notify-api
-
Run
shards install
Usage
Notify message
Notify the specified string
require "line_notify_api"
client = LineNotifyAPI::Client.new(YOUR_LINE_ACCESS_TOKEN)
client.notify("Hello, World!")
Notify image file
Thumbnail
require "line_notify_api"
client = LineNotifyAPI::Client.new(YOUR_LINE_ACCESS_TOKEN)
client.notify("Hello, World!", thumbnail: "https://example.com/tmb.jpg", img_file: "https://example.com/orig.jpg")
Original size
require "line_notify_api"
client = LineNotifyAPI::Client.new(YOUR_LINE_ACCESS_TOKEN)
client.notify("Hello, World!", img_file: "https://example.com/orig.jpg")
require "line_notify_api"
client = LineNotifyAPI::Client.new(YOUR_LINE_ACCESS_TOKEN)
client.notify("Hello, World!", img_file: "/path/orig.jpg")
Notify sticker
require "line_notify_api"
client = LineNotifyAPI::Client.new(YOUR_LINE_ACCESS_TOKEN)
client.notify("Hello, World!", stk_pkg_id: 1, stk_id: 1)
You can not use the client. In that case it has the same functionality as the client
require "line_notify_api"
LineNotifyAPI.notify(YOUR_LINE_ACCESS_TOKEN, "Hello, World!")
require "line_notify_api"
LineNotifyAPI.notify(
YOUR_LINE_ACCESS_TOKEN,
"Hello, World!",
thumbnail: "https://example.com/tmb.jpg",
img_file: "https://example.com/orig.jpg"
)
Contributing
- Fork it (https://github.com/ktanaka101/line-notify-api/fork)
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request
Contributors
- ktanaka101 Kentaro Tanaka - creator and maintainer