Skip to content

Commit 6cda262

Browse files
committed
1 parent e8e763f commit 6cda262

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

examples/ding-dong-bot.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,11 @@ import (
3333
func main() {
3434
var bot = wechaty.NewWechaty()
3535

36-
bot.OnScan(func(qrCode string, status schemas.ScanStatus, data string) {
36+
bot.OnScan(func(ctx *wechaty.Context, qrCode string, status schemas.ScanStatus, data string) {
3737
fmt.Printf("Scan QR Code to login: %v\nhttps://wechaty.js.org/qrcode/%s\n", status, qrCode)
38-
}).OnLogin(func(user *user.ContactSelf) {
38+
}).OnLogin(func(ctx *wechaty.Context, user *user.ContactSelf) {
3939
fmt.Printf("User %s logined\n", user.Name())
40-
}).OnMessage(onMessage).OnLogout(func(user *user.ContactSelf, reason string) {
40+
}).OnMessage(onMessage).OnLogout(func(ctx *wechaty.Context, user *user.ContactSelf, reason string) {
4141
fmt.Printf("User %s logouted: %s\n", user, reason)
4242
})
4343

@@ -55,7 +55,7 @@ func main() {
5555
}
5656
}
5757

58-
func onMessage(message *user.Message) {
58+
func onMessage(ctx *wechaty.Context, message *user.Message) {
5959
log.Println(message)
6060

6161
if message.Self() {

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ module github.com/wechaty/go-wechaty-getting-started
33
go 1.14
44

55
require (
6-
github.com/wechaty/go-wechaty v0.1.2
6+
github.com/wechaty/go-wechaty v0.3.0
77
golang.org/x/lint v0.0.0-20201208152925-83fdc39ff7b5 // indirect
88
golang.org/x/tools v0.1.0 // indirect
99
)

0 commit comments

Comments
 (0)