Go Wechaty starter project template that works out-of-the-box
47
stars
135
commits
Makefile
primary language
May 18, 2025
updated
Go Wechaty Starter Project Template that Works Out-of-the-Box
Wechaty is a RPA SDK for Wechat Individual Account that can help you create a chatbot in 6 lines of Go.
package main
import (
"fmt"
"github.com/wechaty/go-wechaty/wechaty"
)
func main() {
_ = wechaty.NewWechaty().
OnScan(func(ctx *wechaty.Context, qrCode string, status schemas.ScanStatus, data string) {
fmt.Printf("Scan QR Code to login: %s\nhttps://wechaty.github.io/qrcode/%s\n", status, qrCode)
}).
OnLogin(func(ctx *wechaty.Context, user *user.ContactSelf) { fmt.Printf("User %s logined\n", user) }).
OnMessage(func(ctx *wechaty.Context, message *user.Message) { fmt.Printf("Message: %s\n", message) }).
Start()
}
make install
Get a Token for your Bot first. Learn more from our Wechaty Developers Program
export WECHATY_PUPPET_SERVICE_TOKEN=your_token_at_here
make bot
[](https://github.com/wechaty/go-wechaty)
Makefile
58.0%
Dockerfile
42.0%
Go Wechaty starter project template that works out-of-the-box
47
stars
135
commits
Makefile
primary language
May 18, 2025
updated
Go Wechaty Starter Project Template that Works Out-of-the-Box
Wechaty is a RPA SDK for Wechat Individual Account that can help you create a chatbot in 6 lines of Go.
package main
import (
"fmt"
"github.com/wechaty/go-wechaty/wechaty"
)
func main() {
_ = wechaty.NewWechaty().
OnScan(func(ctx *wechaty.Context, qrCode string, status schemas.ScanStatus, data string) {
fmt.Printf("Scan QR Code to login: %s\nhttps://wechaty.github.io/qrcode/%s\n", status, qrCode)
}).
OnLogin(func(ctx *wechaty.Context, user *user.ContactSelf) { fmt.Printf("User %s logined\n", user) }).
OnMessage(func(ctx *wechaty.Context, message *user.Message) { fmt.Printf("Message: %s\n", message) }).
Start()
}
make install
Get a Token for your Bot first. Learn more from our Wechaty Developers Program
export WECHATY_PUPPET_SERVICE_TOKEN=your_token_at_here
make bot
[](https://github.com/wechaty/go-wechaty)
Makefile
58.0%
Dockerfile
42.0%