Careteam extends Base
Table of Contents
Constants
- BOT_CODE = 'careteam'
- BOT_COLOR = 'AZURE'
- BOT_GENDER = 'F'
- MODULE_ID = 'imbot'
Methods
- addError() : void
- getBotId() : int
- Returns registered bot Id.
- getError() : Error
- hasError() : bool
- Tells true if error has occurred.
- isEnabled() : bool
- Is bot enabled.
- onAnswerAdd() : array<string|int, mixed>
- Event handler on answer add.
- onBotDelete() : bool
- Event handler on bot remove.
- onChatStart() : bool
- Event handler when bot join to chat.
- onCommandAdd() : bool
- Event handler on command add.
- onCommandLang() : bool|array<string|int, mixed>
- Returns title and description for app or command list.
- onMessageAdd() : bool
- Event handler on message add.
- register() : int
- Register bot at portal.
- setBotId() : bool
- Saves new Id of the registered bot.
- unRegister() : bool
- Unregister bot at portal.
- uploadAvatar() : array<string|int, mixed>|bool|string
- uploadIcon() : bool|int
Constants
BOT_CODE
public
mixed
BOT_CODE
= 'careteam'
BOT_COLOR
public
mixed
BOT_COLOR
= 'AZURE'
BOT_GENDER
public
mixed
BOT_GENDER
= 'F'
MODULE_ID
public
mixed
MODULE_ID
= 'imbot'
Methods
addError()
public
static addError(Error $error) : void
Parameters
- $error : Error
getBotId()
Returns registered bot Id.
public
static getBotId() : int
Return values
intgetError()
public
static getError() : Error
Return values
ErrorhasError()
Tells true if error has occurred.
public
static hasError() : bool
Return values
boolisEnabled()
Is bot enabled.
public
static isEnabled() : bool
Return values
boolonAnswerAdd()
Event handler on answer add.
public
static onAnswerAdd(string $command, array<string|int, mixed> $params) : array<string|int, mixed>
Parameters
- $command : string
- $params : array<string|int, mixed>
Return values
array<string|int, mixed>onBotDelete()
Event handler on bot remove.
public
static onBotDelete([int|null $bodId = null ]) : bool
Parameters
- $bodId : int|null = null
Return values
boolonChatStart()
Event handler when bot join to chat.
public
static onChatStart(string $dialogId, array<string|int, mixed> $joinFields) : bool
Parameters
- $dialogId : string
- $joinFields : array<string|int, mixed>
Return values
boolonCommandAdd()
Event handler on command add.
public
static onCommandAdd(mixed $messageId, mixed $messageFields) : bool
Parameters
- $messageId : mixed
- $messageFields : mixed
Return values
boolonCommandLang()
Returns title and description for app or command list.
public
static onCommandLang(string $command[, string $lang = null ]) : bool|array<string|int, mixed>
Parameters
- $command : string
-
App or command code.
- $lang : string = null
-
Language Id.
Return values
bool|array<string|int, mixed>onMessageAdd()
Event handler on message add.
public
static onMessageAdd(mixed $messageId, mixed $messageFields) : bool
Parameters
- $messageId : mixed
- $messageFields : mixed
Return values
boolregister()
Register bot at portal.
public
static register([array<string|int, mixed> $params = [] ]) : int
Parameters
- $params : array<string|int, mixed> = []
Return values
intsetBotId()
Saves new Id of the registered bot.
public
static setBotId(int $id) : bool
Parameters
- $id : int
Return values
boolunRegister()
Unregister bot at portal.
public
static unRegister() : bool
Return values
booluploadAvatar()
public
static uploadAvatar([string $lang = LANGUAGE_ID ]) : array<string|int, mixed>|bool|string
Parameters
- $lang : string = LANGUAGE_ID
Return values
array<string|int, mixed>|bool|stringuploadIcon()
public
static uploadIcon(mixed $iconName) : bool|int
Parameters
- $iconName : mixed