BotMan
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
$askCallback
private
Closure|null
$askCallback
= null
$audioHandlers
private
array<string|int, callable>
$audioHandlers
= []
$chat
read-only
private
Chat
$chat
$currentMessage
private
IncomingMessage|null
$currentMessage
= null
$currentThread
private
Thread|null
$currentThread
= null
$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
= []
$user
private
User|null
$user
= null
$videoHandlers
private
array<string|int, callable>
$videoHandlers
= []
__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
-
getChat()
public
getChat() : Chat
getDriver()
public
getDriver() : string
getMessage()
public
getMessage() : IncomingMessage|null
getUser()
public
getUser() : User|null
group()
public
group(array<string|int, mixed> $attributes, callable $callback) : void
Parameters
-
$attributes
: array<string|int, mixed>
-
-
$callback
: callable
-
handleCoreMessage()
public
handleCoreMessage(MessageContext $context) : void
Parameters
-
$context
: MessageContext
-
hears()
public
hears(string $pattern, callable $handler) : self
Parameters
-
$pattern
: string
-
-
$handler
: callable
-
listen()
public
listen() : void
receivesAudio()
public
receivesAudio(callable $handler) : self
Parameters
-
$handler
: callable
-
receivesFiles()
public
receivesFiles(callable $handler) : self
Parameters
-
$handler
: callable
-
receivesImages()
public
receivesImages(callable $handler) : self
Parameters
-
$handler
: callable
-
receivesLocation()
public
receivesLocation(callable $handler) : self
Parameters
-
$handler
: callable
-
receivesVideos()
public
receivesVideos(callable $handler) : self
Parameters
-
$handler
: callable
-
reply()
public
reply(string|OutgoingMessage|Question $message[, array<string|int, mixed> $additionalParameters = [] ]) : void
Parameters
-
$message
: string|OutgoingMessage|Question
-
-
$additionalParameters
: array<string|int, mixed>
= []
-
say()
public
say(string|OutgoingMessage $message[, string|null $threadId = null ]) : void
Parameters
-
$message
: string|OutgoingMessage
-
-
$threadId
: string|null
= null
-
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
-
dispatchAttachmentHandlers()
private
dispatchAttachmentHandlers(IncomingMessage $incoming) : void
Parameters
-
$incoming
: IncomingMessage
-
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
-
matchHears()
private
matchHears(IncomingMessage $incoming) : bool
Parameters
-
$incoming
: IncomingMessage
-
wireHandlers()
private
wireHandlers() : void