line-notify-api v0.1

Client for LINE notifiy API by Crystal.

CircleCI

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

  1. Add the dependency to your shard.yml:

    dependencies:
      line_notify_api:
        github: ktanaka101/line-notify-api
    
  2. 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

  1. Fork it (https://github.com/ktanaka101/line-notify-api/fork)
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request

Contributors

  • ktanaka101 Kentaro Tanaka - creator and maintainer
Repository

line-notify-api

Owner
Statistic
  • 0
  • 0
  • 0
  • 0
  • 1
  • about 5 years ago
  • May 18, 2019
License

MIT License

Links
Synced at

Sun, 24 Nov 2024 03:59:24 GMT

Languages