Skip to content

Commit

Permalink
Remove test function
Browse files Browse the repository at this point in the history
  • Loading branch information
mileusna committed Jul 14, 2017
1 parent 6398507 commit aecec67
Showing 1 changed file with 1 addition and 68 deletions.
69 changes: 1 addition & 68 deletions message.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
package viber

import (
"encoding/json"
"fmt"
)
import "encoding/json"

/*
{
Expand Down Expand Up @@ -156,70 +153,6 @@ func (v *Viber) SendPictureMessage(receiver string, msg string, url string, thum
return v.SendMessage(receiver, v.NewPictureMessage(msg, url, thumbURL))
}

func (v *Viber) sendCarousel(receiver string) {
r := RichMediaMessage{
MinAPIVersion: 2,
Receiver: receiver,
AuthToken: v.AppKey,
Type: TypeRichMediaMessage,
RichMedia: RichMedia{
Type: "rich_media",
ButtonsGroupColumns: 6,
ButtonsGroupRows: 6,
BgColor: "#FFFFFF",
},
}

b1 := Button{
Columns: 6,
Rows: 3,
ActionType: OpenURL,
ActionBody: "https://aviokarte.rs/",
Image: "http://nstatic.net/beta/2b5b3ff1972f61d9bcfaaddd061aa1b9.jpg",
}
r.RichMedia.Buttons = append(r.RichMedia.Buttons, b1)

b1 = Button{
Columns: 6,
Rows: 2,
ActionType: OpenURL,
ActionBody: "https://aviokarte.rs/",
Text: "Košarkaši Crvene zvezde odbranili titulu šampiona Srbije",
}
r.RichMedia.Buttons = append(r.RichMedia.Buttons, b1)

b1 = Button{
Columns: 3,
Rows: 1,
ActionType: Reply,
ActionBody: "ID: 21432323",
Text: "<font color=#ffffff>Otvori</font>",
TextSize: Large,
TextVAlign: Middle,
TextHAlign: Center,
Image: "https://s14.postimg.org/4mmt4rw1t/Button.png",
}
r.RichMedia.Buttons = append(r.RichMedia.Buttons, b1)

// b2 := Button{

// Columns: 6,
// Rows: 6,
// ActionType: "reply",
// ActionBody: "https://aviokarte.rs/",
// Image: "https://aviokarte.rs/images/logo.png",
// Text: "Drugi tekst",
// TextSize: "large",
// TextVAlign: "middle",
// TextHAlign: "left",
// }
// r.RichMedia.Buttons = append(r.RichMedia.Buttons, b2)

resp, err := v.PostData("https://chatapi.viber.com/pa/send_message", r)
fmt.Println(string(resp), err)

}

// SendPublicMessage from public account
func (v *Viber) SendPublicMessage(from string, m Message) (msgToken uint64, err error) {
// text, picture, video, file, location, contact, sticker and url
Expand Down

0 comments on commit aecec67

Please sign in to comment.