/lineatgo

:electric_plug: Unofficial SDK for LINE@ that allows you to manipulate LINE@ account via Go code.

Primary LanguageGoMIT LicenseMIT

GoDoc GoWalker MIT License

lineatgo

This is an unofficial LINE@ SDK that was implemented in pure go

This project is no longer maintained

This will be not maintained because of my motivation. If you send me some pull request, perhaps it affect my motivation.

Particular Requirement

  • ChromeDriver

installation

package

go get github.com/s3pt3mb3r/lineatgo

ChromeDriver

for homebrew user

brew install chromedriver

for windows user Download link

Usage

package main

import (
    "github.com/s3pt3mb3r/lineatgo"
    "log"
    "fmt"
    "os"
)

func main()  {
    api := lineatgo.NewApi("MAIL_ADDRESS", "PASSWORD")
    bot, err := api.NewBot("@LINEID")
    if err != nil {
        log.Println(err)
    }

    //post
    p := bot.NewPost()
    p.Add("text", "This", " is", " a")
	p.Add("text", "test")
	p.Add("image", "/Path/To/photo.jpg", "/Path/To/photo2.jpg", "Path/To/video.mp4")
    p.Post()
    
    //you can get a auth URL
    url := bot.GetAuthURL(lineatgo.Administrator)
    //else: lineatgo.Operator, lineatgo.LimitedOperator, lineatgo.Messenger
    fmt.Println(url)

    //You can get your QR code
    qr := bot.GetQRCode()

    file, err := os.OpenFile("test.png", os.O_RDWR|os.O_CREATE, 0666)
    if err != nil {
        log.Fatal(err)
    }
    defer file.Close()
    file.Write(qr)
}

What is "@LINEID"?

lineId

Todo

  • Enable to select authority type in getAuth function
  • Enable to Delete paymaster user's clearance
  • Enable to Post some text on time line
  • Enable to Post image or video on time line
  • Fix DeletePostAll function

At last

Probably, being overlook some factors, I can't code Login() function without web driver (I'm working at dev branch. See login2 function)

If it's possible, please make Login() function more better and send pull request:)