PHP 클래스 telegramBot

파일 보기 프로젝트 열기: mgp25/telegram-bot-api 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$token

공개 메소드들

메소드 설명
__construct ( $token )
forceReply ( boolean $selective = false ) : string Display a reply interface to the user (act as if the user has selected the bots message and tapped 'Reply').
forwardMessage ( integer $chat_id, integer $from_chat_id, integer $message_id ) : Array Forward messages of any kind.
getFile ( String $file_id ) : On Use this method to get basic info about a file and prepare it for downloading.
getFileData ( string $file_id, string $file_path ) : On Use this method to get file Data.
getMe ( ) : Array A simple method for testing your bot's auth token.
getUserProfilePhotos ( $user_id, integer $offset = null, integer $limit = null ) : Array Get user profile photos.
getWebhookUpdates ( ) : Array Returns webhook updates sent by Telegram.
pollUpdates ( integer $offset = null, integer $timeout = null, integer $limit = null ) : Array Use this method to receive incoming updates using long polling.
replyKeyboardHide ( boolean $selective = false ) : string Hide the current custom keyboard and display the default letter-keyboard.
replyKeyboardMarkup ( array $keyboard, boolean $resize_keyboard = false, boolean $one_time_keyboard = false, boolean $selective = false ) : string Builds a custom keyboard markup.
sendAudio ( integer $chat_id, string $audio, integer $duration = null, string $performer = null, string $title = null, integer $reply_to_message_id = null, KeyboardMarkup $reply_markup = null ) : Array Send Audio.
sendChatAction ( integer $chat_id, string $action ) : Array Send Chat Action.
sendContact ( integer $chat_id, $phone_number, string $first_name, string $last_name = null, integer $reply_to_message_id = null, KeyboardMarkup $reply_markup = null ) : Array Send Contact.
sendDocument ( integer $chat_id, string $document, integer $reply_to_message_id = null, KeyboardMarkup $reply_markup = null ) : Array Send Document.
sendLocation ( integer $chat_id, float $latitude, float $longitude, integer $reply_to_message_id = null, KeyboardMarkup $reply_markup = null ) : Array Send Location.
sendMessage ( integer $chat_id, string $text, string $parse_mode = null, boolean $disable_web_page_preview = false, integer $reply_to_message_id = null, KeyboardMarkup $reply_markup = null ) : Array Send text messages.
sendPhoto ( integer $chat_id, string $photo, string $caption = null, integer $reply_to_message_id = null, KeyboardMarkup $reply_markup = null ) : Array Send Photos.
sendSticker ( integer $chat_id, string $sticker, integer $reply_to_message_id = null, KeyboardMarkup $reply_markup = null ) : Array Send Sticker.
sendVenue ( integer $chat_id, float $latitude, float $longitude, string $title, string $address, string $foursquare_id = null, integer $reply_to_message_id = null, KeyboardMarkup $reply_markup = null ) : Array Send Venue.
sendVideo ( integer $chat_id, string $video, integer $duration = null, string $caption = null, integer $reply_to_message_id = null, KeyboardMarkup $reply_markup = null ) : Array Send Video.
sendVoice ( integer $chat_id, string $audio, integer $duration = null, integer $reply_to_message_id = null, KeyboardMarkup $reply_markup = null ) : Array Send Voice.
setWebhook ( string $url, $certificate = null ) : Array Set a Webhook to receive incoming updates via an outgoing webhook.

비공개 메소드들

메소드 설명
sendRequest ( $method, $params )
uploadFile ( $method, $data )

메소드 상세

__construct() 공개 메소드

public __construct ( $token )

forceReply() 공개 정적인 메소드

Display a reply interface to the user (act as if the user has selected the bots message and tapped 'Reply').
public static forceReply ( boolean $selective = false ) : string
$selective boolean
리턴 string

forwardMessage() 공개 메소드

Forward messages of any kind.
public forwardMessage ( integer $chat_id, integer $from_chat_id, integer $message_id ) : Array
$chat_id integer
$from_chat_id integer
$message_id integer
리턴 Array

getFile() 공개 메소드

Use this method to get basic info about a file and prepare it for downloading.
public getFile ( String $file_id ) : On
$file_id String
리턴 On success, a File object is returned

getFileData() 공개 메소드

Use this method to get file Data.
또한 보기: getFile
public getFileData ( string $file_id, string $file_path ) : On
$file_id string
$file_path string Is taken from the getFile response
리턴 On success, a File Data is returned

getMe() 공개 메소드

Returns basic information about the bot in form of a User object.
public getMe ( ) : Array
리턴 Array

getUserProfilePhotos() 공개 메소드

Get user profile photos.
public getUserProfilePhotos ( $user_id, integer $offset = null, integer $limit = null ) : Array
$offset integer
$limit integer
리턴 Array

getWebhookUpdates() 공개 메소드

Works only if you set a webhook.
또한 보기: setWebhook
public getWebhookUpdates ( ) : Array
리턴 Array

pollUpdates() 공개 메소드

