bootdesk/chat-sdk

Chat
in package

Table of Contents

Properties

$conversationManager  : ConversationManager
$state  : StateAdapter
$adapterResolver  : AdapterResolver|null
$adapters  : array<string, Adapter>
$broadcaster  : BroadcastAdapter|null
$concurrentSlots  : array<string, int>
$config  : array<string|int, mixed>
$dispatcher  : EventDispatcher
$identityResolver  : Closure|null
$initialized  : bool
$listenerProvider  : ListenerProvider
$messageHandlers  : array<string, callable>
$middleware  : MiddlewareDispatcher
$responseFactory  : ResponseFactoryInterface|null
$stateInitialized  : bool
$transcriptsApi  : TranscriptsApi|null

Methods

__construct()  : mixed
addReceivingMiddleware()  : self
addSendingMiddleware()  : self
addWebhookEventMiddleware()  : self
addWebhookMiddleware()  : self
channel()  : Channel
getAndDeleteModalContext()  : array<string|int, mixed>|null
getBroadcastAdapter()  : BroadcastAdapter|null
getMiddleware()  : MiddlewareDispatcher
getSendingMiddleware()  : array<string|int, SendingMiddleware>
getTranscripts()  : TranscriptsApi|null
getUser()  : UserInfo|null
handleWebhook()  : ResponseInterface
initialize()  : void
listen()  : self
onAction()  : self
onAppHomeOpened()  : self
onAssistantContextChanged()  : self
onAssistantThreadStarted()  : self
onDirectMessage()  : self
onMemberJoinedChannel()  : self
onMessageDelivered()  : self
onMessageFailed()  : self
onMessageRead()  : self
onModalClose()  : self
onModalSubmit()  : self
onNewMention()  : self
onNewMessage()  : self
onOptionsLoad()  : self
onReaction()  : self
onSlashCommand()  : self
onSubscribedMessage()  : self
openDM()  : string|null
processAction()  : void
processAppHomeOpened()  : void
processAssistantContextChanged()  : void
processAssistantThreadStarted()  : void
processMemberJoinedChannel()  : void
processMessage()  : void
processMessageDelivered()  : void
processMessageFailed()  : void
processMessageRead()  : void
processModalClose()  : void
processModalSubmit()  : void
processOptionsLoad()  : array<string|int, mixed>|null
processReaction()  : void
processSlashCommand()  : void
registerAdapter()  : self
resolveAdapter()  : Adapter|null
resolveIdentity()  : string|null
setBroadcastAdapter()  : void
shutdown()  : void
storeModalContext()  : void
thread()  : Thread
dequeueAll()  : array<string|int, Message>
dispatch()  : object
dispatchIncomingMessage()  : void
dispatchOptionsLoadHandlers()  : array<string|int, mixed>|null
dispatchStatusEvent()  : void
dispatchWebhookEvent()  : void
drainAllQueued()  : void
initAdapter()  : void
processConcurrent()  : void
processDebounce()  : void
processDrop()  : void
processQueue()  : void
runReceivingMiddleware()  : Message|null
webhookResponse()  : ResponseInterface

Properties

$concurrentSlots

private array<string, int> $concurrentSlots = []

$config read-only

private array<string|int, mixed> $config = []

$identityResolver

private Closure|null $identityResolver = null

$initialized

private bool $initialized = false

$messageHandlers

private array<string, callable> $messageHandlers = []

$responseFactory

private ResponseFactoryInterface|null $responseFactory = null

$stateInitialized

private bool $stateInitialized = false

Methods

__construct()

public __construct(StateAdapter $state[, array<string|int, mixed> $adapters = [] ][, array<string|int, mixed> $config = [] ][, AdapterResolver|null $adapterResolver = null ][, ResponseFactoryInterface|null $responseFactory = null ][, callable|null $identity = null ][, array<string|int, mixed>|null $transcripts = null ][, BroadcastAdapter|null $broadcaster = null ]) : mixed
Parameters
$state : StateAdapter
$adapters : array<string|int, mixed> = []
$config : array<string|int, mixed> = []
$adapterResolver : AdapterResolver|null = null
$responseFactory : ResponseFactoryInterface|null = null
$identity : callable|null = null
$transcripts : array<string|int, mixed>|null = null
$broadcaster : BroadcastAdapter|null = null

channel()

