Add comments
This commit is contained in:
parent
cba1831ce3
commit
ceec3c0a6b
@ -23,12 +23,14 @@ func main() {
|
|||||||
|
|
||||||
conf.Parse()
|
conf.Parse()
|
||||||
|
|
||||||
|
// Create a new messenger client
|
||||||
client := messenger.New(messenger.Options{
|
client := messenger.New(messenger.Options{
|
||||||
Verify: *verify,
|
Verify: *verify,
|
||||||
VerifyToken: *verifyToken,
|
VerifyToken: *verifyToken,
|
||||||
Token: *pageToken,
|
Token: *pageToken,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
// Setup a handler to be triggered when a message is received
|
||||||
client.HandleMessage(func(m messenger.Message, r *messenger.Response) {
|
client.HandleMessage(func(m messenger.Message, r *messenger.Response) {
|
||||||
fmt.Printf("%v (Sent, %v)\n", m.Text, m.Time.Format(time.UnixDate))
|
fmt.Printf("%v (Sent, %v)\n", m.Text, m.Time.Format(time.UnixDate))
|
||||||
|
|
||||||
@ -40,6 +42,7 @@ func main() {
|
|||||||
r.Text(fmt.Sprintf("Hello, %v!", p.FirstName))
|
r.Text(fmt.Sprintf("Hello, %v!", p.FirstName))
|
||||||
})
|
})
|
||||||
|
|
||||||
|
// Setup a handler to be triggered when a message is read
|
||||||
client.HandleDelivery(func(d messenger.Delivery, r *messenger.Response) {
|
client.HandleDelivery(func(d messenger.Delivery, r *messenger.Response) {
|
||||||
fmt.Println(d.Watermark().Format(time.UnixDate))
|
fmt.Println(d.Watermark().Format(time.UnixDate))
|
||||||
})
|
})
|
||||||
|
Loading…
Reference in New Issue
Block a user