Skip to content

Latest commit

 

History

History
47 lines (34 loc) · 1.01 KB

README.md

File metadata and controls

47 lines (34 loc) · 1.01 KB

kakao.go

A Simple kakaotalk chatbot using LOCO protocal for Go

Introduction

A package that makes the LOCO protocol compatible with Go.

When using this package, it must not be abused or used illegally, and the developer is not responsible for any disadvantages caused by using it.

Bot Start

package main

import (
	"log"

	kakaogo "github.com/yms2772/kakao.go"
)

func main() {
	kakao, err := kakaogo.New("example@email.com", "pAsSwORd")
	// kakao, err := kakaogo.New("example@email.com", "pAsSwORd", true) // If you are already authenticated, put 'true' in the parameter.
	if err != nil {
		log.Fatalln(err)
	}

	kakao.OnReady = func() {
		log.Printf("Logged On")
	}

	kakao.OnMessage = func(chat *kakaogo.Message) {
		log.Printf("Message: %s", chat.Message)
		chat.Send(chat.Message)
		chat.SendPhoto("test.jpg")
	}

	kakao.Run()
	//kakao.RunWithKey("AccessKey~~~")  // If you have an access key, use this function.
}

Thanks to

jhleekr/kakao.py

License

MIT Licence