An open API service indexing awesome lists of open source software.

https://github.com/ktanaka101/line-notify-api

Client for LINE notifiy API by Crystal.
https://github.com/ktanaka101/line-notify-api

crystal line

Last synced: 9 months ago
JSON representation

Client for LINE notifiy API by Crystal.

Awesome Lists containing this project

README

          

[![CircleCI](https://circleci.com/gh/ktanaka101/line-notify-api.svg?style=svg)](https://circleci.com/gh/ktanaka101/line-notify-api)

# 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`:

```yaml
dependencies:
line_notify_api:
github: ktanaka101/line-notify-api
```

2. Run `shards install`

## Usage

### Notify message

#### Notify the specified string

```crystal
require "line_notify_api"

client = LineNotifyAPI::Client.new(YOUR_LINE_ACCESS_TOKEN)
client.notify("Hello, World!")
```

### Notify image file

#### Thumbnail

```crystal
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

```crystal
require "line_notify_api"

client = LineNotifyAPI::Client.new(YOUR_LINE_ACCESS_TOKEN)
client.notify("Hello, World!", img_file: "https://example.com/orig.jpg")
```

```crystal
require "line_notify_api"

client = LineNotifyAPI::Client.new(YOUR_LINE_ACCESS_TOKEN)
client.notify("Hello, World!", img_file: "/path/orig.jpg")
```

### Notify sticker

```crystal
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

```crystal
require "line_notify_api"

LineNotifyAPI.notify(YOUR_LINE_ACCESS_TOKEN, "Hello, World!")
```

```crystal
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 ()
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](https://github.com/ktanaka101) Kentaro Tanaka - creator and maintainer