Skip to content

Commit da47273

Browse files
authored
Merge pull request #6 from dchaofei/master
update wecahty version & readme
2 parents 84e4189 + ce1b14d commit da47273

File tree

3 files changed

+12
-13
lines changed

3 files changed

+12
-13
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@ make install
5151
Get a Token for your Bot first. Learn more from our [Wechaty Developers Program](https://github.com/wechaty/wechaty/wiki/Wechaty-Developer-Program)
5252

5353
```sh
54+
export WECHATY_PUPPET_HOSTIE_TOKEN=your_token_at_here
55+
5456
make bot
5557
```
5658

examples/ding-dong-bot.go

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ package main
2121
import (
2222
"fmt"
2323
"github.com/wechaty/go-wechaty/wechaty"
24-
wp "github.com/wechaty/go-wechaty/wechaty-puppet"
2524
"github.com/wechaty/go-wechaty/wechaty-puppet/schemas"
2625
"github.com/wechaty/go-wechaty/wechaty/user"
2726
"log"
@@ -31,9 +30,7 @@ import (
3130
)
3231

3332
func main() {
34-
var bot = wechaty.NewWechaty(wechaty.WithPuppetOption(&wp.Option{
35-
Token: "",
36-
}))
33+
var bot = wechaty.NewWechaty()
3734

3835
bot.OnScan(func(qrCode string, status schemas.ScanStatus, data string) {
3936
fmt.Printf("Scan QR Code to login: %v\nhttps://api.qrserver.com/v1/create-qr-code/?data=%s\n", status, qrCode)
@@ -81,12 +78,12 @@ func onMessage(message *user.Message) {
8178
}
8279
log.Println("REPLY: dong")
8380

84-
// // 2. reply image(qrcode image)
85-
// fileBox, _ := file_box.NewFileBoxFromUrl("https://wechaty.github.io/wechaty/images/bot-qr-code.png", "", nil)
86-
// _, err = message.SayFile(fileBox)
87-
// if err != nil {
88-
// log.Println(err)
89-
// return
90-
// }
91-
// log.Printf("REPLY: %s\n", fileBox)
81+
// 2. reply image(qrcode image)
82+
//fileBox, _ := file_box.FromUrl("https://wechaty.github.io/wechaty/images/bot-qr-code.png", "", nil)
83+
//_, err = message.Say(fileBox)
84+
//if err != nil {
85+
// log.Println(err)
86+
// return
87+
//}
88+
//log.Printf("REPLY: %s\n", fileBox)
9289
}

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ module github.com/wechaty/go-wechaty-getting-started
22

33
go 1.14
44

5-
require github.com/wechaty/go-wechaty v0.1.1
5+
require github.com/wechaty/go-wechaty v0.1.2

0 commit comments

Comments
 (0)