bootdesk/chat-sdk

MessengerCards
in package

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

Constants

Methods

cardToText()

public static cardToText(Card $card) : string
Parameters
$card : Card
Return values
string

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
Return values
string

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
Return values
string

buildButtonTemplate()

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>

convertButton()

private static convertButton(Button $button) : array<string|int, mixed>
Parameters
$button : Button
Return values
array<string|int, mixed>

convertLinkButton()

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
Return values
string

renderTableAsText()

private static renderTableAsText(Table $table) : string
Parameters
$table : Table
Return values
string

truncate()

private static truncate(string $text, int $maxLength) : string
Parameters
$text : string
$maxLength : int
Return values
string
On this page

Search results