viber

package
Version: v0.0.0-...-89493d8 Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2018 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const PlatformID = "viber"

PlatformID is 'viber'

View Source
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 Platform

type Platform struct {
}

Platform describes Viber bot platform

func (Platform) ID

func (p Platform) ID() string

ID return ID of Viber platform

func (Platform) Version

func (p Platform) Version() string

Version return supported version of Viber API

type Sender

type Sender struct {
	// contains filtered or unexported fields
}

Sender sends messages to Viber

func (Sender) GetAvatar

func (s Sender) GetAvatar() string

GetAvatar returns avatar URL

func (Sender) GetFirstName

func (s Sender) GetFirstName() string

GetFirstName returns first name of Viber user

func (Sender) GetID

func (s Sender) GetID() interface{}

GetID returns ID of Viber user

func (Sender) GetLanguage

func (Sender) GetLanguage() string

GetLanguage is not implemented yet

func (Sender) GetLastName

func (s Sender) GetLastName() string

GetLastName returns last name of Viber user

func (Sender) GetUserName

func (s Sender) GetUserName() string

GetUserName returns nickname of Viber user

func (Sender) IsBotUser

func (Sender) IsBotUser() bool

IsBotUser returns true if message sent by a bot, always false for Viber

func (Sender) Platform

func (Sender) Platform() string

Platform returns 'viber'

type UserChatEntity

type UserChatEntity struct {
	bots.BotChatEntity
}

UserChatEntity is bot chat entity for Viber

func NewUserChat

func NewUserChat() UserChatEntity

NewUserChat creates new UserChatEntity

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) GetID

func (whe WebhookEntry) GetID() interface{}

GetID is not implemented

func (WebhookEntry) GetTime

func (whi WebhookEntry) GetTime() time.Time

GetTime returns sent time of the message

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) GetTime

func (whi WebhookInputConversationStarted) GetTime() time.Time

GetTime returns sent time of the message

func (WebhookInputConversationStarted) InputType

func (whi WebhookInputConversationStarted) InputType() bots.WebhookInputType

InputType returns WebhookInputConversationStarted

func (WebhookInputConversationStarted) LogRequest

func (WebhookInputConversationStarted) LogRequest()

LogRequest logs request (not implemented yet)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL