notify

package
v1.3.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 22, 2020 License: MIT Imports: 10 Imported by: 3

Documentation

Overview

This code only use "Line Notify REST API"

See Also

https://engineering.linecorp.com/en/blog/using-line-notify-to-send-messages-to-line-from-the-command-line/

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func SendImage added in v1.1.0

func SendImage(accessToken, message, imageURL string) (err error)

SendImage : send line notify simple text with image

Example
package main

import (
	"github.com/juunini/simple-go-line-notify/notify"
)

func main() {
	accessToken := "29jWoO****p70eK3AKA********ooHfusvDP6***ZmR"
	message := "hello, world!"
	imageURL := "https://d.line-scdn.net/n/line_lp/img/ogimage.png"

	if err := notify.SendImage(accessToken, message, imageURL); err != nil {
		panic(err)
	}
}
Output:

func SendLocalImage added in v1.3.0

func SendLocalImage(accessToken, message, imagePath string) (err error)

SendLocalImage : send line notify simple text with upload local image(jpg, png only)

Example
package main

import (
	"github.com/juunini/simple-go-line-notify/notify"
)

func main() {
	accessToken := "29jWoO****p70eK3AKA********ooHfusvDP6***ZmR"
	message := "hello, world!"
	imagePath := "./sample.png"

	if err := notify.SendLocalImage(accessToken, message, imagePath); err != nil {
		panic(err)
	}
}
Output:

func SendSticker added in v1.2.0

func SendSticker(accessToken, message string, stickerPackageId, stickerId int) (err error)

SendSticker : send line notify simple text with sticker

Sticker List

https://devdocs.line.me/files/sticker_list.pdf

Example
package main

import (
	"github.com/juunini/simple-go-line-notify/notify"
)

func main() {
	accessToken := "29jWoO****p70eK3AKA********ooHfusvDP6***ZmR"
	message := "hello, world!"
	stickerPackageId := 1
	stickerId := 113

	if err := notify.SendSticker(accessToken, message, stickerPackageId, stickerId); err != nil {
		panic(err)
	}
}
Output:

func SendText added in v1.0.1

func SendText(accessToken, message string) (err error)

SendText : send line notify simple text

Example
package main

import (
	"github.com/juunini/simple-go-line-notify/notify"
)

func main() {
	accessToken := "29jWoO****p70eK3AKA********ooHfusvDP6***ZmR"
	message := "hello, world!"

	if err := notify.SendText(accessToken, message); err != nil {
		panic(err)
	}
}
Output:

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL