Bitrix API

Support24 extends Network implements MenuBot, SupportBot, SupportQuestion uses NetworkMenuBot, SupportQuestion, SupportQueueNumber

Table of Contents

Interfaces

MenuBot
SupportBot
SupportQuestion

Constants

BOT_CODE  = 'support24'
BUTTON_DEFAULT_COLOR  = '#29619b'
BUTTON_DISABLED_COLOR  = '#aaa'
CHAT_ENTITY_TYPE  = 'SUPPORT24_QUESTION'
CHAT_NETWORK_SUPPORT_COUNTER  = 'imbot_network_dialog_'
CHAT_NETWORK_SUPPORT_MAX_DIALOGS_OPTION  = 'network_dialogs_max_count_'
COMMAND_ACTIVATE_PARTNER  = 'activatePartnerSupport'
COMMAND_CHECK_PUBLIC_URL  = 'checkPublicUrl'
COMMAND_CONNECTOR_REGISTER  = 'RegisterConnector'
COMMAND_CONNECTOR_UNREGISTER  = 'UnRegisterConnector'
COMMAND_CONNECTOR_UPDATE  = 'UpdateConnector'
COMMAND_DEACTIVATE_PARTNER  = 'deactivatePartnerSupport'
COMMAND_DECLINE_PARTNER_REQUEST  = 'declinePartnerRequest'
COMMAND_FINISH_DIALOG_SESSION  = 'finishDialogSession'
COMMAND_NETWORK_SESSION  = 'session'
COMMAND_OPERATOR_CHANGE_LINE  = 'operatorChangeLine'
COMMAND_OPERATOR_MESSAGE_ADD  = 'operatorMessageAdd'
COMMAND_OPERATOR_MESSAGE_DELETE  = 'operatorMessageDelete'
COMMAND_OPERATOR_MESSAGE_RECEIVED  = 'operatorMessageReceived'
COMMAND_OPERATOR_MESSAGE_UPDATE  = 'operatorMessageUpdate'
COMMAND_OPERATOR_OPEN_NEW_DIALOG  = 'operatorOpenNewDialog'
COMMAND_OPERATOR_START_WRITING  = 'operatorStartWriting'
COMMAND_START_DIALOG  = 'startDialog'
COMMAND_START_DIALOG_SESSION  = 'startDialogSession'
COMMAND_SUPPORT24  = 'support24'
COMMAND_UNREGISTER  = 'unregister'
HIDE_DIALOG_TIME  = 5
INVOLVEMENT_LAST_MESSAGE_BLOCK_TIME  = 8
MESSAGE_PARAM_ALLOW_QUOTE  = 'IMOL_QUOTE_MSG'
MESSAGE_PARAM_ATTACH  = 'ATTACH'
MESSAGE_PARAM_CONNECTOR_MID  = 'CONNECTOR_MID'
MESSAGE_PARAM_DELIVERED  = 'IS_DELIVERED'
MESSAGE_PARAM_IMOL_VOTE  = 'IMOL_VOTE'
MESSAGE_PARAM_IMOL_VOTE_DISLIKE  = 'IMOL_VOTE_DISLIKE'
MESSAGE_PARAM_IMOL_VOTE_LIKE  = 'IMOL_VOTE_LIKE'
MESSAGE_PARAM_KEYBOARD  = 'KEYBOARD'
MESSAGE_PARAM_SENDING  = 'SENDING'
MESSAGE_PARAM_SENDING_TIME  = 'SENDING_TS'
MESSAGE_PARAM_SESSION_ID  = 'IMOL_SID'
MODULE_ID  = "imbot"
MULTIDIALOG_STATUS_CLOSE  = 'CLOSE'
MULTIDIALOG_STATUS_NEW  = 'NEW'
MULTIDIALOG_STATUS_OPEN  = 'OPEN'
OPTION_BOT_DEMO_ACTIVE  = 'support24_demo_active'
OPTION_BOT_FREE_AVATAR  = 'support24_free_avatar'
OPTION_BOT_FREE_CODE  = 'support24_free_code'
OPTION_BOT_FREE_DAYS  = 'support24_free_days'
OPTION_BOT_FREE_DESC  = 'support24_free_desc'
OPTION_BOT_FREE_FOR_ALL  = 'support24_free_for_all'
OPTION_BOT_FREE_MENU  = 'support24_free_menu'
OPTION_BOT_FREE_MENU_STAGE  = 'support24_free_menu_stage'
OPTION_BOT_FREE_MESSAGES  = 'support24_free_messages'
OPTION_BOT_FREE_NAME  = 'support24_free_name'
OPTION_BOT_FREE_START_DATE  = 'support24_free_start_date'
OPTION_BOT_ID  = 'support24_bot_id'
OPTION_BOT_PAID_ACTIVE  = 'support24_paid_active'
OPTION_BOT_PAID_AVATAR  = 'support24_paid_avatar'
OPTION_BOT_PAID_CODE  = 'support24_paid_code'
OPTION_BOT_PAID_DESC  = 'support24_paid_desc'
OPTION_BOT_PAID_FOR_ALL  = 'support24_paid_for_all'
OPTION_BOT_PAID_MENU  = 'support24_paid_menu'
OPTION_BOT_PAID_MENU_STAGE  = 'support24_paid_menu_stage'
OPTION_BOT_PAID_MESSAGES  = 'support24_paid_messages'
OPTION_BOT_PAID_NAME  = 'support24_paid_name'
OPTION_BOT_STAGE_ACTIVE  = 'support24_stage_active'
OPTION_BOT_SUPPORT_LEVEL  = 'support24_support_level'
OPTION_BOT_WELCOME_SHOWN  = 'support24_welcome_message'
PORTAL_PATH  = '/pub/imbot.php'
SCHEDULE_ACTION_CHECK_STAGE  = 'check_stage'
SCHEDULE_ACTION_HIDE_DIALOG  = 'hide_dialog'
SCHEDULE_ACTION_INVOLVEMENT  = 'involvement'
SCHEDULE_ACTION_MESSAGE  = 'message'
SCHEDULE_ACTION_PARTNER_JOIN  = 'partner_join'
SCHEDULE_ACTION_WELCOME  = 'welcome'
SCHEDULE_DELETE_ALL  = null
SUPPORT_LEVEL_FREE  = 'free'
SUPPORT_LEVEL_NONE  = 'none'
SUPPORT_LEVEL_PAID  = 'paid'
SUPPORT_LEVEL_PARTNER  = 'partner'
SUPPORT_TIME_NONE  = 0
SUPPORT_TIME_UNLIMITED  = -1

Methods

addAgent()  : bool
Adds agent.
addError()  : void
addNetworkQuestionByBotId()  : int
allowAdditionalQuestion()  : bool
allowSendStartMessage()  : bool
Checks if starting message at this dialog has been sent.
checkCodeBlacklist()  : bool
checkPublicUrl()  : bool
Checks availability of the external public url.
checkSessionVoteMessage()  : bool
Performs checking if it is user voting for session by direct text input '1' or '0'.
cleanQuestionsCountCache()  : void
clientMessageAdd()  : bool|array<string|int, mixed>
Sends new client message into network line.
delayRegister()  : string
Agent for deferred bot registration.
delayShowingMessage()  : bool
deleteAgent()  : bool
Removes agents.
deleteScheduledAction()  : void
execScheduleAction()  : bool
getAccessLevel()  : string
Detects client's support level.
getAdministrators()  : array<string|int, int>
List of administrator users.
getAllQuestions()  : array<string|int, mixed>
getAppList()  : array<string|int, array{command: string, icon: string, js: string, context: string, lang: string}>
Returns app's property list.
getBotAsMultidialog()  : mixed
getBotAvatar()  : string
getBotCode()  : string
Returns OL code.
getBotDesc()  : string
getBotId()  : int
Returns registered bot Id.
getBotMenu()  : ItrMenu|null
Returns stored data for ITR menu.
getBotName()  : string
getBotSettings()  : array<string|int, mixed>|null
Loads bot settings from controller.
getBusinessUsers()  : array<string|int, int>
List of unlimited users.
getChatWithBot()  : array<string|int, mixed>|null
getCommandList()  : array<string|int, array{class: string, handler: string, visible: bool, context: string}>
Returns command's property list.
getError()  : Error
getEventHandlerList()  : array<string|int, array{module: string, event: string, class: string, handler: string}>
Returns event handler list.
getFreeSupportLifeTime()  : int
getLangMessage()  : string
Returns phrase according its code.
getLicenceLanguage()  : string
getMenuCommandList()  : array<string|int, array{class: string, handler: string, visible: bool, context: string}>
Returns command's property list.
getMenuState()  : array<string|int, mixed>|null
Returns user's menu track.
getMessage()  : string
getMultidialog()  : array<string|int, mixed>|null
getNetworkBotId()  : bool|int
Returns open line bot id.
getQuestionLimit()  : int
Returns the limit for additional questions.
getQuestionList()  : array<string|int, mixed>
getQuestionsCount()  : int
getQuestionsWithUnreadMessages()  : array<string|int, mixed>
getRecentDialogs()  : Generator|iterable<string|int, mixed>
Returns bot's recent dialogs.
getSupportLevel()  : string
Detects client's support level.
getUserGeoData()  : string
Collects some available geo data.
getUserSupportLevel()  : string
handleMenuCommand()  : void
hasBotMenu()  : bool
Checks if bot has ITR menu.
hasError()  : bool
Tells true if error has occurred.
incrementGlobalDialogCounter()  : int
initHttpClient()  : Http
Replace web client.
instanceMenu()  : ItrMenu
isActiveFreeSupport()  : bool
isActiveFreeSupportForAll()  : bool
isActiveFreeSupportForUser()  : bool
isActivePaidSupport()  : bool
isActivePaidSupportForAll()  : bool
isActivePaidSupportForUser()  : bool
isActivePartnerSupport()  : bool
isEnabled()  : bool
Is bot enabled.
isFdcCode()  : bool
isFreeSupportLifeTimeExpired()  : bool
isMenuTrackFinished()  : bool
Checks if menu track has been completed.
isMenuTrackStarted()  : bool
Checks if menu track has been started.
isNeedUpdateBotAvatarAfterNewMessage()  : bool
Allows updating bot's avatar using data from incoming message.
isNeedUpdateBotFieldsAfterNewMessage()  : bool
Allows updating bot fields (name, desc, avatar, welcome mess) using data from incoming message.
isStagePortal()  : bool
Checks if portal is in STAGE mode.
isUserAdmin()  : bool
Checks if user has an portal administrator access role.
isUserIntegrator()  : bool
Checks if user has an integrator access role.
join()  : bool|int
Check if network bot exists and registers it.
onAfterLicenseChange()  : bool
onAfterSupportCodeChange()  : bool
onAfterUserAuthorize()  : bool
onAnswerAdd()  : array<string|int, mixed>|Error
Event handler on answer add.
onAppLang()  : array{TITLE: string, PARAMS: string}
onBotDelete()  : bool
Event handler on bot remove.
onChatRead()  : bool
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
Compatibility alias to the onCommandAdd method.
onMessageAdd()  : bool
Event handler on message add.
onMessageDelete()  : bool
onMessageUpdate()  : bool
onReceiveCommand()  : Error|array<string|int, mixed>
Event handler on answer add.
onSessionVote()  : bool
Handler for "im:OnSessionVote" event.
onStartWriting()  : bool
Handler for `StartWriting` event.
onUserRead()  : bool
onWelcomeMessage()  : mixed
Compatibility alias to the onChatStart method.
refreshAgent()  : string
Refresh settings agent.
register()  : bool|int
Register bot at portal.
registerApps()  : bool
Register bot's command.
registerCommands()  : bool
Register bot's command.
registerConnector()  : array<string|int, mixed>|bool
replacePlaceholders()  : string
Replaces standard placeholders.
resetMenuState()  : void
Clears user's menu track.
saveMenuState()  : void
Saves user's menu track.
scheduleAction()  : void
scheduledActionAgent()  : string
search()  : bool|array<string|int, mixed>
Looks for the network openline.
sendMenuResult()  : bool
Sends result of the user interaction with ITR menu to operator.
sendMessage()  : array<string|int, mixed>
Sends message to client.
sendNotifyAboutChangeLevel()  : bool
Forwards message into recent dialogs about support lever change.
sendNotifyChangeLicence()  : bool
Sends notify change licence.
sendRequestFinalizeSession()  : bool
Sends finalize session notification.
sendUnregisterRequest()  : bool
Sends unregister bot request.
setBotId()  : bool
Saves new Id of the registered bot.
setNetworkBotId()  : bool
Saves new open line bot id.
setQuestionLimit()  : void
Returns the limit for additional questions.
showMenu()  : bool
Display ITR menu.
stopMenuTrack()  : void
Stops show menu to user.
unRegister()  : bool
Unregisters bot at portal.
unRegisterConnector()  : bool|array<string|int, mixed>
updateBotProperties()  : bool
updateConnector()  : bool|array<string|int, mixed>
uploadAvatar()  : array<string|int, mixed>|string
Dowlloads user avatar via supplied image url.
uploadIcon()  : bool|int

Constants

BOT_CODE

public mixed BOT_CODE = 'support24'

BUTTON_DEFAULT_COLOR

public mixed BUTTON_DEFAULT_COLOR = '#29619b'

BUTTON_DISABLED_COLOR

public mixed BUTTON_DISABLED_COLOR = '#aaa'

CHAT_ENTITY_TYPE

public mixed CHAT_ENTITY_TYPE = 'SUPPORT24_QUESTION'

CHAT_NETWORK_SUPPORT_COUNTER

public mixed CHAT_NETWORK_SUPPORT_COUNTER = 'imbot_network_dialog_'

CHAT_NETWORK_SUPPORT_MAX_DIALOGS_OPTION

public mixed CHAT_NETWORK_SUPPORT_MAX_DIALOGS_OPTION = 'network_dialogs_max_count_'

COMMAND_ACTIVATE_PARTNER

public mixed COMMAND_ACTIVATE_PARTNER = 'activatePartnerSupport'

COMMAND_CHECK_PUBLIC_URL

public mixed COMMAND_CHECK_PUBLIC_URL = 'checkPublicUrl'

COMMAND_CONNECTOR_REGISTER

public mixed COMMAND_CONNECTOR_REGISTER = 'RegisterConnector'

COMMAND_CONNECTOR_UNREGISTER

public mixed COMMAND_CONNECTOR_UNREGISTER = 'UnRegisterConnector'

COMMAND_CONNECTOR_UPDATE

public mixed COMMAND_CONNECTOR_UPDATE = 'UpdateConnector'

COMMAND_DEACTIVATE_PARTNER

public mixed COMMAND_DEACTIVATE_PARTNER = 'deactivatePartnerSupport'

COMMAND_DECLINE_PARTNER_REQUEST

public mixed COMMAND_DECLINE_PARTNER_REQUEST = 'declinePartnerRequest'

COMMAND_FINISH_DIALOG_SESSION

public mixed COMMAND_FINISH_DIALOG_SESSION = 'finishDialogSession'

COMMAND_NETWORK_SESSION

public mixed COMMAND_NETWORK_SESSION = 'session'

COMMAND_OPERATOR_CHANGE_LINE

public mixed COMMAND_OPERATOR_CHANGE_LINE = 'operatorChangeLine'

COMMAND_OPERATOR_MESSAGE_ADD

public mixed COMMAND_OPERATOR_MESSAGE_ADD = 'operatorMessageAdd'

COMMAND_OPERATOR_MESSAGE_DELETE

public mixed COMMAND_OPERATOR_MESSAGE_DELETE = 'operatorMessageDelete'

COMMAND_OPERATOR_MESSAGE_RECEIVED

public mixed COMMAND_OPERATOR_MESSAGE_RECEIVED = 'operatorMessageReceived'

COMMAND_OPERATOR_MESSAGE_UPDATE

public mixed COMMAND_OPERATOR_MESSAGE_UPDATE = 'operatorMessageUpdate'

COMMAND_OPERATOR_OPEN_NEW_DIALOG

public mixed COMMAND_OPERATOR_OPEN_NEW_DIALOG = 'operatorOpenNewDialog'

COMMAND_OPERATOR_START_WRITING

public mixed COMMAND_OPERATOR_START_WRITING = 'operatorStartWriting'

COMMAND_START_DIALOG

public mixed COMMAND_START_DIALOG = 'startDialog'

COMMAND_START_DIALOG_SESSION

public mixed COMMAND_START_DIALOG_SESSION = 'startDialogSession'

COMMAND_SUPPORT24

public mixed COMMAND_SUPPORT24 = 'support24'

COMMAND_UNREGISTER

public mixed COMMAND_UNREGISTER = 'unregister'

HIDE_DIALOG_TIME

public mixed HIDE_DIALOG_TIME = 5

INVOLVEMENT_LAST_MESSAGE_BLOCK_TIME

public mixed INVOLVEMENT_LAST_MESSAGE_BLOCK_TIME = 8

MESSAGE_PARAM_ALLOW_QUOTE

public mixed MESSAGE_PARAM_ALLOW_QUOTE = 'IMOL_QUOTE_MSG'

MESSAGE_PARAM_ATTACH

public mixed MESSAGE_PARAM_ATTACH = 'ATTACH'

MESSAGE_PARAM_CONNECTOR_MID