public channel(string $channelId) : Channel
Parameters
$channelId : string
Return values
Channel

getAndDeleteModalContext()

public getAndDeleteModalContext(string $adapterName, string $contextId) : array<string|int, mixed>|null
Parameters
$adapterName : string
$contextId : string
Return values
array<string|int, mixed>|null

getSendingMiddleware()

public getSendingMiddleware() : array<string|int, SendingMiddleware>

Use getMiddleware()->getMiddlewares('sending') instead

Return values
array<string|int, SendingMiddleware>

getUser()

public getUser(string $adapterName, string $userId) : UserInfo|null
Parameters
$adapterName : string
$userId : string
Return values
UserInfo|null

handleWebhook()

public handleWebhook(string $adapterName, ServerRequestInterface $request) : ResponseInterface
Parameters
$adapterName : string
$request : ServerRequestInterface
Return values
ResponseInterface

initialize()

public initialize() : void

listen()

public listen(string $eventClass, callable $listener[, string|array<string|int, mixed>|null $filter = null ][, int $priority = 0 ]) : self
Parameters
$eventClass : string
$listener : callable
$filter : string|array<string|int, mixed>|null = null
$priority : int = 0
Return values
self

onAction()

public onAction(string|array<string|int, mixed>|callable $actionId[, callable|null $handler = null ]) : self

Use listen(ActionEvent::class, $handler, $actionId) instead

Parameters
$actionId : string|array<string|int, mixed>|callable
$handler : callable|null = null
Return values
self

onAppHomeOpened()

public onAppHomeOpened(callable $handler) : self

Use listen(AppHomeOpenedEvent::class, $handler) instead

Parameters
$handler : callable
Return values
self

onAssistantContextChanged()

public onAssistantContextChanged(callable $handler) : self

Use listen(AssistantContextChangedEvent::class, $handler) instead

Parameters
$handler : callable
Return values
self

onAssistantThreadStarted()

public onAssistantThreadStarted(callable $handler) : self

Use listen(AssistantThreadStartedEvent::class, $handler) instead

Parameters
$handler : callable
Return values
self

onDirectMessage()

public onDirectMessage(callable $handler) : self

Use listen(DmEvent::class, $handler) instead

Parameters
$handler : callable
Return values
self

onMemberJoinedChannel()

public onMemberJoinedChannel(callable $handler) : self

Use listen(MemberJoinedChannelEvent::class, $handler) instead

Parameters
$handler : callable
Return values
self

onMessageDelivered()

public onMessageDelivered(callable $handler) : self

Use listen(MessageDeliveredEvent::class, $handler) instead

Parameters
$handler : callable
Return values
self

onMessageFailed()

public onMessageFailed(callable $handler) : self

Use listen(MessageFailedEvent::class, $handler) instead

Parameters
$handler : callable
Return values
self

onMessageRead()

public onMessageRead(callable $handler) : self

Use listen(MessageReadEvent::class, $handler) instead

Parameters
$handler : callable
Return values
self

onModalClose()

public onModalClose(string|array<string|int, mixed>|callable $callbackId[, callable|null $handler = null ]) : self

Use listen(ModalCloseEvent::class, $handler, $callbackId) instead

Parameters
$callbackId : string|array<string|int, mixed>|callable
$handler : callable|null = null
Return values
self

onModalSubmit()

public onModalSubmit(string|array<string|int, mixed>|callable $callbackId[, callable|null $handler = null ]) : self

Use listen(ModalSubmitEvent::class, $handler, $callbackId) instead

Parameters
$callbackId : string|array<string|int, mixed>|callable
$handler : callable|null = null
Return values
self

onNewMention()

public onNewMention(callable $handler) : self

Use listen(MentionEvent::class, $handler) instead

Parameters
$handler : callable
Return values
self

onNewMessage()

public onNewMessage(string $pattern, callable $handler) : self
Parameters
$pattern : string
$handler : callable
Return values
self

onOptionsLoad()

public onOptionsLoad(string|array<string|int, mixed>|callable $actionId[, callable|null $handler = null ]) : self

Use listen(OptionsLoadEvent::class, $handler, $actionId) instead

Parameters
$actionId : string|array<string|int, mixed>|callable
$handler : callable|null = null
Return values
self

onReaction()

public onReaction(string|array<string|int, mixed>|callable $emoji[, callable|null $handler = null ]) : self

Use listen(ReactionEvent::class, $handler, $emoji) instead

Parameters
$emoji : string|array<string|int, mixed>|callable
$handler : callable|null = null
Return values
self

onSlashCommand()

public onSlashCommand(string|array<string|int, mixed>|callable $command[, callable|null $handler = null ]) : self

Use listen(SlashCommandEvent::class, $handler, $command) instead

Parameters
$command : string|array<string|int, mixed>|callable
$handler : callable|null = null
Return values
self

onSubscribedMessage()

public onSubscribedMessage(callable $handler) : self

Use listen(SubscribedEvent::class, $handler) instead

Parameters
$handler : callable
Return values
self

openDM()

public openDM(string $adapterName, string $userId) : string|null
Parameters
$adapterName : string
$userId : string
Return values
string|null

processAction()

public processAction(Adapter $adapter, string $threadId, string $actionId, string|null $value, string $messageId, Author $user[, string|null $triggerId = null ][, mixed $raw = null ][, string|null $originId = null ]) : void
Parameters
$adapter : Adapter
$threadId : string
$actionId : string
$value : string|null
$messageId : string
$user : Author
$triggerId : string|null = null
$raw : mixed = null
$originId : string|null = null

processAppHomeOpened()

public processAppHomeOpened(Adapter $adapter, string $channelId, string $userId[, mixed $raw = null ]) : void
Parameters
$adapter : Adapter
$channelId : string
$userId : string
$raw : mixed = null

processAssistantContextChanged()

public processAssistantContextChanged(Adapter $adapter, string $channelId, string $threadId, string $userId, mixed $context[, string|null $threadTs = null ][, mixed $raw = null ]) : void
Parameters
$adapter : Adapter
$channelId : string
$threadId : string
$userId : string
$context : mixed
$threadTs : string|null = null
$raw : mixed = null

processAssistantThreadStarted()

public processAssistantThreadStarted(Adapter $adapter, string $channelId, string $threadId, string $userId, mixed $context[, string|null $threadTs = null ][, mixed $raw = null ]) : void
Parameters
$adapter : Adapter
$channelId : string
$threadId : string
$userId : string
$context : mixed
$threadTs : string|null = null
$raw : mixed = null

processMemberJoinedChannel()

public processMemberJoinedChannel(Adapter $adapter, string $channelId, string $userId[, string|null $inviterId = null ][, mixed $raw = null ]) : void
Parameters
$adapter : Adapter
$channelId : string
$userId : string
$inviterId : string|null = null
$raw : mixed = null

processMessage()

public processMessage(Adapter $adapter, string $threadId, Message $message) : void
Parameters
$adapter : Adapter
$threadId : string
$message : Message

processMessageDelivered()

public processMessageDelivered(string $threadId, array<string|int, mixed> $messageIds, string $userId[, mixed $raw = null ][, string|null $originId = null ]) : void
Parameters
$threadId : string
$messageIds : array<string|int, mixed>
$userId : string
$raw : mixed = null
$originId : string|null = null

processMessageFailed()

public processMessageFailed(string $threadId, array<string|int, mixed> $messageIds, string $userId[, mixed $raw = null ][, string|null $originId = null ]) : void
Parameters
$threadId : string
$messageIds : array<string|int, mixed>
$userId : string
$raw : mixed = null
$originId : string|null = null

processMessageRead()

public processMessageRead(string $threadId, string $userId[, mixed $raw = null ][, int|null $timestamp = null ][, string|null $originId = null ]) : void
Parameters
$threadId : string
$userId : string
$raw : mixed = null
$timestamp : int|null = null
$originId : string|null = null

processModalClose()

public processModalClose(Adapter $adapter, string $callbackId, Author $user[, mixed $raw = null ][, string|null $viewId = null ][, string|null $contextId = null ]) : void
Parameters
$adapter : Adapter
$callbackId : string
$user : Author
$raw : mixed = null
$viewId : string|null = null
$contextId : string|null = null

processModalSubmit()

public processModalSubmit(Adapter $adapter, string $callbackId, array<string|int, mixed> $values, Author $user[, mixed $raw = null ][, string|null $viewId = null ][, string|null $contextId = null ]) : void
Parameters
$adapter : Adapter
$callbackId : string
$values : array<string|int, mixed>
$user : Author
$raw : mixed = null
$viewId : string|null = null
$contextId : string|null = null

