MessengerCards
Table of Contents
Constants
-
CALLBACK_PREFIX
: mixed = 'chat:'
-
MAX_BUTTON_TITLE
: mixed = 20
-
MAX_BUTTONS
: mixed = 3
Methods
-
cardToText()
: string
-
decodeCallbackData()
: array<string|int, mixed>
-
encodeCallbackData()
: string
-
toMessengerPayload()
: array<string|int, mixed>
-
buildBodyText()
: string
-
buildButtonTemplate()
: array<string|int, mixed>
-
buildGenericTemplate()
: array<string|int, mixed>
-
convertButton()
: array<string|int, mixed>
-
convertLinkButton()
: array<string|int, mixed>
-
markdownToPlainText()
: string
-
renderTableAsText()
: string
-
truncate()
: string
CALLBACK_PREFIX
private
mixed
CALLBACK_PREFIX
= 'chat:'
private
mixed
MAX_BUTTON_TITLE
= 20
private
mixed
MAX_BUTTONS
= 3
cardToText()
public
static cardToText(Card $card) : string
Parameters
-
$card
: Card
-
decodeCallbackData()
public
static decodeCallbackData(string|null $data) : array<string|int, mixed>
Parameters
-
$data
: string|null
-
Return values
array<string|int, mixed>
encodeCallbackData()
public
static encodeCallbackData(string $actionId[, string|null $value = null ]) : string
Parameters
-
$actionId
: string
-
-
$value
: string|null
= null
-
toMessengerPayload()
public
static toMessengerPayload(Card $card) : array<string|int, mixed>
Parameters
-
$card
: Card
-
Return values
array<string|int, mixed>
buildBodyText()
private
static buildBodyText(Card $card) : string
Parameters
-
$card
: Card
-
private
static buildButtonTemplate(string $text, array<string|int, mixed> $buttons) : array<string|int, mixed>
Parameters
-
$text
: string
-
-
$buttons
: array<string|int, mixed>
-
Return values
array<string|int, mixed>
buildGenericTemplate()
private
static buildGenericTemplate(Card $card, array<string|int, mixed> $buttons) : array<string|int, mixed>
Parameters
-
$card
: Card
-
-
$buttons
: array<string|int, mixed>
-
Return values
array<string|int, mixed>
private
static convertButton(Button $button) : array<string|int, mixed>
Parameters
-
$button
: Button
-
Return values
array<string|int, mixed>
private
static convertLinkButton(LinkButton $button) : array<string|int, mixed>
Parameters
-
$button
: LinkButton
-
Return values
array<string|int, mixed>
markdownToPlainText()
private
static markdownToPlainText(string $markdown) : string
Parameters
-
$markdown
: string
-
renderTableAsText()
private
static renderTableAsText(Table $table) : string
Parameters
-
$table
: Table
-
truncate()
private
static truncate(string $text, int $maxLength) : string
Parameters
-
$text
: string
-
-
$maxLength
: int
-