public mixed MESSAGE_PARAM_CONNECTOR_MID = 'CONNECTOR_MID'

MESSAGE_PARAM_DELIVERED

public mixed MESSAGE_PARAM_DELIVERED = 'IS_DELIVERED'

MESSAGE_PARAM_IMOL_VOTE

public mixed MESSAGE_PARAM_IMOL_VOTE = 'IMOL_VOTE'

MESSAGE_PARAM_IMOL_VOTE_DISLIKE

public mixed MESSAGE_PARAM_IMOL_VOTE_DISLIKE = 'IMOL_VOTE_DISLIKE'

MESSAGE_PARAM_IMOL_VOTE_LIKE

public mixed MESSAGE_PARAM_IMOL_VOTE_LIKE = 'IMOL_VOTE_LIKE'

MESSAGE_PARAM_KEYBOARD

public mixed MESSAGE_PARAM_KEYBOARD = 'KEYBOARD'

MESSAGE_PARAM_SENDING

public mixed MESSAGE_PARAM_SENDING = 'SENDING'

MESSAGE_PARAM_SENDING_TIME

public mixed MESSAGE_PARAM_SENDING_TIME = 'SENDING_TS'

MESSAGE_PARAM_SESSION_ID

public mixed MESSAGE_PARAM_SESSION_ID = 'IMOL_SID'

MODULE_ID

public mixed MODULE_ID = "imbot"

MULTIDIALOG_STATUS_CLOSE

public mixed MULTIDIALOG_STATUS_CLOSE = 'CLOSE'

MULTIDIALOG_STATUS_NEW

public mixed MULTIDIALOG_STATUS_NEW = 'NEW'

MULTIDIALOG_STATUS_OPEN

public mixed MULTIDIALOG_STATUS_OPEN = 'OPEN'

OPTION_BOT_DEMO_ACTIVE

public mixed OPTION_BOT_DEMO_ACTIVE = 'support24_demo_active'

OPTION_BOT_FREE_AVATAR

public mixed OPTION_BOT_FREE_AVATAR = 'support24_free_avatar'

OPTION_BOT_FREE_CODE

public mixed OPTION_BOT_FREE_CODE = 'support24_free_code'

OPTION_BOT_FREE_DAYS

public mixed OPTION_BOT_FREE_DAYS = 'support24_free_days'

OPTION_BOT_FREE_DESC

public mixed OPTION_BOT_FREE_DESC = 'support24_free_desc'

OPTION_BOT_FREE_FOR_ALL

public mixed OPTION_BOT_FREE_FOR_ALL = 'support24_free_for_all'

OPTION_BOT_FREE_MENU

public mixed OPTION_BOT_FREE_MENU = 'support24_free_menu'

OPTION_BOT_FREE_MENU_STAGE

public mixed OPTION_BOT_FREE_MENU_STAGE = 'support24_free_menu_stage'

OPTION_BOT_FREE_MESSAGES

public mixed OPTION_BOT_FREE_MESSAGES = 'support24_free_messages'

OPTION_BOT_FREE_NAME

public mixed OPTION_BOT_FREE_NAME = 'support24_free_name'

OPTION_BOT_FREE_START_DATE

public mixed OPTION_BOT_FREE_START_DATE = 'support24_free_start_date'

OPTION_BOT_ID

public mixed OPTION_BOT_ID = 'support24_bot_id'

OPTION_BOT_PAID_ACTIVE

public mixed OPTION_BOT_PAID_ACTIVE = 'support24_paid_active'

OPTION_BOT_PAID_AVATAR

public mixed OPTION_BOT_PAID_AVATAR = 'support24_paid_avatar'

OPTION_BOT_PAID_CODE

public mixed OPTION_BOT_PAID_CODE = 'support24_paid_code'

OPTION_BOT_PAID_DESC

public mixed OPTION_BOT_PAID_DESC = 'support24_paid_desc'

OPTION_BOT_PAID_FOR_ALL

public mixed OPTION_BOT_PAID_FOR_ALL = 'support24_paid_for_all'

OPTION_BOT_PAID_MENU

public mixed OPTION_BOT_PAID_MENU = 'support24_paid_menu'

OPTION_BOT_PAID_MENU_STAGE

public mixed OPTION_BOT_PAID_MENU_STAGE = 'support24_paid_menu_stage'

OPTION_BOT_PAID_MESSAGES

public mixed OPTION_BOT_PAID_MESSAGES = 'support24_paid_messages'

OPTION_BOT_PAID_NAME

public mixed OPTION_BOT_PAID_NAME = 'support24_paid_name'

OPTION_BOT_STAGE_ACTIVE

public mixed OPTION_BOT_STAGE_ACTIVE = 'support24_stage_active'

OPTION_BOT_SUPPORT_LEVEL

public mixed OPTION_BOT_SUPPORT_LEVEL = 'support24_support_level'

OPTION_BOT_WELCOME_SHOWN

public mixed OPTION_BOT_WELCOME_SHOWN = 'support24_welcome_message'

PORTAL_PATH

public mixed PORTAL_PATH = '/pub/imbot.php'

SCHEDULE_ACTION_CHECK_STAGE

public mixed SCHEDULE_ACTION_CHECK_STAGE = 'check_stage'

SCHEDULE_ACTION_HIDE_DIALOG

public mixed SCHEDULE_ACTION_HIDE_DIALOG = 'hide_dialog'

SCHEDULE_ACTION_INVOLVEMENT

public mixed SCHEDULE_ACTION_INVOLVEMENT = 'involvement'

SCHEDULE_ACTION_MESSAGE

public mixed SCHEDULE_ACTION_MESSAGE = 'message'

SCHEDULE_ACTION_PARTNER_JOIN

public mixed SCHEDULE_ACTION_PARTNER_JOIN = 'partner_join'

SCHEDULE_ACTION_WELCOME

