Property | Type | Description | |
---|---|---|---|
$codes | array | HTTP codes |
Property | Type | Description | |
---|---|---|---|
$curl | CURL object | ||
$returnArray | boolean | Check whether return associative array | |
$token | string | Bot token | |
$trackedEvents | array | list of event ids | |
$tracker | TelegramBot\Api\Botan | Botan tracker |
Method | Description | |
---|---|---|
__construct ( string $token, string | null $trackerToken = null ) | Constructor | |
__destruct ( ) | Close curl | |
answerCallbackQuery ( $callbackQueryId, null $text = null, boolean $showAlert = false ) : boolean | Use this method to send answers to callback queries sent from inline keyboards. | |
answerInlineQuery ( string $inlineQueryId, |
Use this method to send answers to an inline query. On success, True is returned. | |
call ( string $method, array $data = null ) : mixed | Call method | |
curlValidate ( resource $curl ) | Response validation | |
downloadFile ( $fileId ) : string | Get file contents via cURL | |
editMessageCaption ( integer | string $chatId, integer $messageId, string | null $caption = null, TelegramBot\Api\Types\ReplyKeyboardMarkup | TelegramBot\Api\Types\ReplyKeyboardHide | TelegramBot\Api\Types\ForceReply | null $replyMarkup = null ) : |
Use this method to edit text messages sent by the bot or via the bot | |
editMessageReplyMarkup ( integer | string $chatId, integer $messageId, TelegramBot\Api\Types\ReplyKeyboardMarkup | TelegramBot\Api\Types\ReplyKeyboardHide | TelegramBot\Api\Types\ForceReply | null $replyMarkup = null ) : |
Use this method to edit only the reply markup of messages sent by the bot or via the bot | |
editMessageText ( integer | string $chatId, integer $messageId, string $text, string | null $parseMode = null, boolean $disablePreview = false, TelegramBot\Api\Types\ReplyKeyboardMarkup | TelegramBot\Api\Types\ReplyKeyboardHide | TelegramBot\Api\Types\ForceReply | null $replyMarkup = null ) : |
Use this method to edit text messages sent by the bot or via the bot | |
forwardMessage ( integer | string $chatId, integer $fromChatId, integer $messageId, boolean $disableNotification = false ) : |
Use this method to forward messages of any kind. On success, the sent Message is returned. | |
getFile ( $fileId ) : TelegramBot\Api\Types\File | Use this method to get basic info about a file and prepare it for downloading. | |
getFileUrl ( ) : string | ||
getMe ( ) : |
A simple method for testing your bot's auth token.Requires no parameters. | |
getUpdates ( integer $offset, integer $limit = 100, integer $timeout ) : TelegramBot\Api\Types\Update[] | Use this method to receive incoming updates using long polling. | |
getUrl ( ) : string | ||
getUserProfilePhotos ( integer $userId, integer $offset, integer $limit = 100 ) : TelegramBot\Api\Types\UserProfilePhotos | Use this method to get a list of profile pictures for a user. | |
jsonValidate ( string $jsonString, boolean $asArray ) : object | array | JSON validation | |
kickChatMember ( integer | string $chatId, integer $userId ) : boolean | Use this method to kick a user from a group or a supergroup. | |
sendAudio ( integer | string $chatId, CURLFile | string $audio, integer | null $duration = null, string | null $performer = null, string | null $title = null, integer | null $replyToMessageId = null, TelegramBot\Api\Types\ReplyKeyboardMarkup | TelegramBot\Api\Types\ReplyKeyboardHide | TelegramBot\Api\Types\ForceReply | null $replyMarkup = null, boolean $disableNotification = false ) : |
Use this method to send audio files, if you want Telegram clients to display them in the music player. | |
sendChatAction ( integer $chatId, string $action ) : boolean | Use this method when you need to tell the user that something is happening on the bot's side. | |
sendContact ( integer | string $chatId, string $phoneNumber, string $firstName, string $lastName = null, integer | null $replyToMessageId = null, TelegramBot\Api\Types\ReplyKeyboardMarkup | TelegramBot\Api\Types\ReplyKeyboardHide | TelegramBot\Api\Types\ForceReply | null $replyMarkup = null, boolean $disableNotification = false ) : |
Use this method to send phone contacts | |
sendDocument ( integer | string $chatId, CURLFile | string $document, integer | null $replyToMessageId = null, TelegramBot\Api\Types\ReplyKeyboardMarkup | TelegramBot\Api\Types\ReplyKeyboardHide | TelegramBot\Api\Types\ForceReply | null $replyMarkup = null, boolean $disableNotification = false ) : |
Use this method to send general files. On success, the sent Message is returned. | |
sendLocation ( integer $chatId, float $latitude, float $longitude, integer | null $replyToMessageId = null, TelegramBot\Api\Types\ReplyKeyboardMarkup | TelegramBot\Api\Types\ReplyKeyboardHide | TelegramBot\Api\Types\ForceReply | null $replyMarkup = null, boolean $disableNotification = false ) : |
Use this method to send point on the map. On success, the sent Message is returned. | |
sendMessage ( integer | string $chatId, string $text, string | null $parseMode = null, boolean $disablePreview = false, integer | null $replyToMessageId = null, TelegramBot\Api\Types\ReplyKeyboardMarkup | TelegramBot\Api\Types\ReplyKeyboardHide | TelegramBot\Api\Types\ForceReply | null $replyMarkup = null, boolean $disableNotification = false ) : |
Use this method to send text messages. On success, the sent \TelegramBot\Api\Types\Message is returned. | |
sendPhoto ( integer | string $chatId, CURLFile | string $photo, string | null $caption = null, integer | null $replyToMessageId = null, TelegramBot\Api\Types\ReplyKeyboardMarkup | TelegramBot\Api\Types\ReplyKeyboardHide | TelegramBot\Api\Types\ForceReply | null $replyMarkup = null, boolean $disableNotification = false ) : |
Use this method to send photos. On success, the sent Message is returned. | |
sendSticker ( integer | string $chatId, CURLFile | string $sticker, integer | null $replyToMessageId = null, TelegramBot\Api\Types\ReplyKeyboardMarkup | TelegramBot\Api\Types\ReplyKeyboardHide | TelegramBot\Api\Types\ForceReply | null $replyMarkup = null, boolean $disableNotification = false ) : |
Use this method to send .webp stickers. On success, the sent Message is returned. | |
sendVenue ( integer | string $chatId, float $latitude, float $longitude, string $title, string $address, string | null $foursquareId = null, integer | null $replyToMessageId = null, TelegramBot\Api\Types\ReplyKeyboardMarkup | TelegramBot\Api\Types\ReplyKeyboardHide | TelegramBot\Api\Types\ForceReply | null $replyMarkup = null, boolean $disableNotification = false ) : |
Use this method to send information about a venue. On success, the sent Message is returned. | |
sendVideo ( integer | string $chatId, CURLFile | string $video, integer | null $duration = null, string | null $caption = null, integer | null $replyToMessageId = null, TelegramBot\Api\Types\ReplyKeyboardMarkup | TelegramBot\Api\Types\ReplyKeyboardHide | TelegramBot\Api\Types\ForceReply | null $replyMarkup = null, boolean $disableNotification = false ) : |
Use this method to send video files, Telegram clients support mp4 videos (other formats may be sent as Document). | |
sendVoice ( integer | string $chatId, CURLFile | string $voice, integer | null $duration = null, integer | null $replyToMessageId = null, TelegramBot\Api\Types\ReplyKeyboardMarkup | TelegramBot\Api\Types\ReplyKeyboardHide | TelegramBot\Api\Types\ForceReply | null $replyMarkup = null, boolean $disableNotification = false ) : |
Use this method to send audio files, if you want Telegram clients to display the file as a playable voice message. | |
setModeObject ( boolean $mode = true ) | Set return array | |
setWebhook ( string $url = '', CURLFile | string $certificate = null ) : string | Use this method to specify a url and receive incoming updates via an outgoing webhook. | |
track ( |
Wrapper for tracker | |
trackUpdate ( TelegramBot\Api\Types\Update $update, string $eventName = 'Message' ) | ||
unbanChatMember ( integer | string $chatId, integer $userId ) : boolean | Use this method to unban a previously kicked user in a supergroup. |
Method | Description | |
---|---|---|
executeCurl ( array $options ) : string | curl_exec wrapper for response validation |
public answerInlineQuery ( string $inlineQueryId, |
||
$inlineQueryId | string | |
$results | ||
$cacheTime | integer | |
$isPersonal | boolean | |
$nextOffset | string | |
return | mixed |
public static curlValidate ( resource $curl ) | ||
$curl | resource |
public downloadFile ( $fileId ) : string | ||
$fileId | ||
return | string |
public editMessageCaption ( integer | string $chatId, integer $messageId, string | null $caption = null, TelegramBot\Api\Types\ReplyKeyboardMarkup | TelegramBot\Api\Types\ReplyKeyboardHide | TelegramBot\Api\Types\ForceReply | null $replyMarkup = null ) : |
||
$chatId | integer | string | |
$messageId | integer | |
$caption | string | null | |
$replyMarkup | TelegramBot\Api\Types\ReplyKeyboardMarkup | TelegramBot\Api\Types\ReplyKeyboardHide | TelegramBot\Api\Types\ForceReply | null | |
return |
public editMessageReplyMarkup ( integer | string $chatId, integer $messageId, TelegramBot\Api\Types\ReplyKeyboardMarkup | TelegramBot\Api\Types\ReplyKeyboardHide | TelegramBot\Api\Types\ForceReply | null $replyMarkup = null ) : |
||
$chatId | integer | string | |
$messageId | integer | |
$replyMarkup | TelegramBot\Api\Types\ReplyKeyboardMarkup | TelegramBot\Api\Types\ReplyKeyboardHide | TelegramBot\Api\Types\ForceReply | null | |
return |
public editMessageText ( integer | string $chatId, integer $messageId, string $text, string | null $parseMode = null, boolean $disablePreview = false, TelegramBot\Api\Types\ReplyKeyboardMarkup | TelegramBot\Api\Types\ReplyKeyboardHide | TelegramBot\Api\Types\ForceReply | null $replyMarkup = null ) : |
||
$chatId | integer | string | |
$messageId | integer | |
$text | string | |
$parseMode | string | null | |
$disablePreview | boolean | |
$replyMarkup | TelegramBot\Api\Types\ReplyKeyboardMarkup | TelegramBot\Api\Types\ReplyKeyboardHide | TelegramBot\Api\Types\ForceReply | null | |
return |
protected executeCurl ( array $options ) : string | ||
$options | array | |
return | string |
public getFile ( $fileId ) : TelegramBot\Api\Types\File | ||
$fileId | ||
return | TelegramBot\Api\Types\File |
public getMe ( ) : |
||
return |
public sendAudio ( integer | string $chatId, CURLFile | string $audio, integer | null $duration = null, string | null $performer = null, string | null $title = null, integer | null $replyToMessageId = null, TelegramBot\Api\Types\ReplyKeyboardMarkup | TelegramBot\Api\Types\ReplyKeyboardHide | TelegramBot\Api\Types\ForceReply | null $replyMarkup = null, boolean $disableNotification = false ) : |
||
$chatId | integer | string | chat_id or @channel_name |
$audio | CURLFile | string | |
$duration | integer | null | |
$performer | string | null | |
$title | string | null | |
$replyToMessageId | integer | null | |
$replyMarkup | TelegramBot\Api\Types\ReplyKeyboardMarkup | TelegramBot\Api\Types\ReplyKeyboardHide | TelegramBot\Api\Types\ForceReply | null | |
$disableNotification | boolean | |
return |
public sendContact ( integer | string $chatId, string $phoneNumber, string $firstName, string $lastName = null, integer | null $replyToMessageId = null, TelegramBot\Api\Types\ReplyKeyboardMarkup | TelegramBot\Api\Types\ReplyKeyboardHide | TelegramBot\Api\Types\ForceReply | null $replyMarkup = null, boolean $disableNotification = false ) : |
||
$chatId | integer | string | chat_id or @channel_name |
$phoneNumber | string | |
$firstName | string | |
$lastName | string | |
$replyToMessageId | integer | null | |
$replyMarkup | TelegramBot\Api\Types\ReplyKeyboardMarkup | TelegramBot\Api\Types\ReplyKeyboardHide | TelegramBot\Api\Types\ForceReply | null | |
$disableNotification | boolean | |
return |
public sendDocument ( integer | string $chatId, CURLFile | string $document, integer | null $replyToMessageId = null, TelegramBot\Api\Types\ReplyKeyboardMarkup | TelegramBot\Api\Types\ReplyKeyboardHide | TelegramBot\Api\Types\ForceReply | null $replyMarkup = null, boolean $disableNotification = false ) : |
||
$chatId | integer | string | chat_id or @channel_name |
$document | CURLFile | string | |
$replyToMessageId | integer | null | |
$replyMarkup | TelegramBot\Api\Types\ReplyKeyboardMarkup | TelegramBot\Api\Types\ReplyKeyboardHide | TelegramBot\Api\Types\ForceReply | null | |
$disableNotification | boolean | |
return |
public sendLocation ( integer $chatId, float $latitude, float $longitude, integer | null $replyToMessageId = null, TelegramBot\Api\Types\ReplyKeyboardMarkup | TelegramBot\Api\Types\ReplyKeyboardHide | TelegramBot\Api\Types\ForceReply | null $replyMarkup = null, boolean $disableNotification = false ) : |
||
$chatId | integer | |
$latitude | float | |
$longitude | float | |
$replyToMessageId | integer | null | |
$replyMarkup | TelegramBot\Api\Types\ReplyKeyboardMarkup | TelegramBot\Api\Types\ReplyKeyboardHide | TelegramBot\Api\Types\ForceReply | null | |
$disableNotification | boolean | |
return |
public sendMessage ( integer | string $chatId, string $text, string | null $parseMode = null, boolean $disablePreview = false, integer | null $replyToMessageId = null, TelegramBot\Api\Types\ReplyKeyboardMarkup | TelegramBot\Api\Types\ReplyKeyboardHide | TelegramBot\Api\Types\ForceReply | null $replyMarkup = null, boolean $disableNotification = false ) : |
||
$chatId | integer | string | |
$text | string | |
$parseMode | string | null | |
$disablePreview | boolean | |
$replyToMessageId | integer | null | |
$replyMarkup | TelegramBot\Api\Types\ReplyKeyboardMarkup | TelegramBot\Api\Types\ReplyKeyboardHide | TelegramBot\Api\Types\ForceReply | null | |
$disableNotification | boolean | |
return |
public sendPhoto ( integer | string $chatId, CURLFile | string $photo, string | null $caption = null, integer | null $replyToMessageId = null, TelegramBot\Api\Types\ReplyKeyboardMarkup | TelegramBot\Api\Types\ReplyKeyboardHide | TelegramBot\Api\Types\ForceReply | null $replyMarkup = null, boolean $disableNotification = false ) : |
||
$chatId | integer | string | chat_id or @channel_name |
$photo | CURLFile | string | |
$caption | string | null | |
$replyToMessageId | integer | null | |
$replyMarkup | TelegramBot\Api\Types\ReplyKeyboardMarkup | TelegramBot\Api\Types\ReplyKeyboardHide | TelegramBot\Api\Types\ForceReply | null | |
$disableNotification | boolean | |
return |
public sendSticker ( integer | string $chatId, CURLFile | string $sticker, integer | null $replyToMessageId = null, TelegramBot\Api\Types\ReplyKeyboardMarkup | TelegramBot\Api\Types\ReplyKeyboardHide | TelegramBot\Api\Types\ForceReply | null $replyMarkup = null, boolean $disableNotification = false ) : |
||
$chatId | integer | string | chat_id or @channel_name |
$sticker | CURLFile | string | |
$replyToMessageId | integer | null | |
$replyMarkup | TelegramBot\Api\Types\ReplyKeyboardMarkup | TelegramBot\Api\Types\ReplyKeyboardHide | TelegramBot\Api\Types\ForceReply | null | |
$disableNotification | boolean | |
return |
public sendVenue ( integer | string $chatId, float $latitude, float $longitude, string $title, string $address, string | null $foursquareId = null, integer | null $replyToMessageId = null, TelegramBot\Api\Types\ReplyKeyboardMarkup | TelegramBot\Api\Types\ReplyKeyboardHide | TelegramBot\Api\Types\ForceReply | null $replyMarkup = null, boolean $disableNotification = false ) : |
||
$chatId | integer | string | chat_id or @channel_name |
$latitude | float | |
$longitude | float | |
$title | string | |
$address | string | |
$foursquareId | string | null | |
$replyToMessageId | integer | null | |
$replyMarkup | TelegramBot\Api\Types\ReplyKeyboardMarkup | TelegramBot\Api\Types\ReplyKeyboardHide | TelegramBot\Api\Types\ForceReply | null | |
$disableNotification | boolean | |
return |
public sendVideo ( integer | string $chatId, CURLFile | string $video, integer | null $duration = null, string | null $caption = null, integer | null $replyToMessageId = null, TelegramBot\Api\Types\ReplyKeyboardMarkup | TelegramBot\Api\Types\ReplyKeyboardHide | TelegramBot\Api\Types\ForceReply | null $replyMarkup = null, boolean $disableNotification = false ) : |
||
$chatId | integer | string | chat_id or @channel_name |
$video | CURLFile | string | |
$duration | integer | null | |
$caption | string | null | |
$replyToMessageId | integer | null | |
$replyMarkup | TelegramBot\Api\Types\ReplyKeyboardMarkup | TelegramBot\Api\Types\ReplyKeyboardHide | TelegramBot\Api\Types\ForceReply | null | |
$disableNotification | boolean | |
return |
public sendVoice ( integer | string $chatId, CURLFile | string $voice, integer | null $duration = null, integer | null $replyToMessageId = null, TelegramBot\Api\Types\ReplyKeyboardMarkup | TelegramBot\Api\Types\ReplyKeyboardHide | TelegramBot\Api\Types\ForceReply | null $replyMarkup = null, boolean $disableNotification = false ) : |
||
$chatId | integer | string | chat_id or @channel_name |
$voice | CURLFile | string | |
$duration | integer | null | |
$replyToMessageId | integer | null | |
$replyMarkup | TelegramBot\Api\Types\ReplyKeyboardMarkup | TelegramBot\Api\Types\ReplyKeyboardHide | TelegramBot\Api\Types\ForceReply | null | |
$disableNotification | boolean | |
return |
public setModeObject ( boolean $mode = true ) | ||
$mode | boolean |
public setWebhook ( string $url = '', CURLFile | string $certificate = null ) : string | ||
$url | string | HTTPS url to send updates to. Use an empty string to remove webhook integration |
$certificate | CURLFile | string | Upload your public key certificate so that the root certificate in use can be checked |
return | string |
public trackUpdate ( TelegramBot\Api\Types\Update $update, string $eventName = 'Message' ) | ||
$update | TelegramBot\Api\Types\Update | |
$eventName | string |
protected bool $returnArray | ||
return | boolean |