Documentation ¶
Index ¶
- Constants
- func NewViberBot(mode strongo.Environment, profile, code, token, gaToken string, ...) bots.BotSettings
- func NewViberWebhookHandler(botsBy bots.SettingsProvider, translatorProvider bots.TranslatorProvider) bots.WebhookHandler
- type Platform
- type Sender
- type UserChatEntity
- type WebhookEntry
- type WebhookInputConversationStarted
- func (whi WebhookInputConversationStarted) BotChatID() (string, error)
- func (whi WebhookInputConversationStarted) Chat() bots.WebhookChat
- func (whi WebhookInputConversationStarted) GetContext() string
- func (whi WebhookInputConversationStarted) GetRecipient() bots.WebhookRecipient
- func (whi WebhookInputConversationStarted) GetSender() bots.WebhookSender
- func (whi WebhookInputConversationStarted) GetTime() time.Time
- func (whi WebhookInputConversationStarted) InputType() bots.WebhookInputType
- func (WebhookInputConversationStarted) LogRequest()
Constants ¶
const PlatformID = "viber"
PlatformID is 'viber'
const (
// UserChatKind is user chat kind name
UserChatKind = "ViberUserChat"
)
Variables ¶
This section is empty.
Functions ¶
func NewViberBot ¶
func NewViberBot(mode strongo.Environment, profile, code, token, gaToken string, locale strongo.Locale) bots.BotSettings
NewViberBot creates definition of Viber bot
func NewViberWebhookHandler ¶
func NewViberWebhookHandler(botsBy bots.SettingsProvider, translatorProvider bots.TranslatorProvider) bots.WebhookHandler
NewViberWebhookHandler creates new Viber webhook handler
Types ¶
type Sender ¶
type Sender struct {
// contains filtered or unexported fields
}
Sender sends messages to Viber
func (Sender) GetFirstName ¶
GetFirstName returns first name of Viber user
func (Sender) GetLastName ¶
GetLastName returns last name of Viber user
func (Sender) GetUserName ¶
GetUserName returns nickname of Viber user
type UserChatEntity ¶
type UserChatEntity struct {
bots.BotChatEntity
}
UserChatEntity is bot chat entity for Viber
func (*UserChatEntity) SetAppUserIntID ¶
func (chat *UserChatEntity) SetAppUserIntID(id int64)
SetAppUserIntID sets app user int ID
func (*UserChatEntity) SetBotUserID ¶
func (chat *UserChatEntity) SetBotUserID(id interface{})
SetBotUserID sets bot user ID
type WebhookEntry ¶
type WebhookEntry struct {
// contains filtered or unexported fields
}
WebhookEntry base struct for Viber entities
func (WebhookEntry) LogRequest ¶
func (WebhookEntry) LogRequest()
LogRequest logs request (not implemented yet)
type WebhookInputConversationStarted ¶
type WebhookInputConversationStarted struct {
// contains filtered or unexported fields
}
WebhookInputConversationStarted is Viber message for new conversation
func (WebhookInputConversationStarted) BotChatID ¶
func (whi WebhookInputConversationStarted) BotChatID() (string, error)
BotChatID returns Viber chat ID
func (WebhookInputConversationStarted) Chat ¶
func (whi WebhookInputConversationStarted) Chat() bots.WebhookChat
Chat returns Viber chat wrapper
func (WebhookInputConversationStarted) GetContext ¶
func (whi WebhookInputConversationStarted) GetContext() string
GetContext returns context of the message
func (WebhookInputConversationStarted) GetRecipient ¶
func (whi WebhookInputConversationStarted) GetRecipient() bots.WebhookRecipient
GetRecipient return addressed receiver of the message
func (WebhookInputConversationStarted) GetSender ¶
func (whi WebhookInputConversationStarted) GetSender() bots.WebhookSender
GetSender returns sender
func (WebhookInputConversationStarted) InputType ¶
func (whi WebhookInputConversationStarted) InputType() bots.WebhookInputType
InputType returns WebhookInputConversationStarted
func (WebhookInputConversationStarted) LogRequest ¶
func (WebhookInputConversationStarted) LogRequest()
LogRequest logs request (not implemented yet)