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.
- Host: GitHub
- URL: https://github.com/ktanaka101/line-notify-api
- Owner: ktanaka101
- License: mit
- Created: 2019-05-18T16:27:59.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2019-09-07T13:50:23.000Z (over 6 years ago)
- Last Synced: 2025-06-29T10:42:09.750Z (9 months ago)
- Topics: crystal, line
- Language: Crystal
- Homepage:
- Size: 19.5 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](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