public mixed SCHEDULE_ACTION_WELCOME = 'welcome'

SCHEDULE_DELETE_ALL

public mixed SCHEDULE_DELETE_ALL = null

SUPPORT_LEVEL_FREE

public mixed SUPPORT_LEVEL_FREE = 'free'

SUPPORT_LEVEL_NONE

public mixed SUPPORT_LEVEL_NONE = 'none'

SUPPORT_LEVEL_PAID

public mixed SUPPORT_LEVEL_PAID = 'paid'

SUPPORT_LEVEL_PARTNER

public mixed SUPPORT_LEVEL_PARTNER = 'partner'

SUPPORT_TIME_NONE

public mixed SUPPORT_TIME_NONE = 0

SUPPORT_TIME_UNLIMITED

public mixed SUPPORT_TIME_UNLIMITED = -1

Methods

addAgent()

Adds agent.

public static addAgent(array{agent: string, class: string, next_execution: string, delay: int, regular: bool, interval: int} $params) : bool
Parameters
$params : array{agent: string, class: string, next_execution: string, delay: int, regular: bool, interval: int}
Tags
throws
ArgumentException
Return values
bool

addError()

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

addNetworkQuestionByBotId()

public static addNetworkQuestionByBotId(int $botId[, int|null $userId = null ]) : int
Parameters
$botId : int
$userId : int|null = null
Return values
int

allowAdditionalQuestion()

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

allowSendStartMessage()

Checks if starting message at this dialog has been sent.

public static allowSendStartMessage(array<string|int, mixed> $params) : bool
Parameters
$params : array<string|int, mixed>
[
	(int) BOT_ID Bot id.
	(string) DIALOG_ID Dialog id.
]
Return values
bool

checkCodeBlacklist()

public static checkCodeBlacklist(string $code) : bool
Parameters
$code : string
Return values
bool

checkPublicUrl()

Checks availability of the external public url.

public static checkPublicUrl([string $publicUrl = null ]) : bool
Parameters
$publicUrl : string = null

Portal public url.

Tags
see
CheckPublicUrl
Return values
bool

checkSessionVoteMessage()

Performs checking if it is user voting for session by direct text input '1' or '0'.

public static checkSessionVoteMessage(array<string|int, mixed> $messageFields) : bool
Parameters
$messageFields : array<string|int, mixed>

Message arguments.

Return values
bool

cleanQuestionsCountCache()

public static cleanQuestionsCountCache([int|null $botId = null ]) : void
Parameters
$botId : int|null = null

clientMessageAdd()

Sends new client message into network line.

public static clientMessageAdd(array<string|int, mixed> $fields) : bool|array<string|int, mixed>
Parameters
$fields : array<string|int, mixed>

Command arguments.

[
	(int) USER_ID
	(int|string) DIALOG_ID
	(string|array) MESSAGE
	(int) BOT_ID
	(array) FILES
	(array) ATTACH
	(array) PARAMS
]
Tags
see
ClientMessageAdd
Return values
bool|array<string|int, mixed>

delayRegister()

Agent for deferred bot registration.

public static delayRegister() : string
Return values
string

delayShowingMessage()

public static delayShowingMessage(mixed $botId, array<string|int, mixed> $messageFields) : bool
Parameters
$botId : mixed
$messageFields : array<string|int, mixed>
Return values
bool

deleteAgent()

Removes agents.

public static deleteAgent(array{agent: string, mask: string, class: string} $params) : bool
Parameters
$params : array{agent: string, mask: string, class: string}
Tags
throws
ArgumentException
Return values
bool

deleteScheduledAction()

public static deleteScheduledAction([string $target = '' ][, string $action = '' ][, string $code = '' ]) : void
Parameters
$target : string = ''
$action : string = ''
$code : string = ''

execScheduleAction()

public static execScheduleAction(string $target, string $action[, string $code = '' ]) : bool
Parameters
$target : string
$action : string
$code : string = ''
Return values
bool

getAccessLevel()

Detects client's support level.

public static getAccessLevel() : string
Return values
string

getAdministrators()

List of administrator users.

public static getAdministrators() : array<string|int, int>
Return values
array<string|int, int>

getAllQuestions()

public static getAllQuestions([int|null $botId = null ][, int|null $userId = null ]) : array<string|int, mixed>
Parameters
$botId : int|null = null
$userId : int|null = null
Return values
array<string|int, mixed>

getAppList()

Returns app's property list.

public static getAppList() : array<string|int, array{command: string, icon: string, js: string, context: string, lang: string}>
Return values
array<string|int, array{command: string, icon: string, js: string, context: string, lang: string}>

getBotAsMultidialog()

public static getBotAsMultidialog(int $botId, int $userId) : mixed
Parameters
$botId : int
$userId : int

getBotAvatar()

public static getBotAvatar() : string
Return values
string

getBotCode()

Returns OL code.

public static getBotCode() : string
Return values
string

getBotDesc()

public static getBotDesc() : string
Return values
string

getBotId()

Returns registered bot Id.

public static getBotId() : int
Return values
int

getBotMenu()

Returns stored data for ITR menu.

public static getBotMenu() : ItrMenu|null
Return values
ItrMenu|null

getBotName()

public static getBotName() : string
Return values
string

getBotSettings()

Loads bot settings from controller.

public static getBotSettings([array{BOT_ID: int} $params = [] ]) : array<string|int, mixed>|null
Parameters
$params : array{BOT_ID: int} = []

Command arguments.

Return values
array<string|int, mixed>|null

getBusinessUsers()

List of unlimited users.

public static getBusinessUsers() : array<string|int, int>
Tags
see
CBitrix24BusinessTools::getUnlimUsers
Return values
array<string|int, int>

getChatWithBot()

public static getChatWithBot([int|null $botId = null ][, int|null $userId = null ]) : array<string|int, mixed>|null
Parameters
$botId : int|null = null
$userId : int|null = null
Return values
array<string|int, mixed>|null

