bootdesk/chat-sdk

ConversationManager
in package

Table of Contents

Properties

$factory  : callable(string): Conversation
$logger  : LoggerInterface|null
$pendingSyntheticMessage  : Message|null

Methods

__construct()  : mixed
clear()  : void
Clear any active conversation state for the given thread.
consumePendingSyntheticMessage()  : Message|null
Return a synthetic message from an action fallthrough, if one was stored during the last interceptAction call. Clears the stored message.
intercept()  : bool
Intercept an incoming message for an active conversation.
interceptAction()  : bool
Intercept an action event during an active conversation.
interceptReaction()  : bool
Intercept a reaction during an active conversation.
interceptSlashCommand()  : bool
Intercept a slash command during an active conversation.
start()  : void
Start a new conversation. Clears existing state and calls run() immediately.
interceptEvent()  : bool
Generic non-message event intercept.

Properties

Methods

__construct()

public __construct([LoggerInterface|null $logger = null ][, callable|null $factory = null ]) : mixed
Parameters
$logger : LoggerInterface|null = null
$factory : callable|null = null

consumePendingSyntheticMessage()

Return a synthetic message from an action fallthrough, if one was stored during the last interceptAction call. Clears the stored message.

public consumePendingSyntheticMessage() : Message|null
Return values
Message|null

intercept()

Intercept an incoming message for an active conversation.

public intercept(Thread $thread, Message $message) : bool

Returns true if the message was consumed by the conversation, false if no active conversation exists.

Parameters
$thread : Thread
$message : Message
Return values
bool

interceptAction()

Intercept an action event during an active conversation.

public interceptAction(Thread $thread, ActionEvent $action) : bool

Returns true if the conversation consumed the event.

Parameters
$thread : Thread
$action : ActionEvent
Return values
bool

start()

Start a new conversation. Clears existing state and calls run() immediately.

public start(string $class, Thread $thread, Message $message) : void
Parameters
$class : string
$thread : Thread
$message : Message

interceptEvent()

Generic non-message event intercept.

private interceptEvent(Thread $thread, object $event, string $method) : bool
Parameters
$thread : Thread
$event : object
$method : string
Return values
bool
On this page

Search results