Skip to content

Latest commit

 

History

History
43 lines (29 loc) · 760 Bytes

File metadata and controls

43 lines (29 loc) · 760 Bytes

wechat

A new WeChat robot with golang.

Usage

New client with message handler example:

package main

import (
	"github.com/binatify/wechat/client"
	"github.com/binatify/wechat/config"
	"github.com/sirupsen/logrus"
	"os"
)

func main() {
	logrus.SetOutput(os.Stdout)
	logger := logrus.WithField("reqID", "reqID")

	c := client.New(&config.Config{
		Duration: 6,
	}, logger).Start()

	c.Listen(func(msg interface{}) {
		content := msg.(map[string]interface{})["Content"].(string)
		logger.Println(content)
	})

}

screen shot 2018-01-08 at 6 26 04 pm

Features

  • Auto login with qrcode.
  • Message linsten.
  • Messge send.