AirLay backend

TelegramMessageSender extends TelegramBot
in package
implements MessageSenderInterface

Interfaces, Classes, Traits and Enums

MessageSenderInterface

Table of Contents

ALLOWED_HTML_TAGS  = ['<b>', '<strong>', '<i>', '<em>', '<u>', '<ins>', '<s>', '<strike>', '<del>', '<s>', '<u>', '<a>', '<code>', '<pre>']
BASE_BOT_URL  = 'https://api.telegram.org/bot'
MSG_CODE_MAP  = [self::MSG_REQUEST_SEND_ERROR => 1, self::MSG_RESPONSE_DECODE_ERROR => 2]
MSG_REQUEST_SEND_ERROR  = 'Request send error'
MSG_RESPONSE_DECODE_ERROR  = 'Response decode error'
$error  : string|null
$renderEngine  : Mustache_Engine
$token  : string
__construct()  : mixed
getError()  : string|null
sendMessage()  : bool
sendRequest()  : array<string|int, mixed>
getResponseError()  : string
responseIsOk()  : bool
getHtmlBodyContent()  : string
getUrl()  : string
parseResponse()  : array<string|int, mixed>
render()  : string

Constants

ALLOWED_HTML_TAGS

private mixed ALLOWED_HTML_TAGS = ['<b>', '<strong>', '<i>', '<em>', '<u>', '<ins>', '<s>', '<strike>', '<del>', '<s>', '<u>', '<a>', '<code>', '<pre>']

BASE_BOT_URL

private mixed BASE_BOT_URL = 'https://api.telegram.org/bot'

MSG_CODE_MAP

private mixed MSG_CODE_MAP = [self::MSG_REQUEST_SEND_ERROR => 1, self::MSG_RESPONSE_DECODE_ERROR => 2]

MSG_REQUEST_SEND_ERROR

private mixed MSG_REQUEST_SEND_ERROR = 'Request send error'

MSG_RESPONSE_DECODE_ERROR

private mixed MSG_RESPONSE_DECODE_ERROR = 'Response decode error'

Properties

Methods

__construct()

public __construct(string $token) : mixed
Parameters
$token : string
Return values
mixed

sendMessage()

public sendMessage(string $address, MessageInterface $message[, string $name = '' ][, bool $sendAdditional = true ]) : bool
Parameters
$address : string
$message : MessageInterface
$name : string = ''
$sendAdditional : bool = true
Return values
bool

sendRequest()

public sendRequest(string $operation, array<string|int, mixed> $params) : array<string|int, mixed>
Parameters
$operation : string
$params : array<string|int, mixed>
Return values
array<string|int, mixed>

getResponseError()

protected getResponseError(array<string|int, mixed> $response) : string
Parameters
$response : array<string|int, mixed>
Return values
string

responseIsOk()

protected responseIsOk(array<string|int, mixed> $response) : bool
Parameters
$response : array<string|int, mixed>
Return values
bool

getHtmlBodyContent()

private getHtmlBodyContent(string $content) : string
Parameters
$content : string
Return values
string

getUrl()

private getUrl(string $operation) : string
Parameters
$operation : string
Return values
string

parseResponse()

private parseResponse(string $rawResponse) : array<string|int, mixed>
Parameters
$rawResponse : string
Return values
array<string|int, mixed>

Search results