PHP Class TelegramBot\Api\BotApi

Afficher le fichier Open project: TelegramBot/Api Class Usage Examples

Méthodes publiques

Свойство Type Description
$codes array HTTP codes

Protected Properties

Свойство 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

Méthodes publiques

Méthode 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, AbstractInlineQueryResult[] $results, integer $cacheTime = 300, boolean $isPersonal = false, string $nextOffset = '' ) : mixed 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 ) : Message 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 ) : Message 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 ) : Message 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 ) : Message 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 ( ) : User 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 ) : Message 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 ) : Message 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 ) : Message 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 ) : Message 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 ) : Message 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 ) : Message 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 ) : Message 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 ) : Message 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 ) : Message 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 ) : Message 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 ( Message $message, string $eventName = 'Message' ) 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.

Méthodes protégées

Méthode Description
executeCurl ( array $options ) : string curl_exec wrapper for response validation

Method Details

__construct() public méthode

Constructor
public __construct ( string $token, string | null $trackerToken = null )
$token string Telegram Bot API token
$trackerToken string | null Yandex AppMetrica application api_key

__destruct() public méthode

Close curl
public __destruct ( )

answerCallbackQuery() public méthode

The answer will be displayed to the user as a notification at the top of the chat screen or as an alert.
public answerCallbackQuery ( $callbackQueryId, null $text = null, boolean $showAlert = false ) : boolean
$callbackQueryId
$text null
$showAlert boolean
Résultat boolean

answerInlineQuery() public méthode

No more than 50 results per query are allowed.
public answerInlineQuery ( string $inlineQueryId, AbstractInlineQueryResult[] $results, integer $cacheTime = 300, boolean $isPersonal = false, string $nextOffset = '' ) : mixed
$inlineQueryId string
$results TelegramBot\Api\Types\Inline\QueryResult\AbstractInlineQueryResult[]
$cacheTime integer
$isPersonal boolean
$nextOffset string
Résultat mixed

call() public méthode

Call method
public call ( string $method, array $data = null ) : mixed
$method string
$data array
Résultat mixed

curlValidate() public static méthode

Response validation
public static curlValidate ( resource $curl )
$curl resource

downloadFile() public méthode

Get file contents via cURL
public downloadFile ( $fileId ) : string
$fileId
Résultat string

editMessageCaption() public méthode

Use this method to edit text messages sent by the bot or via the bot
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 ) : Message
$chatId integer | string
$messageId integer
$caption string | null
$replyMarkup TelegramBot\Api\Types\ReplyKeyboardMarkup | TelegramBot\Api\Types\ReplyKeyboardHide | TelegramBot\Api\Types\ForceReply | null
Résultat TelegramBot\Api\Types\Message

editMessageReplyMarkup() public méthode

Use this method to edit only the reply markup of messages sent by the bot or via the bot
public editMessageReplyMarkup ( integer | string $chatId, integer $messageId, TelegramBot\Api\Types\ReplyKeyboardMarkup | TelegramBot\Api\Types\ReplyKeyboardHide | TelegramBot\Api\Types\ForceReply | null $replyMarkup = null ) : Message
$chatId integer | string
$messageId integer
$replyMarkup TelegramBot\Api\Types\ReplyKeyboardMarkup | TelegramBot\Api\Types\ReplyKeyboardHide | TelegramBot\Api\Types\ForceReply | null
Résultat TelegramBot\Api\Types\Message

editMessageText() public méthode

Use this method to edit text messages sent by the bot or via the bot
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 ) : Message
$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
Résultat TelegramBot\Api\Types\Message

executeCurl() protected méthode

curl_exec wrapper for response validation
protected executeCurl ( array $options ) : string
$options array
Résultat string

forwardMessage() public méthode

Use this method to forward messages of any kind. On success, the sent Message is returned.
public forwardMessage ( integer | string $chatId, integer $fromChatId, integer $messageId, boolean $disableNotification = false ) : Message
$chatId integer | string chat_id or @channel_name
$fromChatId integer
$messageId integer
$disableNotification boolean
Résultat TelegramBot\Api\Types\Message

getFile() public méthode

For the moment, bots can download files of up to 20MB in size. On success, a File object is returned. The file can then be downloaded via the link https://api.telegram.org/file/bot/, where is taken from the response. It is guaranteed that the link will be valid for at least 1 hour. When the link expires, a new one can be requested by calling getFile again.
public getFile ( $fileId ) : TelegramBot\Api\Types\File
$fileId
Résultat TelegramBot\Api\Types\File

getFileUrl() public méthode

public getFileUrl ( ) : string
Résultat string

getMe() public méthode

Returns basic information about the bot in form of a User object.
public getMe ( ) : User
Résultat TelegramBot\Api\Types\User

getUpdates() public méthode

An Array of Update objects is returned. Notes 1. This method will not work if an outgoing webhook is set up. 2. In order to avoid getting duplicate updates, recalculate offset after each server response.
public getUpdates ( integer $offset, integer $limit = 100, integer $timeout ) : TelegramBot\Api\Types\Update[]
$offset integer
$limit integer
$timeout integer
Résultat TelegramBot\Api\Types\Update[]

getUrl() public méthode

public getUrl ( ) : string
Résultat string

getUserProfilePhotos() public méthode

Use this method to get a list of profile pictures for a user.
public getUserProfilePhotos ( integer $userId, integer $offset, integer $limit = 100 ) : TelegramBot\Api\Types\UserProfilePhotos
$userId integer
$offset integer
$limit integer
Résultat TelegramBot\Api\Types\UserProfilePhotos

jsonValidate() public static méthode

JSON validation
public static jsonValidate ( string $jsonString, boolean $asArray ) : object | array
$jsonString string
$asArray boolean
Résultat object | array

kickChatMember() public méthode

In the case of supergroups, the user will not be able to return to the group on their own using invite links, etc., unless unbanned first. The bot must be an administrator in the group for this to work. Returns True on success.
public kickChatMember ( integer | string $chatId, integer $userId ) : boolean
$chatId integer | string Unique identifier for the target group or username of the target supergroup (in the format @supergroupusername)
$userId integer Unique identifier of the target user
Résultat boolean

sendAudio() public méthode

Your audio must be in the .mp3 format. On success, the sent Message is returned. Bots can currently send audio files of up to 50 MB in size, this limit may be changed in the future. For backward compatibility, when the fields title and performer are both empty and the mime-type of the file to be sent is not audio/mpeg, the file will be sent as a playable voice message. For this to work, the audio must be in an .ogg file encoded with OPUS. This behavior will be phased out in the future. For sending voice messages, use the sendVoice method instead.
Deprecation: since 20th February. Removed backward compatibility from the method sendAudio. Voice messages now must be sent using the method sendVoice. There is no more need to specify a non-empty title or performer while sending the audio by file_id.
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 ) : Message
$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
Résultat TelegramBot\Api\Types\Message

sendChatAction() public méthode

The status is set for 5 seconds or less (when a message arrives from your bot, Telegram clients clear its typing status). We only recommend using this method when a response from the bot will take a noticeable amount of time to arrive. Type of action to broadcast. Choose one, depending on what the user is about to receive: typing for text messages, upload_photo for photos, record_video or upload_video for videos, record_audio or upload_audio for audio files, upload_document for general files, find_location for location data.
public sendChatAction ( integer $chatId, string $action ) : boolean
$chatId integer
$action string
Résultat boolean

sendContact() public méthode

Use this method to send phone contacts
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 ) : Message
$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
Résultat TelegramBot\Api\Types\Message

sendDocument() public méthode

Bots can currently send files of any type of up to 50 MB in size, this limit may be changed in the future.
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 ) : Message
$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
Résultat TelegramBot\Api\Types\Message

sendLocation() public méthode

Use this method to send point on the map. On success, the sent Message is returned.
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 ) : Message
$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
Résultat TelegramBot\Api\Types\Message

sendMessage() public méthode

Use this method to send text messages. On success, the sent \TelegramBot\Api\Types\Message is returned.
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 ) : Message
$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
Résultat TelegramBot\Api\Types\Message

sendPhoto() public méthode

Use this method to send photos. On success, the sent Message is returned.
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 ) : Message
$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
Résultat TelegramBot\Api\Types\Message

sendSticker() public méthode

Use this method to send .webp stickers. On success, the sent Message is returned.
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 ) : Message
$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
Résultat TelegramBot\Api\Types\Message

sendVenue() public méthode

Use this method to send information about a venue. On success, the sent Message is returned.
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 ) : Message
$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
Résultat TelegramBot\Api\Types\Message

sendVideo() public méthode

On success, the sent Message is returned.
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 ) : Message
$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
Résultat TelegramBot\Api\Types\Message

sendVoice() public méthode

For this to work, your audio must be in an .ogg file encoded with OPUS (other formats may be sent as Audio or Document). On success, the sent Message is returned. Bots can currently send voice messages of up to 50 MB in size, this limit may be changed in the future.
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 ) : Message
$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
Résultat TelegramBot\Api\Types\Message

setModeObject() public méthode

Set return array
public setModeObject ( boolean $mode = true )
$mode boolean

setWebhook() public méthode

Whenever there is an update for the bot, we will send an HTTPS POST request to the specified url, containing a JSON-serialized Update. In case of an unsuccessful request, we will give up after a reasonable amount of attempts.
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
Résultat string

track() public méthode

Wrapper for tracker
public track ( Message $message, string $eventName = 'Message' )
$message TelegramBot\Api\Types\Message
$eventName string

trackUpdate() public méthode

public trackUpdate ( TelegramBot\Api\Types\Update $update, string $eventName = 'Message' )
$update TelegramBot\Api\Types\Update
$eventName string

unbanChatMember() public méthode

The user will not return to the group automatically, but will be able to join via link, etc. The bot must be an administrator in the group for this to work. Returns True on success.
public unbanChatMember ( integer | string $chatId, integer $userId ) : boolean
$chatId integer | string Unique identifier for the target group or username of the target supergroup (in the format @supergroupusername)
$userId integer Unique identifier of the target user
Résultat boolean

Property Details

$codes public_oe static_oe property

HTTP codes
public static array $codes
Résultat array

$curl protected_oe property

CURL object
protected $curl

$returnArray protected_oe property

Check whether return associative array
protected bool $returnArray
Résultat boolean

$token protected_oe property

Bot token
protected string $token
Résultat string

$trackedEvents protected_oe property

list of event ids
protected array $trackedEvents
Résultat array

$tracker protected_oe property

Botan tracker
protected Botan,TelegramBot\Api $tracker
Résultat TelegramBot\Api\Botan