Use this method to receive incoming updates using long polling.
public pollUpdates ( integer $offset = null, integer $timeout = null, integer $limit = null ) : Array
$offset integer
$timeout integer
$limit integer
리턴 Array

replyKeyboardHide() 공개 정적인 메소드

Hide the current custom keyboard and display the default letter-keyboard.
public static replyKeyboardHide ( boolean $selective = false ) : string
$selective boolean
리턴 string

replyKeyboardMarkup() 공개 메소드

Builds a custom keyboard markup.
public replyKeyboardMarkup ( array $keyboard, boolean $resize_keyboard = false, boolean $one_time_keyboard = false, boolean $selective = false ) : string
$keyboard array
$resize_keyboard boolean
$one_time_keyboard boolean
$selective boolean
리턴 string

sendAudio() 공개 메소드

Send Audio.
public sendAudio ( integer $chat_id, string $audio, integer $duration = null, string $performer = null, string $title = null, integer $reply_to_message_id = null, KeyboardMarkup $reply_markup = null ) : Array
$chat_id integer
$audio string
$duration integer
$performer string
$title string
$reply_to_message_id integer
$reply_markup KeyboardMarkup
리턴 Array

sendChatAction() 공개 메소드

Send Chat Action.
public sendChatAction ( integer $chat_id, string $action ) : Array
$chat_id integer
$action string
리턴 Array

sendContact() 공개 메소드

Send Contact.
public sendContact ( integer $chat_id, $phone_number, string $first_name, string $last_name = null, integer $reply_to_message_id = null, KeyboardMarkup $reply_markup = null ) : Array
$chat_id integer
$first_name string
$last_name string
$reply_to_message_id integer
$reply_markup KeyboardMarkup
리턴 Array

sendDocument() 공개 메소드

Send Document.
public sendDocument ( integer $chat_id, string $document, integer $reply_to_message_id = null, KeyboardMarkup $reply_markup = null ) : Array
$chat_id integer
$document string
$reply_to_message_id integer
$reply_markup KeyboardMarkup
리턴 Array

sendLocation() 공개 메소드

Send Location.
public sendLocation ( integer $chat_id, float $latitude, float $longitude, integer $reply_to_message_id = null, KeyboardMarkup $reply_markup = null ) : Array
$chat_id integer
$latitude float
$longitude float
$reply_to_message_id integer
$reply_markup KeyboardMarkup
리턴 Array

sendMessage() 공개 메소드

Send text messages.
public sendMessage ( integer $chat_id, string $text, string $parse_mode = null, boolean $disable_web_page_preview = false, integer $reply_to_message_id = null, KeyboardMarkup $reply_markup = null ) : Array
$chat_id integer
$text string
$parse_mode string
$disable_web_page_preview boolean
$reply_to_message_id integer
$reply_markup KeyboardMarkup
리턴 Array

sendPhoto() 공개 메소드

Send Photos.
public sendPhoto ( integer $chat_id, string $photo, string $caption = null, integer $reply_to_message_id = null, KeyboardMarkup $reply_markup = null ) : Array
$chat_id integer
$photo string
$caption string
$reply_to_message_id integer
$reply_markup KeyboardMarkup
리턴 Array

sendSticker() 공개 메소드

Send Sticker.
public sendSticker ( integer $chat_id, string $sticker, integer $reply_to_message_id = null, KeyboardMarkup $reply_markup = null ) : Array
$chat_id integer
$sticker string
$reply_to_message_id integer
$reply_markup KeyboardMarkup
리턴 Array

sendVenue() 공개 메소드

Send Venue.
public sendVenue ( integer $chat_id, float $latitude, float $longitude, string $title, string $address, string $foursquare_id = null, integer $reply_to_message_id = null, KeyboardMarkup $reply_markup = null ) : Array
$chat_id integer
$latitude float
$longitude float
$title string
$address string
$foursquare_id string
$reply_to_message_id integer
$reply_markup KeyboardMarkup
리턴 Array

sendVideo() 공개 메소드

Send Video.
public sendVideo ( integer $chat_id, string $video, integer $duration = null, string $caption = null, integer $reply_to_message_id = null, KeyboardMarkup $reply_markup = null ) : Array
$chat_id integer
$video string
$duration integer
$caption string
$reply_to_message_id integer
$reply_markup KeyboardMarkup
리턴 Array

sendVoice() 공개 메소드

Send Voice.
public sendVoice ( integer $chat_id, string $audio, integer $duration = null, integer $reply_to_message_id = null, KeyboardMarkup $reply_markup = null ) : Array
$chat_id integer
$audio string
$duration integer
$reply_to_message_id integer
$reply_markup KeyboardMarkup
리턴 Array

setWebhook() 공개 메소드

Set a Webhook to receive incoming updates via an outgoing webhook.
public setWebhook ( string $url, $certificate = null ) : Array
$url string HTTPS url to send updates to. Use an empty string to remove webhook integration
리턴 Array

프로퍼티 상세

$token 보호되어 있는 프로퍼티

protected $token