viberinterface

package
v0.0.0-...-9184b9a Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 1, 2023 License: MIT Imports: 6 Imported by: 4

Documentation

Index

Constants

View Source
const (
	TypeKeyboard      = "keyboard"
	ActionTypeOpenUrl = "open-url"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type BaseMessageToReceiver

type BaseMessageToReceiver struct {
	ViberAuth
	Receiver     string    `json:"receiver"`
	Sender       *PaSender `json:"sender,omitempty"`
	MessageType  string    `json:"type"`
	Keyboard     *Keyboard `json:"keyboard,omitempty"`
	TrackingData string    `json:"tracking_data,omitempty"`
}

func (BaseMessageToReceiver) Endpoint

func (BaseMessageToReceiver) Endpoint() string

func (*BaseMessageToReceiver) MarshalJSON

func (mj *BaseMessageToReceiver) MarshalJSON() ([]byte, error)

func (*BaseMessageToReceiver) MarshalJSONBuf

func (mj *BaseMessageToReceiver) MarshalJSONBuf(buf fflib.EncodingBuffer) error

func (*BaseMessageToReceiver) SetToken

func (m *BaseMessageToReceiver) SetToken(token string)

func (*BaseMessageToReceiver) SetType

func (m *BaseMessageToReceiver) SetType(mType string)

func (*BaseMessageToReceiver) UnmarshalJSON

func (uj *BaseMessageToReceiver) UnmarshalJSON(input []byte) error

func (*BaseMessageToReceiver) UnmarshalJSONFFLexer

func (uj *BaseMessageToReceiver) UnmarshalJSONFFLexer(fs *fflib.FFLexer, state fflib.FFParseState) error

type Button

type Button struct {
	// Button width in columns. Default is 6. Can be 1-6.
	Columns int `json:",omitempty"`

	// Button height in rows.
	// Can be 1 or 2.Default is 1.
	// Maximal number of keyboard rows is 12.
	Rows int `json:",omitempty"`

	// Background color of button. Valid color HEX value. Default: white
	BgColor string `json:",omitempty"`

	// Type of the background media: "picture" or "gif".
	// For picture - jpeg and png files are supported.
	// Max size: 500 kb, Default to "picture"
	BgMediaType string `json:",omitempty"`

	// URL for background media content (picture or GIF).
	// Will be placed with aspect to fill logic.
	BgMedia string `json:",omitempty"`

	// When true - animated background media (GIF) will loop continuously.
	// When false - animated background media will play once and stop.
	BgLoop      bool   `json:",omitempty"`
	ActionType  string `json:",omitempty"`
	ActionBody  string `json:",omitempty"`
	Image       string `json:",omitempty"`
	Text        string `json:",omitempty"`
	TextVAlign  string `json:",omitempty"` // Vertical alignment of the text: "top", "middle", "bottom". Default "middle"
	TextHAlign  string `json:",omitempty"` // Horizontal align of the text: "left", "center", "right". Default "center"
	TextOpacity int    `json:",omitempty"`
	TextSize    string `json:",omitempty"` // Text size out of 3 options: "small", "regular", "large". Default	"regular"
}

func (*Button) MarshalJSON

func (mj *Button) MarshalJSON() ([]byte, error)

func (*Button) MarshalJSONBuf

func (mj *Button) MarshalJSONBuf(buf fflib.EncodingBuffer) error

func (*Button) UnmarshalJSON

func (uj *Button) UnmarshalJSON(input []byte) error

func (*Button) UnmarshalJSONFFLexer

func (uj *Button) UnmarshalJSONFFLexer(fs *fflib.FFLexer, state fflib.FFParseState) error

type Callback

type Callback struct {
	CallbackBase
}

func (*Callback) MarshalJSON

func (mj *Callback) MarshalJSON() ([]byte, error)

func (*Callback) MarshalJSONBuf

func (mj *Callback) MarshalJSONBuf(buf fflib.EncodingBuffer) error

func (*Callback) UnmarshalJSON

func (uj *Callback) UnmarshalJSON(input []byte) error

func (*Callback) UnmarshalJSONFFLexer

func (uj *Callback) UnmarshalJSONFFLexer(fs *fflib.FFLexer, state fflib.FFParseState) error

type CallbackBase

type CallbackBase struct {
	Event     string `json:"event"`
	Timestamp int64  `json:"timestamp"`
}

func (*CallbackBase) MarshalJSON

func (mj *CallbackBase) MarshalJSON() ([]byte, error)

func (*CallbackBase) MarshalJSONBuf

func (mj *CallbackBase) MarshalJSONBuf(buf fflib.EncodingBuffer) error

func (*CallbackBase) UnmarshalJSON

func (uj *CallbackBase) UnmarshalJSON(input []byte) error

func (*CallbackBase) UnmarshalJSONFFLexer

func (uj *CallbackBase) UnmarshalJSONFFLexer(fs *fflib.FFLexer, state fflib.FFParseState) error

type CallbackOnConversationStarted

type CallbackOnConversationStarted struct {
	CallbackBase
	MessageToken int64        `json:"message_token"`
	Type         string       `json:"type"` // "open". Additional types may be added in the future.
	Context      string       `json:"context"`
	User         CallbackUser `json:"user"`
}
https://developers.viber.com/customer/en/portal/articles/2541267-callbacks?b_id=15145#conversation-started

Conversation opened event fires when a user opens a conversation with the PA for the first time (no conversation history with the PA), or when the conversation is opened using a deep link (See Deep link section for more information).

This event is not considered a subscribe event and doesn’t allow the PA to send messages to the user; however, it will allow sending one “welcome message” to the user.

Once a conversation_opened callback is received, the service will be able to respond with aJson containing same parameters as a send_message request. "auth_token" and "receiver" are not mandatory in this case.

Example response: {"sender": { "name": "yarden from the pa", "avatar": "http://avatar_url",}, tracking_data": "tracking data", "type": "picture", "text": "Photo description", "media":"http://www.images.com/img.jpg", "thumbnail": "http://www.images.com/thumb.jpg" }

func (*CallbackOnConversationStarted) MarshalJSON

func (mj *CallbackOnConversationStarted) MarshalJSON() ([]byte, error)

func (*CallbackOnConversationStarted) MarshalJSONBuf

func (mj *CallbackOnConversationStarted) MarshalJSONBuf(buf fflib.EncodingBuffer) error

func (*CallbackOnConversationStarted) UnmarshalJSON

func (uj *CallbackOnConversationStarted) UnmarshalJSON(input []byte) error

func (*CallbackOnConversationStarted) UnmarshalJSONFFLexer

func (uj *CallbackOnConversationStarted) UnmarshalJSONFFLexer(fs *fflib.FFLexer, state fflib.FFParseState) error

type CallbackOnDelivered

type CallbackOnDelivered CallbackOnUserIdBase

func (*CallbackOnDelivered) MarshalJSON

func (mj *CallbackOnDelivered) MarshalJSON() ([]byte, error)

func (*CallbackOnDelivered) MarshalJSONBuf

func (mj *CallbackOnDelivered) MarshalJSONBuf(buf fflib.EncodingBuffer) error

func (*CallbackOnDelivered) UnmarshalJSON

func (uj *CallbackOnDelivered) UnmarshalJSON(input []byte) error

func (*CallbackOnDelivered) UnmarshalJSONFFLexer

func (uj *CallbackOnDelivered) UnmarshalJSONFFLexer(fs *fflib.FFLexer, state fflib.FFParseState) error

type CallbackOnFailed

type CallbackOnFailed struct {
	CallbackOnUserIdBase
	Description string `json:"desc"`
}

func (*CallbackOnFailed) MarshalJSON

func (mj *CallbackOnFailed) MarshalJSON() ([]byte, error)

func (*CallbackOnFailed) MarshalJSONBuf

func (mj *CallbackOnFailed) MarshalJSONBuf(buf fflib.EncodingBuffer) error

func (*CallbackOnFailed) UnmarshalJSON

func (uj *CallbackOnFailed) UnmarshalJSON(input []byte) error

func (*CallbackOnFailed) UnmarshalJSONFFLexer

func (uj *CallbackOnFailed) UnmarshalJSONFFLexer(fs *fflib.FFLexer, state fflib.FFParseState) error

type CallbackOnMessage

type CallbackOnMessage struct {
	CallbackBase
	MessageToken int64          `json:"message_token"`
	Sender       CallbackSender `json:"sender"`
	Message      Message        `json:"message"`
}

func (*CallbackOnMessage) MarshalJSON

func (mj *CallbackOnMessage) MarshalJSON() ([]byte, error)

func (*CallbackOnMessage) MarshalJSONBuf

func (mj *CallbackOnMessage) MarshalJSONBuf(buf fflib.EncodingBuffer) error

func (*CallbackOnMessage) UnmarshalJSON

func (uj *CallbackOnMessage) UnmarshalJSON(input []byte) error

func (*CallbackOnMessage) UnmarshalJSONFFLexer

func (uj *CallbackOnMessage) UnmarshalJSONFFLexer(fs *fflib.FFLexer, state fflib.FFParseState) error

type CallbackOnSeen

type CallbackOnSeen CallbackOnUserIdBase

func (*CallbackOnSeen) MarshalJSON

func (mj *CallbackOnSeen) MarshalJSON() ([]byte, error)

func (*CallbackOnSeen) MarshalJSONBuf

func (mj *CallbackOnSeen) MarshalJSONBuf(buf fflib.EncodingBuffer) error

func (*CallbackOnSeen) UnmarshalJSON

func (uj *CallbackOnSeen) UnmarshalJSON(input []byte) error

func (*CallbackOnSeen) UnmarshalJSONFFLexer

func (uj *CallbackOnSeen) UnmarshalJSONFFLexer(fs *fflib.FFLexer, state fflib.FFParseState) error

type CallbackOnSubscribed

type CallbackOnSubscribed struct {
	CallbackBase
	User CallbackUser `json:"user"`
}

func (*CallbackOnSubscribed) MarshalJSON

func (mj *CallbackOnSubscribed) MarshalJSON() ([]byte, error)

func (*CallbackOnSubscribed) MarshalJSONBuf

func (mj *CallbackOnSubscribed) MarshalJSONBuf(buf fflib.EncodingBuffer) error

func (*CallbackOnSubscribed) UnmarshalJSON

func (uj *CallbackOnSubscribed) UnmarshalJSON(input []byte) error

func (*CallbackOnSubscribed) UnmarshalJSONFFLexer

func (uj *CallbackOnSubscribed) UnmarshalJSONFFLexer(fs *fflib.FFLexer, state fflib.FFParseState) error

type CallbackOnUnsubscribed

type CallbackOnUnsubscribed CallbackOnUserIdBase

func (*CallbackOnUnsubscribed) MarshalJSON

func (mj *CallbackOnUnsubscribed) MarshalJSON() ([]byte, error)

func (*CallbackOnUnsubscribed) MarshalJSONBuf

func (mj *CallbackOnUnsubscribed) MarshalJSONBuf(buf fflib.EncodingBuffer) error

func (*CallbackOnUnsubscribed) UnmarshalJSON

func (uj *CallbackOnUnsubscribed) UnmarshalJSON(input []byte) error

func (*CallbackOnUnsubscribed) UnmarshalJSONFFLexer

func (uj *CallbackOnUnsubscribed) UnmarshalJSONFFLexer(fs *fflib.FFLexer, state fflib.FFParseState) error

type CallbackOnUserIdBase

type CallbackOnUserIdBase struct {
	CallbackBase
	UserID string `json:"user_id"`
}

func (*CallbackOnUserIdBase) MarshalJSON

func (mj *CallbackOnUserIdBase) MarshalJSON() ([]byte, error)

func (*CallbackOnUserIdBase) MarshalJSONBuf

func (mj *CallbackOnUserIdBase) MarshalJSONBuf(buf fflib.EncodingBuffer) error

func (*CallbackOnUserIdBase) UnmarshalJSON

func (uj *CallbackOnUserIdBase) UnmarshalJSON(input []byte) error

func (*CallbackOnUserIdBase) UnmarshalJSONFFLexer

func (uj *CallbackOnUserIdBase) UnmarshalJSONFFLexer(fs *fflib.FFLexer, state fflib.FFParseState) error

type CallbackSender

type CallbackSender struct {
	ID     string `json:"id"`
	Name   string `json:"name"`
	Avatar string `json:"avatar"`
}

func (*CallbackSender) MarshalJSON

func (mj *CallbackSender) MarshalJSON() ([]byte, error)

func (*CallbackSender) MarshalJSONBuf

func (mj *CallbackSender) MarshalJSONBuf(buf fflib.EncodingBuffer) error

func (*CallbackSender) UnmarshalJSON

func (uj *CallbackSender) UnmarshalJSON(input []byte) error

func (*CallbackSender) UnmarshalJSONFFLexer

func (uj *CallbackSender) UnmarshalJSONFFLexer(fs *fflib.FFLexer, state fflib.FFParseState) error

type CallbackUser

type CallbackUser struct {
	CallbackSender
	Country  string `json:"country"`
	Language string `json:"language"`
}

func (*CallbackUser) MarshalJSON

func (mj *CallbackUser) MarshalJSON() ([]byte, error)

func (*CallbackUser) MarshalJSONBuf

func (mj *CallbackUser) MarshalJSONBuf(buf fflib.EncodingBuffer) error

func (*CallbackUser) UnmarshalJSON

func (uj *CallbackUser) UnmarshalJSON(input []byte) error

func (*CallbackUser) UnmarshalJSONFFLexer

func (uj *CallbackUser) UnmarshalJSONFFLexer(fs *fflib.FFLexer, state fflib.FFParseState) error

type Contact

type Contact struct {
	Name        string `json:"name"`
	PhoneNumber string `json:"phone_number"`
}

func (*Contact) MarshalJSON

func (mj *Contact) MarshalJSON() ([]byte, error)

func (*Contact) MarshalJSONBuf

func (mj *Contact) MarshalJSONBuf(buf fflib.EncodingBuffer) error

func (*Contact) UnmarshalJSON

func (uj *Contact) UnmarshalJSON(input []byte) error

func (*Contact) UnmarshalJSONFFLexer

func (uj *Contact) UnmarshalJSONFFLexer(fs *fflib.FFLexer, state fflib.FFParseState) error

type ContactMessage

type ContactMessage struct {
	BaseMessageToReceiver
	Contact Contact `json:"contact"`
	// contains filtered or unexported fields
}

func (ContactMessage) GetType

func (ContactMessage) GetType() string

func (*ContactMessage) MarshalJSON

func (mj *ContactMessage) MarshalJSON() ([]byte, error)

func (*ContactMessage) MarshalJSONBuf

func (mj *ContactMessage) MarshalJSONBuf(buf fflib.EncodingBuffer) error

func (*ContactMessage) UnmarshalJSON

func (uj *ContactMessage) UnmarshalJSON(input []byte) error

func (*ContactMessage) UnmarshalJSONFFLexer

func (uj *ContactMessage) UnmarshalJSONFFLexer(fs *fflib.FFLexer, state fflib.FFParseState) error

type FileMessage

type FileMessage struct {
	BaseMessageToReceiver
	Media    string `json:"media"`
	FileName string `json:"file_name"`
	Size     int    `json:"size"`
	// contains filtered or unexported fields
}

func (FileMessage) GetType

func (FileMessage) GetType() string

func (*FileMessage) MarshalJSON

func (mj *FileMessage) MarshalJSON() ([]byte, error)

func (*FileMessage) MarshalJSONBuf

func (mj *FileMessage) MarshalJSONBuf(buf fflib.EncodingBuffer) error

func (*FileMessage) UnmarshalJSON

func (uj *FileMessage) UnmarshalJSON(input []byte) error

func (*FileMessage) UnmarshalJSONFFLexer

func (uj *FileMessage) UnmarshalJSONFFLexer(fs *fflib.FFLexer, state fflib.FFParseState) error

type Keyboard

type Keyboard struct {
	Type    string
	Buttons []Button

	// Background color of the keyboard.	Valid color HEX value.	By default Viber keyboard background.
	BgColor string `json:",omitempty"`

	// When true - the keyboard will always be displayed with the same height as the native keyboard.
	// When false - short keyboards will be displayed with the minimal possible height.
	// Maximal height will be native keyboard height.
	DefaultHeight bool `json:",omitempty"` // Default: false
}

func NewKeyboard

func NewKeyboard(BgColor string, DefaultHeight bool, Buttons ...Button) *Keyboard

func (*Keyboard) KeyboardType

func (*Keyboard) KeyboardType() bots.KeyboardType

func (*Keyboard) MarshalJSON

func (mj *Keyboard) MarshalJSON() ([]byte, error)

func (*Keyboard) MarshalJSONBuf

func (mj *Keyboard) MarshalJSONBuf(buf fflib.EncodingBuffer) error

func (*Keyboard) UnmarshalJSON

func (uj *Keyboard) UnmarshalJSON(input []byte) error

func (*Keyboard) UnmarshalJSONFFLexer

func (uj *Keyboard) UnmarshalJSONFFLexer(fs *fflib.FFLexer, state fflib.FFParseState) error

type KeyboardMessage

type KeyboardMessage struct {
	BaseMessageToReceiver
	// contains filtered or unexported fields
}

func NewKeyboardMessage

func NewKeyboardMessage(receiver, trackingData string, keyboard *Keyboard) *KeyboardMessage

func (KeyboardMessage) GetType

func (KeyboardMessage) GetType() string

func (*KeyboardMessage) MarshalJSON

func (mj *KeyboardMessage) MarshalJSON() ([]byte, error)

func (*KeyboardMessage) MarshalJSONBuf

func (mj *KeyboardMessage) MarshalJSONBuf(buf fflib.EncodingBuffer) error

func (*KeyboardMessage) UnmarshalJSON

func (uj *KeyboardMessage) UnmarshalJSON(input []byte) error

func (*KeyboardMessage) UnmarshalJSONFFLexer

func (uj *KeyboardMessage) UnmarshalJSONFFLexer(fs *fflib.FFLexer, state fflib.FFParseState) error

type Location

type Location struct {
	Lat string `json:"lat"`
	Lon string `json:"lon"`
}

func (*Location) MarshalJSON

func (mj *Location) MarshalJSON() ([]byte, error)

func (*Location) MarshalJSONBuf

func (mj *Location) MarshalJSONBuf(buf fflib.EncodingBuffer) error

func (*Location) UnmarshalJSON

func (uj *Location) UnmarshalJSON(input []byte) error

func (*Location) UnmarshalJSONFFLexer

func (uj *Location) UnmarshalJSONFFLexer(fs *fflib.FFLexer, state fflib.FFParseState) error

type LocationMessage

type LocationMessage struct {
	BaseMessageToReceiver
	Location Location `json:"location"`
	// contains filtered or unexported fields
}

func (LocationMessage) GetType

func (LocationMessage) GetType() string

func (*LocationMessage) MarshalJSON

func (mj *LocationMessage) MarshalJSON() ([]byte, error)

func (*LocationMessage) MarshalJSONBuf

func (mj *LocationMessage) MarshalJSONBuf(buf fflib.EncodingBuffer) error

func (*LocationMessage) UnmarshalJSON

func (uj *LocationMessage) UnmarshalJSON(input []byte) error

func (*LocationMessage) UnmarshalJSONFFLexer

func (uj *LocationMessage) UnmarshalJSONFFLexer(fs *fflib.FFLexer, state fflib.FFParseState) error

type Message

type Message struct {
	Type         string    `json:"type"`
	TrackingData string    `json:"tracking_data"`
	Text         string    `json:"text"`
	Media        string    `json:"media"`
	Location     *Location `json:"location"`
	Contact      *Contact  `json:"contact"`
}

func (*Message) MarshalJSON

func (mj *Message) MarshalJSON() ([]byte, error)

func (*Message) MarshalJSONBuf

func (mj *Message) MarshalJSONBuf(buf fflib.EncodingBuffer) error

func (*Message) UnmarshalJSON

func (uj *Message) UnmarshalJSON(input []byte) error

func (*Message) UnmarshalJSONFFLexer

func (uj *Message) UnmarshalJSONFFLexer(fs *fflib.FFLexer, state fflib.FFParseState) error

type MessageToReceiver

type MessageToReceiver interface {
	MessageToViberEndpoint

	GetType() string
	SetType(mType string)
	SetToken(token string)
	// contains filtered or unexported methods
}

type MessageToViberEndpoint

type MessageToViberEndpoint interface {
	Endpoint() string
	// contains filtered or unexported methods
}

type PaSender

type PaSender struct {
	Name   string `json:"name"`
	Avatar string `json:"avatar"`
}

func (*PaSender) MarshalJSON

func (mj *PaSender) MarshalJSON() ([]byte, error)

func (*PaSender) MarshalJSONBuf

func (mj *PaSender) MarshalJSONBuf(buf fflib.EncodingBuffer) error

func (*PaSender) UnmarshalJSON

func (uj *PaSender) UnmarshalJSON(input []byte) error

func (*PaSender) UnmarshalJSONFFLexer

func (uj *PaSender) UnmarshalJSONFFLexer(fs *fflib.FFLexer, state fflib.FFParseState) error

type PictureMessage

type PictureMessage struct {
	TextMessage
	Media     string `json:"media"`
	Thumbnail string `json:"thumbnail"`
}

func (PictureMessage) GetType

func (PictureMessage) GetType() string

func (*PictureMessage) MarshalJSON

func (mj *PictureMessage) MarshalJSON() ([]byte, error)

func (*PictureMessage) MarshalJSONBuf

func (mj *PictureMessage) MarshalJSONBuf(buf fflib.EncodingBuffer) error

func (*PictureMessage) UnmarshalJSON

func (uj *PictureMessage) UnmarshalJSON(input []byte) error

func (*PictureMessage) UnmarshalJSONFFLexer

func (uj *PictureMessage) UnmarshalJSONFFLexer(fs *fflib.FFLexer, state fflib.FFParseState) error

type SendMessageResponse

type SendMessageResponse struct {
	Status        int    `json:"status"` // 0 for success, otherwise failure
	StatusMessage string `json:"status_message"`
	MessageToken  int64  `json:"message_token"` // Unique ID of the message
}

https://developers.viber.com/customer/en/portal/articles/2632255-send-message?b_id=15145#send-message-response

func (*SendMessageResponse) MarshalJSON

func (mj *SendMessageResponse) MarshalJSON() ([]byte, error)

func (*SendMessageResponse) MarshalJSONBuf

func (mj *SendMessageResponse) MarshalJSONBuf(buf fflib.EncodingBuffer) error

func (*SendMessageResponse) UnmarshalJSON

func (uj *SendMessageResponse) UnmarshalJSON(input []byte) error

func (*SendMessageResponse) UnmarshalJSONFFLexer

func (uj *SendMessageResponse) UnmarshalJSONFFLexer(fs *fflib.FFLexer, state fflib.FFParseState) error

type SetWebhookMessage

type SetWebhookMessage struct {
	ViberAuth
	Url        string   `json:"url"`
	EventTypes []string `json:"event_types,omitempty"`
	// contains filtered or unexported fields
}

func (SetWebhookMessage) Endpoint

func (SetWebhookMessage) Endpoint() string

func (*SetWebhookMessage) MarshalJSON

func (mj *SetWebhookMessage) MarshalJSON() ([]byte, error)

func (*SetWebhookMessage) MarshalJSONBuf

func (mj *SetWebhookMessage) MarshalJSONBuf(buf fflib.EncodingBuffer) error

func (*SetWebhookMessage) UnmarshalJSON

func (uj *SetWebhookMessage) UnmarshalJSON(input []byte) error

func (*SetWebhookMessage) UnmarshalJSONFFLexer

func (uj *SetWebhookMessage) UnmarshalJSONFFLexer(fs *fflib.FFLexer, state fflib.FFParseState) error

type SetWebhookResponse

type SetWebhookResponse struct {
	Status        int      `json:"status"`
	StatusMessage string   `json:"status_message"`
	EventTypes    []string `json:"event_types,omitempty"`
}

func (*SetWebhookResponse) MarshalJSON

func (mj *SetWebhookResponse) MarshalJSON() ([]byte, error)

func (*SetWebhookResponse) MarshalJSONBuf

func (mj *SetWebhookResponse) MarshalJSONBuf(buf fflib.EncodingBuffer) error

func (*SetWebhookResponse) UnmarshalJSON

func (uj *SetWebhookResponse) UnmarshalJSON(input []byte) error

func (*SetWebhookResponse) UnmarshalJSONFFLexer

func (uj *SetWebhookResponse) UnmarshalJSONFFLexer(fs *fflib.FFLexer, state fflib.FFParseState) error

type StickerMessage

type StickerMessage struct {
	BaseMessageToReceiver
	StickerID string `json:"sticker_id"`
	// contains filtered or unexported fields
}

func (StickerMessage) GetType

func (StickerMessage) GetType() string

func (*StickerMessage) MarshalJSON

func (mj *StickerMessage) MarshalJSON() ([]byte, error)

func (*StickerMessage) MarshalJSONBuf

func (mj *StickerMessage) MarshalJSONBuf(buf fflib.EncodingBuffer) error

func (*StickerMessage) UnmarshalJSON

func (uj *StickerMessage) UnmarshalJSON(input []byte) error

func (*StickerMessage) UnmarshalJSONFFLexer

func (uj *StickerMessage) UnmarshalJSONFFLexer(fs *fflib.FFLexer, state fflib.FFParseState) error

type TextMessage

type TextMessage struct {
	BaseMessageToReceiver
	Text string `json:"text"`
	// contains filtered or unexported fields
}

func NewTextMessage

func NewTextMessage(receiver, trackingData, text string, keyboard *Keyboard) *TextMessage

func (TextMessage) GetType

func (TextMessage) GetType() string

func (*TextMessage) MarshalJSON

func (mj *TextMessage) MarshalJSON() ([]byte, error)

func (*TextMessage) MarshalJSONBuf

func (mj *TextMessage) MarshalJSONBuf(buf fflib.EncodingBuffer) error

func (*TextMessage) UnmarshalJSON

func (uj *TextMessage) UnmarshalJSON(input []byte) error

func (*TextMessage) UnmarshalJSONFFLexer

func (uj *TextMessage) UnmarshalJSONFFLexer(fs *fflib.FFLexer, state fflib.FFParseState) error

type UrlMessage

type UrlMessage struct {
	BaseMessageToReceiver
	Media string `json:"media"`
	// contains filtered or unexported fields
}

func (UrlMessage) GetType

func (UrlMessage) GetType() string

func (*UrlMessage) MarshalJSON

func (mj *UrlMessage) MarshalJSON() ([]byte, error)

func (*UrlMessage) MarshalJSONBuf

func (mj *UrlMessage) MarshalJSONBuf(buf fflib.EncodingBuffer) error

func (*UrlMessage) UnmarshalJSON

func (uj *UrlMessage) UnmarshalJSON(input []byte) error

func (*UrlMessage) UnmarshalJSONFFLexer

func (uj *UrlMessage) UnmarshalJSONFFLexer(fs *fflib.FFLexer, state fflib.FFParseState) error

type ViberAuth

type ViberAuth struct {
	Token string `json:"auth_token"`
}

func (*ViberAuth) MarshalJSON

func (mj *ViberAuth) MarshalJSON() ([]byte, error)

func (*ViberAuth) MarshalJSONBuf

func (mj *ViberAuth) MarshalJSONBuf(buf fflib.EncodingBuffer) error

func (*ViberAuth) UnmarshalJSON

func (uj *ViberAuth) UnmarshalJSON(input []byte) error

func (*ViberAuth) UnmarshalJSONFFLexer

func (uj *ViberAuth) UnmarshalJSONFFLexer(fs *fflib.FFLexer, state fflib.FFParseState) error

type VideoMessage

type VideoMessage struct {
	PictureMessage
	Size     int `json:"size"`
	Duration int `json:"duration"`
	// contains filtered or unexported fields
}

func (VideoMessage) GetType

func (VideoMessage) GetType() string

func (*VideoMessage) MarshalJSON

func (mj *VideoMessage) MarshalJSON() ([]byte, error)

func (*VideoMessage) MarshalJSONBuf

func (mj *VideoMessage) MarshalJSONBuf(buf fflib.EncodingBuffer) error

func (*VideoMessage) UnmarshalJSON

func (uj *VideoMessage) UnmarshalJSON(input []byte) error

func (*VideoMessage) UnmarshalJSONFFLexer

func (uj *VideoMessage) UnmarshalJSONFFLexer(fs *fflib.FFLexer, state fflib.FFParseState) error

type WebhookCallback

type WebhookCallback struct {
	Event        string `json:"event"`         // Callback type – which event triggered the callback: webhook
	Timestamp    int    `json:"timestamp"`     // Epoch time of the event that triggered the callback
	MessageToken int64  `json:"message_token"` // Unique ID of the message
}

func (*WebhookCallback) MarshalJSON

func (mj *WebhookCallback) MarshalJSON() ([]byte, error)

func (*WebhookCallback) MarshalJSONBuf

func (mj *WebhookCallback) MarshalJSONBuf(buf fflib.EncodingBuffer) error

func (*WebhookCallback) UnmarshalJSON

func (uj *WebhookCallback) UnmarshalJSON(input []byte) error

func (*WebhookCallback) UnmarshalJSONFFLexer

func (uj *WebhookCallback) UnmarshalJSONFFLexer(fs *fflib.FFLexer, state fflib.FFParseState) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL