Bitrix API

Marta extends Base

Table of Contents

Constants

BOT_CODE  = "marta"
EDIT_PHRASE  = '*EDIT*'
MODULE_ID  = "imbot"

Methods

addError()  : void
addPlannerMessageAgent()  : mixed
addRenameMessageAgent()  : mixed
addWelcomeMessageAgent()  : mixed
delayRegister()  : string
Agent for deferred bot registration.
getBotId()  : int
Returns registered bot Id.
getError()  : Error
getHelloMessage()  : mixed
getLangMessage()  : mixed
hasError()  : bool
Tells true if error has occurred.
isEnabled()  : bool
Is bot enabled.
notifyAboutPlans()  : mixed
onAfterTmDayStart()  : mixed
onAfterUserAuthorize()  : mixed
onAnswerAdd()  : array<string|int, mixed>
Event handler on answer add.
onAppLang()  : mixed
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.
onLocalCommandAdd()  : mixed
onMessageAdd()  : bool
Event handler on message add.
onRenamePortalDomainChange()  : mixed
onRenamePortalLaterCommand()  : mixed
onSettingsCommandAdd()  : mixed
register()  : int
Register bot at portal.
sendAnswer()  : mixed
sendAnswerCommand()  : mixed
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 = "marta"

EDIT_PHRASE

public mixed EDIT_PHRASE = '*EDIT*'

MODULE_ID

public mixed MODULE_ID = "imbot"

Methods

addError()

public static addError(Error $error) : void
Parameters
$error : Error

addPlannerMessageAgent()

public static addPlannerMessageAgent(mixed $userId) : mixed
Parameters
$userId : mixed

addRenameMessageAgent()

public static addRenameMessageAgent([mixed $userId = null ]) : mixed
Parameters
$userId : mixed = null

addWelcomeMessageAgent()

public static addWelcomeMessageAgent() : mixed

delayRegister()

Agent for deferred bot registration.

public static delayRegister() : string
Return values
string

getBotId()

Returns registered bot Id.

public static getBotId() : int
Return values
int

getError()

public static getError() : Error
Return values
Error

getHelloMessage()

public static getHelloMessage(mixed $userId[, mixed $language = null ]) : mixed
Parameters
$userId : mixed
$language : mixed = null

getLangMessage()

public static getLangMessage([mixed $messageCode = '' ]) : mixed
Parameters
$messageCode : mixed = ''

hasError()

Tells true if error has occurred.

public static hasError() : bool
Return values
bool

isEnabled()

Is bot enabled.

public static isEnabled() : bool
Return values
bool

notifyAboutPlans()

public static notifyAboutPlans(mixed $dialogId, mixed $userId) : mixed
Parameters
$dialogId : mixed
$userId : mixed

onAfterTmDayStart()

public static onAfterTmDayStart(mixed $params) : mixed
Parameters
$params : mixed

onAfterUserAuthorize()

public static onAfterUserAuthorize(mixed $params) : mixed
Parameters
$params : mixed

onAnswerAdd()

Event handler on answer add.

public static onAnswerAdd(mixed $command, mixed $params) : array<string|int, mixed>
Parameters
$command : mixed
$params : mixed
Return values
array<string|int, mixed>

onAppLang()

public static onAppLang(mixed $icon[, mixed $lang = null ]) : mixed
Parameters
$icon : mixed
$lang : mixed = null

onBotDelete()

Event handler on bot remove.

public static onBotDelete([int|null $bodId = null ]) : bool
Parameters
$bodId : int|null = null
Return values
bool

onChatStart()

Event handler when bot join to chat.

public static onChatStart(mixed $dialogId, mixed $joinFields) : bool
Parameters
$dialogId : mixed
$joinFields : mixed
Return values
bool

onCommandAdd()

Event handler on command add.

public static onCommandAdd(mixed $messageId, mixed $messageFields) : bool
Parameters
$messageId : mixed
$messageFields : mixed
Return values
bool

onCommandLang()

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>

onLocalCommandAdd()

public static onLocalCommandAdd(mixed $messageId, mixed $messageFields) : mixed
Parameters
$messageId : mixed
$messageFields : mixed

onMessageAdd()

Event handler on message add.

public static onMessageAdd(mixed $messageId, mixed $messageFields) : bool
Parameters
$messageId : mixed
$messageFields : mixed
Return values
bool

onRenamePortalDomainChange()

public static onRenamePortalDomainChange(mixed $params) : mixed
Parameters
$params : mixed

onRenamePortalLaterCommand()

public static onRenamePortalLaterCommand(mixed $messageId, mixed $messageFields) : mixed
Parameters
$messageId : mixed
$messageFields : mixed

onSettingsCommandAdd()

public static onSettingsCommandAdd(mixed $messageId, mixed $messageFields) : mixed
Parameters
$messageId : mixed
$messageFields : mixed

register()

Register bot at portal.

public static register([array<string|int, mixed> $params = array() ]) : int
Parameters
$params : array<string|int, mixed> = array()
Return values
int

sendAnswer()

public static sendAnswer(mixed $messageId, mixed $messageFields) : mixed
Parameters
$messageId : mixed
$messageFields : mixed

sendAnswerCommand()

public static sendAnswerCommand(mixed $messageId, mixed $messageFields) : mixed
Parameters
$messageId : mixed
$messageFields : mixed

setBotId()

Saves new Id of the registered bot.

public static setBotId(int $id) : bool
Parameters
$id : int
Return values
bool

unRegister()

Unregister bot at portal.

public static unRegister() : bool
Return values
bool

uploadAvatar()

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|string

uploadIcon()

public static uploadIcon(mixed $iconName) : bool|int
Parameters
$iconName : mixed
Return values
bool|int

        
On this page

Search results