go-wechaty-plugs-started

module
v0.0.0-...-9caa03f Latest Latest
Warning

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

Go to latest
Published: May 10, 2022 License: Apache-2.0

README

go-wechaty-plugs-started Go Version Go

Go Wechaty

Gitpod Ready-to-Code Go Playground Wechaty in Go

Go Wechaty Plug Project Template that Works Out-of-the-Box

Connecting Chatbots

Powered by Wechaty

Wechaty is a RPA SDK for Wechat Individual Account that can help you create a chatbot in 6 lines of Go.

The World's Shortest Go ChatBot: 7 lines of Code

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()
}

Requirements

  1. Go 1.14+

Install

git clone github.com/Ran-Xing/go-wechaty-plugs-started.git
cd go-wechaty-plugs-started/examples
go mod tidy

Run

Get a Token for your Bot first. Learn more from our Wechaty Developers Program

# Edit config.yaml
# Then
go run ding-ding-bot.go

Wechaty Getting Started in Multiple Languages

Badge

Wechaty in Go

[![Wechaty in Go](https://img.shields.io/badge/Wechaty-Go-7de)](https://github.com/wechaty/go-wechaty)

Maintainers

@wechaty/go

  • Code & Docs © 2020 - now Wechaty Contributors https://github.com/wechaty
  • Code released under the Apache-2.0 License
  • Docs released under Creative Commons

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL