1
0
mirror of synced 2024-11-25 14:26:09 +03:00

Add comments

This commit is contained in:
Harrison 2016-04-15 10:34:10 +10:00
parent cba1831ce3
commit ceec3c0a6b

View File

@ -23,12 +23,14 @@ func main() {
conf.Parse()
// Create a new messenger client
client := messenger.New(messenger.Options{
Verify: *verify,
VerifyToken: *verifyToken,
Token: *pageToken,
})
// Setup a handler to be triggered when a message is received
client.HandleMessage(func(m messenger.Message, r *messenger.Response) {
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))
})
// Setup a handler to be triggered when a message is read
client.HandleDelivery(func(d messenger.Delivery, r *messenger.Response) {
fmt.Println(d.Watermark().Format(time.UnixDate))
})