notify

package
v1.3.3 Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2021 License: MIT Imports: 10 Imported by: 0

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

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

SendImage : send line notify simple text with image

Example
package main

import (
	"github.com/Frontware/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

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

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

Example
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

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

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

SendText : send line notify simple text

Example
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