//MessageReceived :Callback to handle when message received.
MessageReceived :Callback to handle when message received.
// MessageReceived : Callback to handle when message received .
func MessageReceived(event Event, opts MessageOpts, msg ReceivedMessage) {
	profile, err := mess.GetProfile(opts.Sender.ID)
	if err != nil {
		fmt.Println(err)
		return
	}
	petObj := petsDB.GetNextPet()
	log.Println("Got pet:", petObj)
	out := fmt.Sprintf("您好，目前的動物：名為%s, 所在地為:%s, 敘述: %s 電話為:%s", petObj.Name, petObj.Resettlement, petObj.Note, petObj.Phone)
	resp, err := mess.SendSimpleMessage(opts.Sender.ID, fmt.Sprintf("%s %s 你好，這裡有寵物等著你領樣: %s", profile.FirstName, profile.LastName, out))
	if err != nil {
		fmt.Println(err)
	}
	log.Printf("SendMsg: %+v", resp)
	resp2, err := mess.SendImageMessage(opts.Sender.ID, petObj.ImageName)
	log.Printf("SendImage: %+v, %s, ID=%s, gotMsg=%s", resp2, petObj.ImageName, opts.Sender.ID, msg.Text)
}
func MessageReceived ( event Event , opts MessageOpts , msg ReceivedMessage ) { profile , err := mess . GetProfile ( opts . Sender . ID ) if err != nil { fmt . Println ( err ) return } petObj := petsDB . GetNextPet ( ) log . Println ( " " , petObj ) out := fmt . Sprintf ( " O b .Note, petO b .Phone ) resp , err := mess . SendSimpleMessage ( opts . Sender . ID , fmt . Sprintf ( " i l .LastNa m e, out)) if err != nil { fmt . Println ( err ) } log . Printf ( " " , resp ) resp2 , err := mess . SendImageMessage ( opts . Sender . ID , petObj . ImageName ) log . Printf ( " " , resp2 , petObj . ImageName , opts . Sender . ID , msg . Text ) }
MessageReceived :Callback to handle when message received.
MessageReceived : Callback to handle when message received .
// log.Println("event:", event, " opt:", opts, " msg:", msg)