getCommandList()

Returns command's property list.

public static getCommandList() : array<string|int, array{class: string, handler: string, visible: bool, context: string}>
Return values
array<string|int, array{class: string, handler: string, visible: bool, context: string}>

getError()

public static getError() : Error
Return values
Error

getEventHandlerList()

Returns event handler list.

public static getEventHandlerList() : array<string|int, array{module: string, event: string, class: string, handler: string}>
Return values
array<string|int, array{module: string, event: string, class: string, handler: string}>

getFreeSupportLifeTime()

public static getFreeSupportLifeTime() : int
Return values
int

getLangMessage()

Returns phrase according its code.

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

Phrase code.

Return values
string

getLicenceLanguage()

public static getLicenceLanguage() : string
Return values
string

getMenuCommandList()

Returns command's property list.

public static getMenuCommandList() : array<string|int, array{class: string, handler: string, visible: bool, context: string}>
Return values
array<string|int, array{class: string, handler: string, visible: bool, context: string}>

getMenuState()

Returns user's menu track.

public static getMenuState(string $dialogId) : array<string|int, mixed>|null
Parameters
$dialogId : string

User or id.

Tags
see
MenuBot::getMenuState
Return values
array<string|int, mixed>|null

getMessage()

public static getMessage(string $code[, string|null $supportLevel = null ]) : string
Parameters
$code : string
$supportLevel : string|null = null
Return values
string

getMultidialog()

public static getMultidialog(int $chatId[, int|null $botId = null ][, int|null $userId = null ]) : array<string|int, mixed>|null
Parameters
$chatId : int
$botId : int|null = null
$userId : int|null = null
Return values
array<string|int, mixed>|null

getNetworkBotId()

Returns open line bot id.

public static getNetworkBotId(string $code[, bool $getFromDb = false ]) : bool|int
Parameters
$code : string

Line code.

$getFromDb : bool = false

Do not use Main\Config\Option to detect it.

Return values
bool|int

getQuestionLimit()

Returns the limit for additional questions.

public static getQuestionLimit([int|null $botId = null ]) : int
Parameters
$botId : int|null = null
Return values
int

-1 - Functional is disabled, 0 - There is no limit, n - Max number for sessions allowed.

getQuestionList()

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

getQuestionsCount()

public static getQuestionsCount([int|null $botId = null ][, int|null $userId = null ]) : int
Parameters
$botId : int|null = null
$userId : int|null = null
Return values
int

getQuestionsWithUnreadMessages()

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

getRecentDialogs()

Returns bot's recent dialogs.

public static getRecentDialogs([int $hoursDepth = 168 ][, int|null $botId = null ]) : Generator|iterable<string|int, mixed>
Parameters
$hoursDepth : int = 168

Depth into past. Default: 7 days.