processOptionsLoad()

public processOptionsLoad(Adapter $adapter, string $actionId, string $query, Author $user[, mixed $raw = null ]) : array<string|int, mixed>|null
Parameters
$adapter : Adapter
$actionId : string
$query : string
$user : Author
$raw : mixed = null
Return values
array<string|int, mixed>|null

processReaction()

public processReaction(Adapter $adapter, string $threadId, string $emoji, string $messageId, Author $user[, bool $added = true ][, string $rawEmoji = '' ][, mixed $raw = null ][, string|null $originId = null ]) : void
Parameters
$adapter : Adapter
$threadId : string
$emoji : string
$messageId : string
$user : Author
$added : bool = true
$rawEmoji : string = ''
$raw : mixed = null
$originId : string|null = null

processSlashCommand()

public processSlashCommand(Adapter $adapter, string $channelId, string $command, string $text[, Author|null $user = null ][, mixed $raw = null ][, string|null $triggerId = null ]) : void
Parameters
$adapter : Adapter
$channelId : string
$command : string
$text : string
$user : Author|null = null
$raw : mixed = null
$triggerId : string|null = null

registerAdapter()

public registerAdapter(string $name, Adapter $adapter) : self
Parameters
$name : string
$adapter : Adapter
Return values
self

resolveAdapter()

public resolveAdapter(string $name[, ServerRequestInterface|null $request = null ]) : Adapter|null
Parameters
$name : string
$request : ServerRequestInterface|null = null
Return values
Adapter|null

resolveIdentity()

public resolveIdentity(Author $author) : string|null
Parameters
$author : Author
Return values
string|null

shutdown()

public shutdown() : void

storeModalContext()

public storeModalContext(string $adapterName, string $contextId, array<string|int, mixed> $data[, int $ttlMs = 86400000 ]) : void
Parameters
$adapterName : string
$contextId : string
$data : array<string|int, mixed>
$ttlMs : int = 86400000

thread()

public thread(string $threadId) : Thread
Parameters
$threadId : string
Return values
Thread

dequeueAll()

private dequeueAll(string $threadId, Handler $handler) : array<string|int, Message>
Parameters
$threadId : string
$handler : Handler
Return values
array<string|int, Message>

dispatch()

private dispatch(object $event) : object
Parameters
$event : object
Return values
object

dispatchIncomingMessage()

private dispatchIncomingMessage(Adapter $adapter, string $threadId, Message $message, array<string|int, mixed> $skippedMessages, int $totalSinceLastHandler) : void
Parameters
$adapter : Adapter
$threadId : string
$message : Message
$skippedMessages : array<string|int, mixed>
$totalSinceLastHandler : int

dispatchOptionsLoadHandlers()

private dispatchOptionsLoadHandlers(OptionsLoadEvent $event) : array<string|int, mixed>|null
Parameters
$event : OptionsLoadEvent
Return values
array<string|int, mixed>|null

drainAllQueued()

private drainAllQueued(Adapter $adapter, string $threadId, Handler $handler) : void
Parameters
$adapter : Adapter
$threadId : string
$handler : Handler

processConcurrent()

private processConcurrent(Adapter $adapter, string $threadId, Message $message, int $maxConcurrent) : void
Parameters
$adapter : Adapter
$threadId : string
$message : Message
$maxConcurrent : int

processDebounce()

private processDebounce(Adapter $adapter, string $threadId, string $lockKey, Message $message, Handler $handler, int $debounceMs, int $maxQueueSize) : void
Parameters
$adapter : Adapter
$threadId : string
$lockKey : string
$message : Message
$handler : Handler
$debounceMs : int
$maxQueueSize : int

processDrop()

private processDrop(Adapter $adapter, string $threadId, string $lockKey, Message $message, Handler $handler) : void
Parameters
$adapter : Adapter
$threadId : string
$lockKey : string
$message : Message
$handler : Handler

processQueue()

private processQueue(Adapter $adapter, string $threadId, string $lockKey, Message $message, Handler $handler, int $maxQueueSize) : void
Parameters
$adapter : Adapter
$threadId : string
$lockKey : string
$message : Message
$handler : Handler
$maxQueueSize : int

webhookResponse()

private webhookResponse(Adapter $adapter) : ResponseInterface
Parameters
$adapter : Adapter
Return values
ResponseInterface
On this page

Search results