Versions in this module Expand all Collapse all v1 v1.0.4 Feb 27, 2021 v1.0.3 Feb 27, 2021 Changes in this version type Button + Frame *Frame + TextPaddings []int8 + TextShouldFit bool + type Frame struct + BorderColor string + BorderWidth int + CornerRadius int type Keyboard + CustomDefaultHeight int + HeightScale int + type Logger interface + Debug func(string, ...interface{}) + Error func(string, ...interface{}) + Info func(string, ...interface{}) + Warn func(string, ...interface{}) + func NewDefaultLogger(w io.Writer) Logger type Viber + Logger Logger v1.0.0 Jun 4, 2018 Changes in this version + const Bottom + const Center + const Large + const Left + const Medium + const Middle + const None + const OpenURL + const Regular + const Reply + const Right + const Small + const Top + const TypeContactMessage + const TypeFileMessage + const TypeLocationMessage + const TypePictureMessage + const TypeRichMediaMessage + const TypeStickerMessage + const TypeTextMessage + const TypeURLMessage + const TypeVideoMessage + var Log = log.New(ioutil.Discard, "Viber >>", 0) + func ErrorStatus(e interface{}) int + type Account struct + Background string + Category string + Country string + EventTypes []string + ID string + Icon string + Location struct{ ... } + Members []Member + Name string + Status int + StatusMessage string + Subcategory string + SubscribersCount int + URI string + Webhook string + type ActionType string + type Button struct + ActionBody string + ActionType ActionType + BgColor string + BgLoop bool + BgMedia string + BgMediaType string + Columns int + Image string + Rows int + Silent bool + Text string + TextBgGradientColor string + TextHAlign TextHAlign + TextOpacity int8 + TextSize TextSize + TextVAlign TextVAlign + func (b *Button) BgMediaGIF(gifURL string, loop bool) *Button + func (b *Button) BgMediaPicture(picURL string) *Button + func (b *Button) SetBgColor(hex string) *Button + func (b *Button) SetSilent() *Button + func (b *Button) SetTextOpacity(o int8) *Button + func (b *Button) TextHAlignCenter() *Button + func (b *Button) TextHAlignLeft() *Button + func (b *Button) TextHAlignRight() *Button + func (b *Button) TextSizeLarge() *Button + func (b *Button) TextSizeMedium() *Button + func (b *Button) TextSizeRegular() *Button + func (b *Button) TextSizeSmall() *Button + func (b *Button) TextVAlignBottom() *Button + func (b *Button) TextVAlignMiddle() *Button + func (b *Button) TextVAlignTop() *Button + type Error struct + Status int + StatusMessage string + func (e Error) Error() string + type Keyboard struct + BgColor string + Buttons []Button + DefaultHeight bool + Type string + func (k *Keyboard) AddButton(b *Button) + type Member struct + Avatar string + ID string + Name string + Role string + type Message interface + SetFrom func(from string) + SetKeyboard func(k *Keyboard) + SetReceiver func(r string) + type MessageType string + type PictureMessage struct + Media string + Thumbnail string + type RichMedia struct + BgColor string + Buttons []Button + ButtonsGroupColumns int + ButtonsGroupRows int + Type MessageType + type RichMediaMessage struct + AltText string + AuthToken string + Keyboard *Keyboard + MinAPIVersion int + Receiver string + RichMedia RichMedia + TrackingData string + Type MessageType + func (rm *RichMediaMessage) AddButton(b *Button) + func (rm *RichMediaMessage) SetFrom(from string) + func (rm *RichMediaMessage) SetKeyboard(k *Keyboard) + func (rm *RichMediaMessage) SetReceiver(r string) + type Sender struct + Avatar string + Name string + type TextHAlign string + type TextMessage struct + From string + Keyboars *Keyboard + MinAPIVersion uint + Receiver string + Sender Sender + Text string + TrackingData string + Type MessageType + func (m *TextMessage) SetFrom(from string) + func (m *TextMessage) SetKeyboard(k *Keyboard) + func (m *TextMessage) SetReceiver(r string) + type TextSize string + type TextVAlign string + type Timestamp struct + func (t *Timestamp) MarshalJSON() ([]byte, error) + func (t *Timestamp) UnmarshalJSON(b []byte) error + type URLMessage struct + Media string + type User struct + APIVersion int + Avatar string + Country string + DeviceType string + ID string + Language string + Mcc int + Mnc int + Name string + PrimaryDeviceOs string + ViberVersion string + type UserDetails struct + MessageToken int64 + Status int + StatusMessage string + type UserOnline struct + ID string + LastOnline int64 + OnlineStatus int + OnlineStatusMessage string + type Viber struct + AppKey string + ConversationStarted func(v *Viber, u User, conversationType, context string, subscribed bool, ...) Message + Delivered func(v *Viber, userID string, token uint64, t time.Time) + Failed func(v *Viber, userID string, token uint64, descr string, t time.Time) + Message func(v *Viber, u User, m Message, token uint64, t time.Time) + Seen func(v *Viber, userID string, token uint64, t time.Time) + Sender Sender + Subscribed func(v *Viber, u User, token uint64, t time.Time) + Unsubscribed func(v *Viber, userID string, token uint64, t time.Time) + func New(appKey, senderName, senderAvatar string) *Viber + func (v *Viber) AccountInfo() (Account, error) + func (v *Viber) NewButton(cols, rows int, typ ActionType, actionBody string, text, image string) *Button + func (v *Viber) NewImageButton(cols, rows int, typ ActionType, actionBody string, image string) *Button + func (v *Viber) NewKeyboard(bgcolor string, defaultHeight bool) *Keyboard + func (v *Viber) NewPictureMessage(msg string, url string, thumbURL string) *PictureMessage + func (v *Viber) NewRichMediaMessage(cols, rows int, bgColor string) *RichMediaMessage + func (v *Viber) NewTextButton(cols, rows int, t ActionType, actionBody, text string) *Button + func (v *Viber) NewTextMessage(msg string) *TextMessage + func (v *Viber) NewURLMessage(msg string, url string) *URLMessage + func (v *Viber) PostData(url string, i interface{}) ([]byte, error) + func (v *Viber) SendMessage(to string, m Message) (msgToken uint64, err error) + func (v *Viber) SendPictureMessage(receiver string, msg string, url string, thumbURL string) (token uint64, err error) + func (v *Viber) SendPublicMessage(from string, m Message) (msgToken uint64, err error) + func (v *Viber) SendTextMessage(receiver string, msg string) (msgToken uint64, err error) + func (v *Viber) SendURLMessage(receiver string, msg string, url string) (msgToken uint64, err error) + func (v *Viber) ServeHTTP(w http.ResponseWriter, r *http.Request) + func (v *Viber) SetRequestTimeout(t time.Duration) + func (v *Viber) SetWebhook(url string, eventTypes []string) (WebhookResp, error) + func (v *Viber) UserDetails(id string) (UserDetails, error) + func (v *Viber) UserOnline(ids []string) ([]UserOnline, error) + type VideoMessage struct + Duration uint + Media string + Size uint + Thumbnail string + type WebhookReq struct + EventTypes []string + URL string + type WebhookResp struct + EventTypes []string + Status int + StatusMessage string + type WebhookVerify struct + Event string + MessageToken uint64 + Timestamp uint64