$botId : int|null = null
Return values
Generator|iterable<string|int, mixed>
[
  0 => [
     (int) USER_ID
     (int) CHAT_ID
     (string) RECENTLY_TALK
     (int) MESSAGE_ID
  ],
  ...

getSupportLevel()

Detects client's support level.

public static getSupportLevel() : string
Return values
string

getUserGeoData()

Collects some available geo data.

public static getUserGeoData() : string
Return values
string

getUserSupportLevel()

public static getUserSupportLevel() : string
Return values
string

handleMenuCommand()

public static handleMenuCommand(int $messageId, array<string|int, mixed> $messageFields) : void
Parameters
$messageId : int
$messageFields : array<string|int, mixed>

hasBotMenu()

Checks if bot has ITR menu.

public static hasBotMenu() : bool
Return values
bool

hasError()

Tells true if error has occurred.

public static hasError() : bool
Return values
bool

incrementGlobalDialogCounter()

public static incrementGlobalDialogCounter(int $botId) : int
Parameters
$botId : int
Return values
int

initHttpClient()

Replace web client.

public static initHttpClient(Http $httpClient) : Http
Parameters
$httpClient : Http
Return values
Http

instanceMenu()

public static instanceMenu() : ItrMenu
Return values
ItrMenu

isActiveFreeSupport()

public static isActiveFreeSupport() : bool
Return values
bool

isActiveFreeSupportForAll()

public static isActiveFreeSupportForAll() : bool
Return values
bool

isActiveFreeSupportForUser()

public static isActiveFreeSupportForUser(int $userId) : bool
Parameters
$userId : int
Return values
bool

isActivePaidSupport()

public static isActivePaidSupport() : bool
Return values
bool

isActivePaidSupportForAll()

public static isActivePaidSupportForAll() : bool
Return values
bool

isActivePaidSupportForUser()

public static isActivePaidSupportForUser(int $userId) : bool
Parameters
$userId : int
Return values
bool

isActivePartnerSupport()

public static isActivePartnerSupport() : bool
Return values
bool

isEnabled()

Is bot enabled.

public static isEnabled() : bool
Return values
bool

isFdcCode()

public static isFdcCode(string $text) : bool
Parameters
$text : string
Return values
bool

isFreeSupportLifeTimeExpired()

public static isFreeSupportLifeTimeExpired() : bool
Return values
bool

isMenuTrackFinished()

Checks if menu track has been completed.

public static isMenuTrackFinished(string $dialogId) : bool
Parameters
$dialogId : string

User or chat id.

Return values
bool

isMenuTrackStarted()

Checks if menu track has been started.

public static isMenuTrackStarted(string $dialogId) : bool
Parameters
$dialogId : string

User or chat id.

Return values
bool

isNeedUpdateBotAvatarAfterNewMessage()

Allows updating bot's avatar using data from incoming message.

public static isNeedUpdateBotAvatarAfterNewMessage() : bool
Tags
inheritDoc
Return values
bool

isNeedUpdateBotFieldsAfterNewMessage()

Allows updating bot fields (name, desc, avatar, welcome mess) using data from incoming message.

public static isNeedUpdateBotFieldsAfterNewMessage() : bool
Tags
inheritDoc
Return values
bool

isStagePortal()

Checks if portal is in STAGE mode.

public static isStagePortal() : bool
Return values
bool

isUserAdmin()

Checks if user has an portal administrator access role.

public static isUserAdmin(int $userId) : bool
Parameters
$userId : int
Return values
bool

isUserIntegrator()

Checks if user has an integrator access role.

public static isUserIntegrator(int $userId) : bool
Parameters
$userId : int
Return values
bool

join()

Check if network bot exists and registers it.

public static join(string $code[, array<string|int, mixed> $options = [] ]) : bool|int
Parameters
$code : string

Open line code.

$options : array<string|int, mixed> = []

Additional bot user parameters.

Return values
bool|int

onAfterLicenseChange()

public static onAfterLicenseChange() : bool
Return values
bool

onAfterSupportCodeChange()

public static onAfterSupportCodeChange([string $previousFreeCode = '' ][, string $previousPaidCode = '' ]) : bool
Parameters
$previousFreeCode : string = ''
$previousPaidCode : string = ''
Tags
deprected
Return values
bool

onAfterUserAuthorize()

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

onAnswerAdd()

Event handler on answer add.

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

Text command alias.

$params : array<string|int, mixed>

Command arguments.

Return values
array<string|int, mixed>|Error

onAppLang()

public static onAppLang(string $command[, string $lang = null ]) : array{TITLE: string, PARAMS: string}
Parameters
$command : string
$lang : string = null
Return values
array{TITLE: string, PARAMS: string}

onBotDelete()

Event handler on bot remove.

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

onChatRead()

public static onChatRead(mixed $params) : bool
Parameters
$params : mixed
Tags
see
Event::onChatRead
Return values
bool

onChatStart()

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>
Tags
see
Bot::onJoinChat
Return values
bool

onCommandAdd()

Event handler on command add.

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

Message Id.

$messageFields : mixed

Event arguments.

[
	(string) COMMAND
	(string) COMMAND_PARAMS
	(string) COMMAND_CONTEXT == KEYBOARD
	(int) COMMAND_ID
	(string) MESSAGE_TYPE == P
	(string) SYSTEM != Y
	(int) TO_USER_ID
	(int) FROM_USER_ID
	(int) CONNECTOR_MID
]
Tags
inheritDoc
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()

Compatibility alias to the onCommandAdd method.

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

Remove it.

onMessageAdd()

Event handler on message add.

public static onMessageAdd(int $messageId, array<string|int, mixed> $messageFields) : bool
Parameters
$messageId : int

Message Id.

$messageFields : array<string|int, mixed>

Event arguments.

Tags
see
Bot::onMessageAdd
Return values
bool

onMessageDelete()

public static onMessageDelete(int $messageId, array<string|int, mixed> $messageFields) : bool
Parameters
$messageId : int

Message Id.

$messageFields : array<string|int, mixed>

Event arguments.

Return values
bool

onMessageUpdate()

public static onMessageUpdate(int $messageId, array<string|int, mixed> $messageFields) : bool
Parameters
$messageId : int

Message Id.

$messageFields : array<string|int, mixed>

Event arguments.

Return values
bool

onReceiveCommand()

Event handler on answer add.

public static onReceiveCommand(string $command, array<string|int, mixed> $params) : Error|array<string|int, mixed>

Alias for @see \Bitrix\Imbot\Bot\ChatBot::onAnswerAdd Called from @see \Bitrix\ImBot\Controller::sendToBot

Parameters
$command : string
$params : array<string|int, mixed>
Return values
Error|array<string|int, mixed>

onSessionVote()

Handler for "im:OnSessionVote" event.

public static onSessionVote(array<string|int, mixed> $params) : bool
Parameters
$params : array<string|int, mixed>

Event arguments.

Return values
bool

onStartWriting()

Handler for `StartWriting` event.

public static onStartWriting(array<string|int, mixed> $params) : bool
Parameters
$params : array<string|int, mixed>
[
	(int) BOT_ID Bot id.
	(string) DIALOG_ID Dialog id.
	(int) USER_ID User id.
]
Tags
see
Event::onStartWriting
inheritDoc
Return values
bool

onUserRead()

public static onUserRead(mixed $params) : bool
Parameters
$params : mixed
Tags
see
Event::onUserRead
Return values
bool

onWelcomeMessage()

Compatibility alias to the onChatStart method.

public static onWelcomeMessage(mixed $dialogId, mixed $joinFields) : mixed
Parameters
$dialogId : mixed
$joinFields : mixed
Tags
todo

Remove it.

refreshAgent()

Refresh settings agent.

public static refreshAgent([bool $regular = true ]) : string
Parameters
$regular : bool = true
Return values
string

register()

Register bot at portal.

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

registerApps()

Register bot's command.

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

registerCommands()

Register bot's command.

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

registerConnector()

public static registerConnector(int $lineId[, array<string|int, mixed> $fields = [] ]) : array<string|int, mixed>|bool
Parameters
$lineId : int
$fields : array<string|int, mixed> = []
Return values
array<string|int, mixed>|bool

replacePlaceholders()

Replaces standard placeholders.

public static replacePlaceholders(string $message[, int $userId = 0 ]) : string
Parameters
$message : string
$userId : int = 0
Return values
string

resetMenuState()

Clears user's menu track.

public static resetMenuState(string $dialogId) : void
Parameters
$dialogId : string

User or chat id.

saveMenuState()

Saves user's menu track.

public static saveMenuState(string $dialogId[, array<string|int, mixed>|null $menuState = null ]) : void
Parameters
$dialogId : string

User or chat id.

$menuState : array<string|int, mixed>|null = null

User menu track.

Tags
see
MenuBot::saveMenuState

scheduleAction()

public static scheduleAction(string $target, string $action[, string $code = '' ][, int $delayMinutes = 1 ]) : void
Parameters
$target : string
$action : string
$code : string = ''
$delayMinutes : int = 1

scheduledActionAgent()

public static scheduledActionAgent(string $target, string $action[, string $code = '' ]) : string
Parameters
$target : string
$action : string
$code : string = ''
Return values
string

Looks for the network openline.

public static search(string $text[, bool $doNotCheckBlackList = false ]) : bool|array<string|int, mixed>
Parameters
$text : string

Search string. Openline's name or exact code.

$doNotCheckBlackList : bool = false
Tags
see
ClientSearchLine
Return values
bool|array<string|int, mixed>

Command arguments.

[
	0 => [
		(string) CODE,
		(string) LINE_NAME,
		(string) LINE_DESC,
		(string) LINE_WELCOME_MESSAGE,
		(string) LINE_AVATAR,
		(bool) VERIFIED,
	],
	...

sendMenuResult()

Sends result of the user interaction with ITR menu to operator.

public static sendMenuResult(array<string|int, mixed> $params) : bool
Parameters
$params : array<string|int, mixed>

Command arguments.

[
  (string) DIALOG_ID Dialog id.
  (int) MESSAGE_ID Message id.
  (array) PARAMS Some extra action data.
]
Tags
see
MenuBot::sendMenuResult
Return values
bool

sendMessage()

Sends message to client.

public static sendMessage(array<string|int, mixed> $messageFields) : array<string|int, mixed>
Parameters
$messageFields : array<string|int, mixed>

Command arguments.

[
	(int) TO_USER_ID
	(int) FROM_USER_ID
	(string) DIALOG_ID
	(array) PARAMS
	(string) MESSAGE
	(array | \CIMMessageParamAttach) ATTACH
	(array | Keyboard) KEYBOARD
	(string) SYSTEM - N|Y
	(string) URL_PREVIEW  - N|Y
]
Return values
array<string|int, mixed>

sendNotifyAboutChangeLevel()

Forwards message into recent dialogs about support lever change.

public static sendNotifyAboutChangeLevel(array<string|int, mixed> $params) : bool
Parameters
$params : array<string|int, mixed>

Command arguments.

[
	(array) BUSINESS_USERS
	(bool) IS_SUPPORT_LEVEL_CHANGE
	(bool) IS_SUPPORT_CODE_CHANGE
	(bool) IS_DEMO_LEVEL_CHANGE
]
Return values
bool

sendNotifyChangeLicence()

Sends notify change licence.

public static sendNotifyChangeLicence(array<string|int, mixed> $params) : bool
Parameters
$params : array<string|int, mixed>

Command arguments.

[
	(string) PREVIOUS_LICENCE_TYPE
	(string) PREVIOUS_LICENCE_NAME
	(string) CURRENT_LICENCE_TYPE
	(string) CURRENT_LICENCE_NAME
	(string) PREVIOUS_BOT_CODE
	(string) CURRENT_BOT_CODE
	(string) MESSAGE
]
Tags
see
ClientChangeLicence
Return values
bool

sendRequestFinalizeSession()

Sends finalize session notification.

public static sendRequestFinalizeSession([array<string|int, mixed> $params = [] ]) : bool
Parameters
$params : array<string|int, mixed> = []

Command arguments.

[
	(string) MESSAGE
]
Return values
bool

sendUnregisterRequest()

Sends unregister bot request.

public static sendUnregisterRequest(string $code, int $botId) : bool
Parameters
$code : string

Open line code.

$botId : int

Bot id.

Tags
see
UnRegisterBot
Return values
bool

setBotId()

Saves new Id of the registered bot.

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

setNetworkBotId()

Saves new open line bot id.

public static setNetworkBotId(string $lineCode, int $botId) : bool
Parameters
$lineCode : string

Line code.

$botId : int

Bot Id.

Return values
bool

setQuestionLimit()

Returns the limit for additional questions.

public static setQuestionLimit(int $limit[, int|null $botId = null ]) : void
Parameters
$limit : int

-1 - Functional is disabled, 0 - There is no limit, n - Max number for sessions allowed.

$botId : int|null = null

showMenu()

Display ITR menu.

public static showMenu(array<string|int, mixed> $params) : bool
Parameters
$params : array<string|int, mixed>

Command arguments.

[
  (string) DIALOG_ID Dialog id.
  (int) MESSAGE_ID Previous message id.
  (string) COMMAND
  (string) COMMAND_PARAMS
  (bool) FULL_REDRAW Drop previous menu block.
]
.
Tags
see
MenuBot::showMenu
Return values
bool

stopMenuTrack()

Stops show menu to user.

public static stopMenuTrack(string $dialogId) : void
Parameters
$dialogId : string

User or chat id.

unRegister()

Unregisters bot at portal.

public static unRegister([string $code = '' ][, bool $notifyController = true ]) : bool
Parameters
$code : string = ''

Open Line Id.

$notifyController : bool = true

Send unregister notification request to controller.

Return values
bool

unRegisterConnector()

public static unRegisterConnector(int $lineId) : bool|array<string|int, mixed>
Parameters
$lineId : int
Return values
bool|array<string|int, mixed>

updateBotProperties()

public static updateBotProperties() : bool
Return values
bool

updateConnector()

public static updateConnector(int $lineId, array<string|int, mixed> $fields) : bool|array<string|int, mixed>
Parameters
$lineId : int
$fields : array<string|int, mixed>
Return values
bool|array<string|int, mixed>

uploadAvatar()

Dowlloads user avatar via supplied image url.

public static uploadAvatar([string $avatarUrl = '' ][, string $hash = '' ]) : array<string|int, mixed>|string
Parameters
$avatarUrl : string = ''

Image url.

$hash : string = ''

Salt string for auto naming.

Return values
array<string|int, mixed>|string

uploadIcon()

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

        
On this page

Search results