TelegramBot
Table of Contents
-
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'
-
$token
: string
-
__construct()
: mixed
-
sendRequest()
: array<string|int, mixed>
-
getResponseError()
: string
-
responseIsOk()
: bool
-
getUrl()
: string
-
parseResponse()
: array<string|int, mixed>
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'
$token
private
string
$token
__construct()
public
__construct(string $token) : mixed
Parameters
-
$token
: string
-
Return values
mixed
—
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
—
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>
—