bootdesk/chat-sdk

BotMan
in package

Table of Contents

Properties

$askCallback  : Closure|null
$audioHandlers  : array<string|int, callable>
$chat  : Chat
$currentMessage  : IncomingMessage|null
$currentThread  : Thread|null
$fallbackHandlers  : array<string|int, callable>
$fileHandlers  : array<string|int, callable>
$hearsHandlers  : array<int, array{pattern: string, handler: callable, stopsConversation: bool, skipsConversation: bool}>
$imageHandlers  : array<string|int, callable>
$locationHandlers  : array<string|int, callable>
$user  : User|null
$videoHandlers  : array<string|int, callable>

Methods

__construct()  : mixed
ask()  : void
fallback()  : self
getChat()  : Chat
getDriver()  : string
getMessage()  : IncomingMessage|null
getUser()  : User|null
group()  : void
handleCoreMessage()  : void
hears()  : self
listen()  : void
receivesAudio()  : self
receivesFiles()  : self
receivesImages()  : self
receivesLocation()  : self
receivesVideos()  : self
reply()  : void
say()  : void
sendRequest()  : void
startConversation()  : void
typesAndWaits()  : void
dispatchAttachmentHandlers()  : void
extractParams()  : array<string, string>
matchesPattern()  : bool
matchHears()  : bool
wireHandlers()  : void

Properties

$askCallback

private Closure|null $askCallback = null

$audioHandlers

private array<string|int, callable> $audioHandlers = []

$fallbackHandlers

private array<string|int, callable> $fallbackHandlers = []

$fileHandlers

private array<string|int, callable> $fileHandlers = []

$hearsHandlers

private array<int, array{pattern: string, handler: callable, stopsConversation: bool, skipsConversation: bool}> $hearsHandlers = []

$imageHandlers

private array<string|int, callable> $imageHandlers = []

$locationHandlers

private array<string|int, callable> $locationHandlers = []

$videoHandlers

private array<string|int, callable> $videoHandlers = []

Methods

__construct()

public __construct(Chat $chat) : mixed
Parameters
$chat : Chat

ask()

public ask(string|Question $question, callable $next[, array<string|int, mixed> $additionalParameters = [] ]) : void
Parameters
$question : string|Question
$next : callable
$additionalParameters : array<string|int, mixed> = []

fallback()

public fallback(callable $handler) : self
Parameters
$handler : callable
Return values
self

getDriver()

public getDriver() : string
Return values
string

group()

public group(array<string|int, mixed> $attributes, callable $callback) : void
Parameters
$attributes : array<string|int, mixed>
$callback : callable

hears()

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

listen()

public listen() : void

receivesAudio()

public receivesAudio(callable $handler) : self
Parameters
$handler : callable
Return values
self

receivesFiles()

public receivesFiles(callable $handler) : self
Parameters
$handler : callable
Return values
self

receivesImages()

public receivesImages(callable $handler) : self
Parameters
$handler : callable
Return values
self

receivesLocation()

public receivesLocation(callable $handler) : self
Parameters
$handler : callable
Return values
self

receivesVideos()

public receivesVideos(callable $handler) : self
Parameters
$handler : callable
Return values
self

sendRequest()

public sendRequest(string $method, array<string|int, mixed> $params) : void
Parameters
$method : string
$params : array<string|int, mixed>

startConversation()

public startConversation(Conversation $conversation[, string|null $threadId = null ]) : void
Parameters
$conversation : Conversation
$threadId : string|null = null

typesAndWaits()

public typesAndWaits([int $seconds = 2 ]) : void
Parameters
$seconds : int = 2

extractParams()

private extractParams(string $pattern, string $text) : array<string, string>
Parameters
$pattern : string
$text : string
Return values
array<string, string>

matchesPattern()

private matchesPattern(string $pattern, string $text) : bool
Parameters
$pattern : string
$text : string
Return values
bool

wireHandlers()

private wireHandlers() : void
On this page

Search results