Skip to content

Commit

Permalink
Merge pull request #1 from Foxcool/patch-1
Browse files Browse the repository at this point in the history
Fixed not working example in Readme.md
  • Loading branch information
mileusna authored Jun 1, 2018
2 parents 59bf1b4 + bef7ff2 commit adce03a
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -180,19 +180,19 @@ func main() {
// myMsgReceivedFunc will be called everytime when user send us a message
func myMsgReceivedFunc(v *viber.Viber, u viber.User, m viber.Message, token uint64, t time.Time) {
switch m.(type) {

case *viber.TextMessage:
v.SendTextMessage(u.ID, "Thank you for your message")
txt := m.(viber.TextMessage).Text
v.SendTextMessage(u.ID, "This is the text you have sent to me " + txt)
txt := m.(*viber.TextMessage).Text
v.SendTextMessage(u.ID, "This is the text you have sent to me "+txt)

case *viber.URLMessage:
url := m.(*viber.URLMessage).Media)
v.SendTextMessage(u.ID, "You have sent me an interesting link " + url)
case *viber.ImageMessage:
url := m.(*viber.URLMessage).Media
v.SendTextMessage(u.ID, "You have sent me an interesting link "+url)

case *viber.PictureMessage:
v.SendTextMessage(u.ID, "Nice pic!")

}
}

Expand Down

0 comments on commit adce03a

Please sign in to comment.