TelegramBotPHP
A very simple PHP Telegram Bot API for sending messages
Public Member Functions | Data Fields
Telegram Class Reference

Public Member Functions

 __construct ($bot_token, $log_errors=true, array $proxy=[])
 Class constructor. More...
 
 endpoint ($api, array $content, $post=true)
 Do requests to Telegram Bot API. More...
 
 getMe ()
 A method for testing your bot. More...
 
 logOut ()
 
 close ()
 
 respondSuccess ()
 A method for responding http to Telegram. More...
 
 sendMessage (array $content)
 Send a message. More...
 
 copyMessage (array $content)
 Copy a message. More...
 
 forwardMessage (array $content)
 Forward a message. More...
 
 sendPhoto (array $content)
 Send a photo. More...
 
 sendAudio (array $content)
 Send an audio. More...
 
 sendDocument (array $content)
 Send a document. More...
 
 sendAnimation (array $content)
 Send an animation. More...
 
 sendSticker (array $content)
 Send a sticker. More...
 
 sendVideo (array $content)
 Send a video. More...
 
 sendVoice (array $content)
 Send a voice message. More...
 
 sendLocation (array $content)
 Send a location. More...
 
 editMessageLiveLocation (array $content)
 Edit Message Live Location. More...
 
 stopMessageLiveLocation (array $content)
 Stop Message Live Location. More...
 
 setChatStickerSet (array $content)
 Set Chat Sticker Set. More...
 
 deleteChatStickerSet (array $content)
 Delete Chat Sticker Set. More...
 
 sendMediaGroup (array $content)
 Send Media Group. More...
 
 sendVenue (array $content)
 Send Venue. More...
 
 sendContact (array $content)
 
 sendPoll (array $content)
 
 sendDice (array $content)
 
 sendChatAction (array $content)
 Send a chat action. More...
 
 getUserProfilePhotos (array $content)
 Get a list of profile pictures for a user. More...
 
 getFile ($file_id)
 Use this method to get basic info about a file and prepare it for downloading. More...
 
 kickChatMember (array $content)
 Kick Chat Member. More...
 
 leaveChat (array $content)
 Leave Chat. More...
 
 banChatMember (array $content)
 Ban Chat Member. More...
 
 unbanChatMember (array $content)
 Unban Chat Member. More...
 
 getChat (array $content)
 Get Chat Information. More...
 
 getChatAdministrators (array $content)
 Get chat Administrators. More...
 
 getChatMemberCount (array $content)
 Get chat member count. More...
 
 getChatMembersCount (array $content)
 
 getChatMember (array $content)
 
 answerInlineQuery (array $content)
 
 setGameScore (array $content)
 Set Game Score. More...
 
 getGameHighScores (array $content)
 Get Game Hi Scores. More...
 
 answerCallbackQuery (array $content)
 Answer a callback Query. More...
 
 setMyCommands (array $content)
 Set the list of the bot commands. More...
 
 deleteMyCommands (array $content)
 Delete the list of the bot commands. More...
 
 getMyCommands (array $content)
 Get the list of the bot commands. More...
 
 setChatMenuButton (array $content)
 Set the chat menu button. More...
 
 getChatMenuButton (array $content)
 Get the chat menu button. More...
 
 setMyDefaultAdministratorRights (array $content)
 Set the default aministrator rights. More...
 
 getMyDefaultAdministratorRights (array $content)
 Get the default aministrator rights. More...
 
 editMessageText (array $content)
 
 editMessageCaption (array $content)
 
 editMessageMedia (array $content)
 
 editMessageReplyMarkup (array $content)
 
 stopPoll (array $content)
 
 downloadFile ($telegram_file_path, $local_file_path)
 Use this method to download a file. More...
 
 setWebhook ($url, $certificate='')
 Set a WebHook for the bot. More...
 
 deleteWebhook ()
 Delete the WebHook for the bot. More...
 
 getData ()
 Get the data of the current message. More...
 
 setData (array $data)
 Set the data currently used.
 
 Text ()
 Get the text of the current message. More...
 
 Caption ()
 
 ChatID ()
 Get the chat_id of the current message. More...
 
 Chat ()
 
 MessageID ()
 Get the message_id of the current message. More...
 
 ReplyToMessageID ()
 Get the reply_to_message message_id of the current message. More...
 
 ReplyToMessageFromUserID ()
 Get the reply_to_message forward_from user_id of the current message. More...
 
 Inline_Query ()
 Get the inline_query of the current update. More...
 
 Callback_Query ()
 Get the callback_query of the current update. More...
 
 Callback_ID ()
 Get the callback_query id of the current update. More...
 
 Callback_Data ()
 Get the Get the data of the current callback. More...
 
 Callback_Message ()
 Get the Get the message of the current callback. More...
 
 Callback_ChatID ()
 Get the Get the chat_id of the current callback. More...
 
 Callback_FromID ()
 Get the Get the from_id of the current callback. More...
 
 Date ()
 Get the date of the current message. More...
 
 FirstName ()
 Get the first name of the user.
 
 LastName ()
 Get the last name of the user.
 
 Username ()
 Get the username of the user.
 
 Location ()
 Get the location in the message.
 
 UpdateID ()
 Get the update_id of the message.
 
 UpdateCount ()
 Get the number of updates.
 
 UserID ()
 Get user's id of current message.
 
 FromID ()
 Get user's id of current forwarded message.
 
 FromChatID ()
 Get chat's id where current message forwarded from.
 
 messageFromGroup ()
 Tell if a message is from a group or user chat. More...
 
 getContactPhoneNumber ()
 Get the contact phone number. More...
 
 messageFromGroupTitle ()
 Get the title of the group chat. More...
 
 buildKeyBoard (array $options, $onetime=false, $resize=false, $selective=true)
 Set a custom keyboard. More...
 
 buildInlineKeyBoard (array $options)
 Set an InlineKeyBoard. More...
 
 buildInlineKeyboardButton ( $text, $url='', $callback_data='', $switch_inline_query=null, $switch_inline_query_current_chat=null, $callback_game='', $pay='')
 Create an InlineKeyboardButton. More...
 
 buildKeyboardButton ($text, $request_contact=false, $request_location=false)
 Create a KeyboardButton. More...
 
 buildKeyBoardHide ($selective=true)
 Hide a custom keyboard. More...
 
 buildForceReply ($selective=true)
 Display a reply interface to the user.
 
 sendInvoice (array $content)
 Send an invoice. More...
 
 answerShippingQuery (array $content)
 Answer a shipping query. More...
 
 answerPreCheckoutQuery (array $content)
 Answer a PreCheckout query. More...
 
 setPassportDataErrors (array $content)
 Set Passport data errors. More...
 
 sendGame (array $content)
 Send a Game. More...
 
 sendVideoNote (array $content)
 Send a video note. More...
 
 restrictChatMember (array $content)
 Restrict Chat Member. More...
 
 promoteChatMember (array $content)
 Promote Chat Member. More...
 
 setChatAdministratorCustomTitle (array $content)
 Set chat Administrator custom title. More...
 
 banChatSenderChat (array $content)
 Ban a channel chat in a super group or channel. More...
 
 unbanChatSenderChat (array $content)
 Unban a channel chat in a super group or channel. More...
 
 setChatPermissions (array $content)
 Set default chat permission for all members. More...
 
 exportChatInviteLink (array $content)
 
 createChatInviteLink (array $content)
 
 editChatInviteLink (array $content)
 
 revokeChatInviteLink (array $content)
 
 approveChatJoinRequest (array $content)
 
 declineChatJoinRequest (array $content)
 
 setChatPhoto (array $content)
 Set Chat Photo. More...
 
 deleteChatPhoto (array $content)
 Delete Chat Photo. More...
 
 setChatTitle (array $content)
 Set Chat Title. More...
 
 setChatDescription (array $content)
 Set Chat Description. More...
 
 pinChatMessage (array $content)
 Pin Chat Message. More...
 
 unpinChatMessage (array $content)
 Unpin Chat Message. More...
 
 unpinAllChatMessages (array $content)
 Unpin All Chat Messages. More...
 
 getStickerSet (array $content)
 Get Sticker Set. More...
 
 uploadStickerFile (array $content)
 Upload Sticker File. More...
 
 createNewStickerSet (array $content)
 Create New Sticker Set. More...
 
 addStickerToSet (array $content)
 Add Sticker To Set. More...
 
 setStickerPositionInSet (array $content)
 Set Sticker Position In Set. More...
 
 deleteStickerFromSet (array $content)
 Delete Sticker From Set. More...
 
 setStickerSetThumb (array $content)
 Set Sticker Thumb From Set. More...
 
 deleteMessage (array $content)
 Delete a message. More...
 
 getUpdates ($offset=0, $limit=100, $timeout=0, $update=true)
 Receive incoming messages using polling. More...
 
 serveUpdate ($update)
 Serve an update. More...
 
 getUpdateType ()
 Return current update type. More...
 

Data Fields

const INLINE_QUERY = 'inline_query'
 
const CALLBACK_QUERY = 'callback_query'
 
const EDITED_MESSAGE = 'edited_message'
 
const REPLY = 'reply'
 
const MESSAGE = 'message'
 
const PHOTO = 'photo'
 
const VIDEO = 'video'
 
const AUDIO = 'audio'
 
const VOICE = 'voice'
 
const ANIMATION = 'animation'
 
const STICKER = 'sticker'
 
const DOCUMENT = 'document'
 
const LOCATION = 'location'
 
const CONTACT = 'contact'
 
const CHANNEL_POST = 'channel_post'
 
const NEW_CHAT_MEMBER = 'new_chat_member'
 
const LEFT_CHAT_MEMBER = 'left_chat_member'
 
const MY_CHAT_MEMBER = 'my_chat_member'
 

Detailed Description

Telegram Bot Class.

Author
Gabriele Grillo gabry.nosp@m..gri.nosp@m.llo@a.nosp@m.lice.nosp@m..it

Constructor & Destructor Documentation

◆ __construct()

__construct (   $bot_token,
  $log_errors = true,
array  $proxy = [] 
)

Class constructor.

Create a Telegram instance from the bot token

Parameters
$bot_tokenthe bot token
$log_errorsenable or disable the logging
$proxyarray with the proxy configuration (url, port, type, auth)
Returns
an instance of the class.

Member Function Documentation

◆ addStickerToSet()

addStickerToSet ( array  $content)

Add Sticker To Set.

See addStickerToSet for the input values

Parameters
$contentthe request parameters as array
Returns
the JSON Telegram's reply.

◆ answerCallbackQuery()

answerCallbackQuery ( array  $content)

Answer a callback Query.

See answerCallbackQuery for the input values

Parameters
$contentthe request parameters as array
Returns
the JSON Telegram's reply.

◆ answerInlineQuery()

answerInlineQuery ( array  $content)

See answerInlineQuery for the input values

Parameters
$contentthe request parameters as array
Returns
the JSON Telegram's reply.

◆ answerPreCheckoutQuery()

answerPreCheckoutQuery ( array  $content)

Answer a PreCheckout query.

See answerPreCheckoutQuery for the input values

Parameters
$contentthe request parameters as array
Returns
the JSON Telegram's reply.

◆ answerShippingQuery()

answerShippingQuery ( array  $content)

Answer a shipping query.

See answerShippingQuery for the input values

Parameters
$contentthe request parameters as array
Returns
the JSON Telegram's reply.

◆ approveChatJoinRequest()

approveChatJoinRequest ( array  $content)

See approveChatJoinRequest for the input values

Parameters
$contentthe request parameters as array
Returns
the JSON Telegram's reply.

◆ banChatMember()

banChatMember ( array  $content)

Ban Chat Member.

See banChatMember for the input values

Parameters
$contentthe request parameters as array
Returns
the JSON Telegram's reply.

◆ banChatSenderChat()

banChatSenderChat ( array  $content)

Ban a channel chat in a super group or channel.

See banChatSenderChat for the input values

Parameters
$contentthe request parameters as array
Returns
the JSON Telegram's reply.

◆ buildInlineKeyBoard()

buildInlineKeyBoard ( array  $options)

Set an InlineKeyBoard.

This object represents an inline keyboard that appears right next to the message it belongs to.

Parameters
$optionsArray of Array of InlineKeyboardButton; Array of button rows, each represented by an Array of InlineKeyboardButton
Returns
the requested keyboard as Json.

◆ buildInlineKeyboardButton()

buildInlineKeyboardButton (   $text,
  $url = '',
  $callback_data = '',
  $switch_inline_query = null,
  $switch_inline_query_current_chat = null,
  $callback_game = '',
  $pay = '' 
)

Create an InlineKeyboardButton.

This object represents one button of an inline keyboard. You must use exactly one of the optional fields.

Parameters
$textString; Array of button rows, each represented by an Array of Strings
$urlString Optional. HTTP url to be opened when button is pressed
$callback_dataString Optional. Data to be sent in a callback query to the bot when button is pressed
$switch_inline_queryString Optional. If set, pressing the button will prompt the user to select one of their chats, open that chat and insert the bot‘s username and the specified inline query in the input field. Can be empty, in which case just the bot’s username will be inserted.
$switch_inline_query_current_chatString Optional. Optional. If set, pressing the button will insert the bot‘s username and the specified inline query in the current chat's input field. Can be empty, in which case only the bot’s username will be inserted.
$callback_gameString Optional. Description of the game that will be launched when the user presses the button.
$payBoolean Optional. Specify True, to send a Pay button.
Returns
the requested button as Array.

◆ buildKeyBoard()

buildKeyBoard ( array  $options,
  $onetime = false,
  $resize = false,
  $selective = true 
)

Set a custom keyboard.

This object represents a custom keyboard with reply options

Parameters
$optionsArray of Array of String; Array of button rows, each represented by an Array of Strings
$onetimeBoolean Requests clients to hide the keyboard as soon as it's been used. Defaults to false.
$resizeBoolean Requests clients to resize the keyboard vertically for optimal fit (e.g., make the keyboard smaller if there are just two rows of buttons). Defaults to false, in which case the custom keyboard is always of the same height as the app's standard keyboard.
$selectiveBoolean Use this parameter if you want to show the keyboard to specific users only. Targets: 1) users that are @mentioned in the text of the Message object; 2) if the bot's message is a reply (has reply_to_message_id), sender of the original message.
Returns
the requested keyboard as Json.

◆ buildKeyboardButton()

buildKeyboardButton (   $text,
  $request_contact = false,
  $request_location = false 
)

Create a KeyboardButton.

This object represents one button of an inline keyboard. You must use exactly one of the optional fields.

Parameters
$textString; Array of button rows, each represented by an Array of Strings
$request_contactBoolean Optional. If True, the user's phone number will be sent as a contact when the button is pressed. Available in private chats only
$request_locationBoolean Optional. If True, the user's current location will be sent when the button is pressed. Available in private chats only
Returns
the requested button as Array.

◆ buildKeyBoardHide()

buildKeyBoardHide (   $selective = true)

Hide a custom keyboard.

Upon receiving a message with this object, Telegram clients will hide the current custom keyboard and display the default letter-keyboard. By default, custom keyboards are displayed until a new keyboard is sent by a bot. An exception is made for one-time keyboards that are hidden immediately after the user presses a button.

Parameters
$selectiveBoolean Use this parameter if you want to show the keyboard to specific users only. Targets: 1) users that are @mentioned in the text of the Message object; 2) if the bot's message is a reply (has reply_to_message_id), sender of the original message.
Returns
the requested keyboard hide as Array.

◆ Callback_ChatID()

Callback_ChatID ( )

Get the Get the chat_id of the current callback.

Deprecated:
Use ChatId() instead
Returns
the String callback_query.

◆ Callback_Data()

Callback_Data ( )

Get the Get the data of the current callback.

Deprecated:
Use Text() instead
Returns
the String callback_data.

◆ Callback_FromID()

Callback_FromID ( )

Get the Get the from_id of the current callback.

Returns
the String callback_query from_id.

◆ Callback_ID()

Callback_ID ( )

Get the callback_query id of the current update.

Returns
the String callback_query id.

◆ Callback_Message()

Callback_Message ( )

Get the Get the message of the current callback.

Returns
the Message.

◆ Callback_Query()

Callback_Query ( )

Get the callback_query of the current update.

Returns
the String callback_query.

◆ Chat()

Chat ( )
Returns
the Array chat.

◆ ChatID()

ChatID ( )

Get the chat_id of the current message.

Returns
the String users's chat_id.

◆ close()

close ( )

See close

Returns
the JSON Telegram's reply.

◆ copyMessage()

copyMessage ( array  $content)

Copy a message.

See copyMessage for the input values

Parameters
$contentthe request parameters as array
Returns
the JSON Telegram's reply.

◆ createChatInviteLink()

createChatInviteLink ( array  $content)

See createChatInviteLink for the input values

Parameters
$contentthe request parameters as array
Returns
the JSON Telegram's reply.

◆ createNewStickerSet()

createNewStickerSet ( array  $content)

Create New Sticker Set.

See createNewStickerSet for the input values

Parameters
$contentthe request parameters as array
Returns
the JSON Telegram's reply.

◆ Date()

Date ( )

Get the date of the current message.

Returns
the String message's date.

◆ declineChatJoinRequest()

declineChatJoinRequest ( array  $content)

See declineChatJoinRequest for the input values

Parameters
$contentthe request parameters as array
Returns
the JSON Telegram's reply.

◆ deleteChatPhoto()

deleteChatPhoto ( array  $content)

Delete Chat Photo.

See deleteChatPhoto for the input values

Parameters
$contentthe request parameters as array
Returns
the JSON Telegram's reply.

◆ deleteChatStickerSet()

deleteChatStickerSet ( array  $content)

Delete Chat Sticker Set.

See deleteChatStickerSet for the input values

Parameters
$contentthe request parameters as array
Returns
the JSON Telegram's reply.

◆ deleteMessage()

deleteMessage ( array  $content)

Delete a message.

See deleteMessage for the input values

Parameters
$contentthe request parameters as array
Returns
the JSON Telegram's reply.

◆ deleteMyCommands()

deleteMyCommands ( array  $content)

Delete the list of the bot commands.

See deleteMyCommands for the input values

Parameters
$contentthe request parameters as array
Returns
the JSON Telegram's reply.

◆ deleteStickerFromSet()

deleteStickerFromSet ( array  $content)

Delete Sticker From Set.

See deleteStickerFromSet for the input values

Parameters
$contentthe request parameters as array
Returns
the JSON Telegram's reply.

◆ deleteWebhook()

deleteWebhook ( )

Delete the WebHook for the bot.

Use this method to remove webhook integration if you decide to switch back to getUpdates. Returns True on success. Requires no parameters.

Returns
the JSON Telegram's reply.

◆ downloadFile()

downloadFile (   $telegram_file_path,
  $local_file_path 
)

Use this method to download a file.

Use this method to to download a file from the Telegram servers.

Parameters
$telegram_file_pathString File path on Telegram servers
$local_file_pathString File path where save the file.

◆ editChatInviteLink()

editChatInviteLink ( array  $content)

See editChatInviteLink for the input values

Parameters
$contentthe request parameters as array
Returns
the JSON Telegram's reply.

◆ editMessageCaption()

editMessageCaption ( array  $content)

See editMessageCaption for the input values

Parameters
$contentthe request parameters as array
Returns
the JSON Telegram's reply.

◆ editMessageLiveLocation()

editMessageLiveLocation ( array  $content)

Edit Message Live Location.

See editMessageLiveLocation for the input values

Parameters
$contentthe request parameters as array
Returns
the JSON Telegram's reply.

◆ editMessageMedia()

editMessageMedia ( array  $content)

See editMessageMedia for the input values

Parameters
$contentthe request parameters as array
Returns
the JSON Telegram's reply.

◆ editMessageReplyMarkup()

editMessageReplyMarkup ( array  $content)

See editMessageReplyMarkup for the input values

Parameters
$contentthe request parameters as array
Returns
the JSON Telegram's reply.

◆ editMessageText()

editMessageText ( array  $content)

See editMessageText for the input values

Parameters
$contentthe request parameters as array
Returns
the JSON Telegram's reply.

◆ endpoint()

endpoint (   $api,
array  $content,
  $post = true 
)

Do requests to Telegram Bot API.

Contacts the various API's endpoints

Parameters
$apithe API endpoint
$contentthe request parameters as array
$postboolean tells if $content needs to be sends
Returns
the JSON Telegram's reply.

◆ exportChatInviteLink()

exportChatInviteLink ( array  $content)

See exportChatInviteLink for the input values

Parameters
$contentthe request parameters as array
Returns
the JSON Telegram's reply.

◆ forwardMessage()

forwardMessage ( array  $content)

Forward a message.

See forwardMessage for the input values

Parameters
$contentthe request parameters as array
Returns
the JSON Telegram's reply.

◆ getChat()

getChat ( array  $content)

Get Chat Information.

See getChat for the input values

Parameters
$contentthe request parameters as array
Returns
the JSON Telegram's reply.

◆ getChatAdministrators()

getChatAdministrators ( array  $content)

Get chat Administrators.

See getChatAdministrators for the input values

Parameters
$contentthe request parameters as array
Returns
the JSON Telegram's reply.

◆ getChatMember()

getChatMember ( array  $content)

See getChatMember for the input values

Parameters
$contentthe request parameters as array
Returns
the JSON Telegram's reply.

◆ getChatMemberCount()

getChatMemberCount ( array  $content)

Get chat member count.

See getChatMemberCount for the input values

Parameters
$contentthe request parameters as array
Returns
the JSON Telegram's reply.

◆ getChatMembersCount()

getChatMembersCount ( array  $content)

For retrocompatibility

Parameters
$contentthe request parameters as array
Returns
the JSON Telegram's reply.

◆ getChatMenuButton()

getChatMenuButton ( array  $content)

Get the chat menu button.

See getChatMenuButton for the input values

Parameters
$contentthe request parameters as array
Returns
the JSON Telegram's reply.

◆ getContactPhoneNumber()

getContactPhoneNumber ( )

Get the contact phone number.

Returns
a String of the contact phone number.

◆ getData()

getData ( )

Get the data of the current message.

Get the POST request of a user in a Webhook or the message actually processed in a getUpdates() enviroment.

Returns
the JSON users's message.

◆ getFile()

getFile (   $file_id)

Use this method to get basic info about a file and prepare it for downloading.

Use this method to get basic info about a file and prepare it for downloading. 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<token>/<file_path>, where <file_path> 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.

Parameters
$file_idString File identifier to get info about
Returns
the JSON Telegram's reply.

◆ getGameHighScores()

getGameHighScores ( array  $content)

Get Game Hi Scores.

See getGameHighScores for the input values

Parameters
$contentthe request parameters as array
Returns
the JSON Telegram's reply.

◆ getMe()

getMe ( )

A method for testing your bot.

See getMe

Returns
the JSON Telegram's reply.

◆ getMyCommands()

getMyCommands ( array  $content)

Get the list of the bot commands.

See getMyCommands for the input values

Parameters
$contentthe request parameters as array
Returns
the JSON Telegram's reply.

◆ getMyDefaultAdministratorRights()

getMyDefaultAdministratorRights ( array  $content)

Get the default aministrator rights.

See getMyDefaultAdministratorRights for the input values

Parameters
$contentthe request parameters as array
Returns
the JSON Telegram's reply.

◆ getStickerSet()

getStickerSet ( array  $content)

Get Sticker Set.

See getStickerSet for the input values

Parameters
$contentthe request parameters as array
Returns
the JSON Telegram's reply.

◆ getUpdates()

getUpdates (   $offset = 0,
  $limit = 100,
  $timeout = 0,
  $update = true 
)

Receive incoming messages using polling.

Use this method to receive incoming updates using long polling.

Parameters
$offsetInteger Identifier of the first update to be returned. Must be greater by one than the highest among the identifiers of previously received updates. By default, updates starting with the earliest unconfirmed update are returned. An update is considered confirmed as soon as getUpdates is called with an offset higher than its update_id.
$limitInteger Limits the number of updates to be retrieved. Values between 1—100 are accepted. Defaults to 100
$timeoutInteger Timeout in seconds for long polling. Defaults to 0, i.e. usual short polling
$updateBoolean If true updates the pending message list to the last update received. Default to true.
Returns
the updates as Array.

◆ getUpdateType()

getUpdateType ( )

Return current update type.

Return current update type False on failure.

Returns
bool|string

◆ getUserProfilePhotos()

getUserProfilePhotos ( array  $content)

Get a list of profile pictures for a user.

See getUserProfilePhotos for the input values

Parameters
$contentthe request parameters as array
Returns
the JSON Telegram's reply.

◆ Inline_Query()

Inline_Query ( )

Get the inline_query of the current update.

Returns
the Array inline_query.

◆ kickChatMember()

kickChatMember ( array  $content)

Kick Chat Member.

Deprecated

Parameters
$contentthe request parameters as array
Returns
the JSON Telegram's reply.

◆ leaveChat()

leaveChat ( array  $content)

Leave Chat.

See leaveChat for the input values

Parameters
$contentthe request parameters as array
Returns
the JSON Telegram's reply.

◆ logOut()

logOut ( )

See logOut

Returns
the JSON Telegram's reply.

◆ messageFromGroup()

messageFromGroup ( )

Tell if a message is from a group or user chat.

Returns
BOOLEAN true if the message is from a Group chat, false otherwise.

◆ messageFromGroupTitle()

messageFromGroupTitle ( )

Get the title of the group chat.

Returns
a String of the title chat.

◆ MessageID()

MessageID ( )

Get the message_id of the current message.

Returns
the String message_id.

◆ pinChatMessage()

pinChatMessage ( array  $content)

Pin Chat Message.

See pinChatMessage for the input values

Parameters
$contentthe request parameters as array
Returns
the JSON Telegram's reply.

◆ promoteChatMember()

promoteChatMember ( array  $content)

Promote Chat Member.

See promoteChatMember for the input values

Parameters
$contentthe request parameters as array
Returns
the JSON Telegram's reply.

◆ ReplyToMessageFromUserID()

ReplyToMessageFromUserID ( )

Get the reply_to_message forward_from user_id of the current message.

Returns
the String reply_to_message forward_from user_id.

◆ ReplyToMessageID()

ReplyToMessageID ( )

Get the reply_to_message message_id of the current message.

Returns
the String reply_to_message message_id.

◆ respondSuccess()

respondSuccess ( )

A method for responding http to Telegram.

Returns
the HTTP 200 to Telegram.

◆ restrictChatMember()

restrictChatMember ( array  $content)

Restrict Chat Member.

See restrictChatMember for the input values

Parameters
$contentthe request parameters as array
Returns
the JSON Telegram's reply.

◆ revokeChatInviteLink()

revokeChatInviteLink ( array  $content)

See revokeChatInviteLink for the input values

Parameters
$contentthe request parameters as array
Returns
the JSON Telegram's reply.

◆ sendAnimation()

sendAnimation ( array  $content)

Send an animation.

See sendAnimation for the input values

Parameters
$contentthe request parameters as array
Returns
the JSON Telegram's reply.

◆ sendAudio()

sendAudio ( array  $content)

Send an audio.

See sendAudio for the input values

Parameters
$contentthe request parameters as array
Returns
the JSON Telegram's reply.

◆ sendChatAction()

sendChatAction ( array  $content)

Send a chat action.

See sendChatAction for the input values

Parameters
$contentthe request parameters as array
Returns
the JSON Telegram's reply.

◆ sendContact()

sendContact ( array  $content)

See sendContact for the input values

Parameters
$contentthe request parameters as array
Returns
the JSON Telegram's reply.

◆ sendDice()

sendDice ( array  $content)

See sendDice for the input values

Parameters
$contentthe request parameters as array
Returns
the JSON Telegram's reply.

◆ sendDocument()

sendDocument ( array  $content)

Send a document.

See sendDocument for the input values

Parameters
$contentthe request parameters as array
Returns
the JSON Telegram's reply.

◆ sendGame()

sendGame ( array  $content)

Send a Game.

See sendGame for the input values

Parameters
$contentthe request parameters as array
Returns
the JSON Telegram's reply.

◆ sendInvoice()

sendInvoice ( array  $content)

Send an invoice.

See sendInvoice for the input values

Parameters
$contentthe request parameters as array
Returns
the JSON Telegram's reply.

◆ sendLocation()

sendLocation ( array  $content)

Send a location.

See sendLocation for the input values

Parameters
$contentthe request parameters as array
Returns
the JSON Telegram's reply.

◆ sendMediaGroup()

sendMediaGroup ( array  $content)

Send Media Group.

See sendMediaGroup for the input values

Parameters
$contentthe request parameters as array
Returns
the JSON Telegram's reply.

◆ sendMessage()

sendMessage ( array  $content)

Send a message.

See sendMessage for the input values

Parameters
$contentthe request parameters as array
Returns
the JSON Telegram's reply.

◆ sendPhoto()

sendPhoto ( array  $content)

Send a photo.

See sendPhoto for the input values

Parameters
$contentthe request parameters as array
Returns
the JSON Telegram's reply.

◆ sendPoll()

sendPoll ( array  $content)

See sendPoll for the input values

Parameters
$contentthe request parameters as array
Returns
the JSON Telegram's reply.

◆ sendSticker()

sendSticker ( array  $content)

Send a sticker.

See sendSticker for the input values

Parameters
$contentthe request parameters as array
Returns
the JSON Telegram's reply.

◆ sendVenue()

sendVenue ( array  $content)

Send Venue.

See sendVenue for the input values

Parameters
$contentthe request parameters as array
Returns
the JSON Telegram's reply.

◆ sendVideo()

sendVideo ( array  $content)

Send a video.

See sendVideo for the input values

Parameters
$contentthe request parameters as array
Returns
the JSON Telegram's reply.

◆ sendVideoNote()

sendVideoNote ( array  $content)

Send a video note.

See sendVideoNote for the input values

Parameters
$contentthe request parameters as array
Returns
the JSON Telegram's reply.

◆ sendVoice()

sendVoice ( array  $content)

Send a voice message.

See sendVoice for the input values

Parameters
$contentthe request parameters as array
Returns
the JSON Telegram's reply.

◆ serveUpdate()

serveUpdate (   $update)

Serve an update.

Use this method to use the bultin function like Text() or Username() on a specific update.

Parameters
$updateInteger The index of the update in the updates array.

◆ setChatAdministratorCustomTitle()

setChatAdministratorCustomTitle ( array  $content)

Set chat Administrator custom title.

See setChatAdministratorCustomTitle for the input values

Parameters
$contentthe request parameters as array
Returns
the JSON Telegram's reply.

◆ setChatDescription()

setChatDescription ( array  $content)

Set Chat Description.

See setChatDescription for the input values

Parameters
$contentthe request parameters as array
Returns
the JSON Telegram's reply.

◆ setChatMenuButton()

setChatMenuButton ( array  $content)

Set the chat menu button.

See setChatMenuButton for the input values

Parameters
$contentthe request parameters as array
Returns
the JSON Telegram's reply.

◆ setChatPermissions()

setChatPermissions ( array  $content)

Set default chat permission for all members.

See setChatPermissions for the input values

Parameters
$contentthe request parameters as array
Returns
the JSON Telegram's reply.

◆ setChatPhoto()

setChatPhoto ( array  $content)

Set Chat Photo.

See setChatPhoto for the input values

Parameters
$contentthe request parameters as array
Returns
the JSON Telegram's reply.

◆ setChatStickerSet()

setChatStickerSet ( array  $content)

Set Chat Sticker Set.

See setChatStickerSet for the input values

Parameters
$contentthe request parameters as array
Returns
the JSON Telegram's reply.

◆ setChatTitle()

setChatTitle ( array  $content)

Set Chat Title.

See setChatTitle for the input values

Parameters
$contentthe request parameters as array
Returns
the JSON Telegram's reply.

◆ setGameScore()

setGameScore ( array  $content)

Set Game Score.

See setGameScore for the input values

Parameters
$contentthe request parameters as array
Returns
the JSON Telegram's reply.

◆ setMyCommands()

setMyCommands ( array  $content)

Set the list of the bot commands.

See setMyCommands for the input values

Parameters
$contentthe request parameters as array
Returns
the JSON Telegram's reply.

◆ setMyDefaultAdministratorRights()

setMyDefaultAdministratorRights ( array  $content)

Set the default aministrator rights.

See setMyDefaultAdministratorRights for the input values

Parameters
$contentthe request parameters as array
Returns
the JSON Telegram's reply.

◆ setPassportDataErrors()

setPassportDataErrors ( array  $content)

Set Passport data errors.

See setPassportDataErrors for the input values

Parameters
$contentthe request parameters as array
Returns
the JSON Telegram's reply.

◆ setStickerPositionInSet()

setStickerPositionInSet ( array  $content)

Set Sticker Position In Set.

See setStickerPositionInSet for the input values

Parameters
$contentthe request parameters as array
Returns
the JSON Telegram's reply.

◆ setStickerSetThumb()

setStickerSetThumb ( array  $content)

Set Sticker Thumb From Set.

See setStickerSetThumb for the input values

Parameters
$contentthe request parameters as array
Returns
the JSON Telegram's reply.

◆ setWebhook()

setWebhook (   $url,
  $certificate = '' 
)

Set a WebHook for the bot.

Use this method to specify a url and receive incoming updates via an outgoing webhook. 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.

If you'd like to make sure that the Webhook request comes from Telegram, we recommend using a secret path in the URL, e.g. https://www.example.com/<token>. Since nobody else knows your bot‘s token, you can be pretty sure it’s us.

Parameters
$urlString HTTPS url to send updates to. Use an empty string to remove webhook integration
$certificateInputFile Upload your public key certificate so that the root certificate in use can be checked
Returns
the JSON Telegram's reply.

◆ stopMessageLiveLocation()

stopMessageLiveLocation ( array  $content)

Stop Message Live Location.

See stopMessageLiveLocation for the input values

Parameters
$contentthe request parameters as array
Returns
the JSON Telegram's reply.

◆ stopPoll()

stopPoll ( array  $content)

See stopPoll for the input values

Parameters
$contentthe request parameters as array
Returns
the JSON Telegram's reply.

◆ Text()

Text ( )

Get the text of the current message.

Returns
the String users's text.

◆ unbanChatMember()

unbanChatMember ( array  $content)

Unban Chat Member.

See unbanChatMember for the input values

Parameters
$contentthe request parameters as array
Returns
the JSON Telegram's reply.

◆ unbanChatSenderChat()

unbanChatSenderChat ( array  $content)

Unban a channel chat in a super group or channel.

See unbanChatSenderChat for the input values

Parameters
$contentthe request parameters as array
Returns
the JSON Telegram's reply.

◆ unpinAllChatMessages()

unpinAllChatMessages ( array  $content)

Unpin All Chat Messages.

See unpinAllChatMessages for the input values

Parameters
$contentthe request parameters as array
Returns
the JSON Telegram's reply.

◆ unpinChatMessage()

unpinChatMessage ( array  $content)

Unpin Chat Message.

See unpinChatMessage for the input values

Parameters
$contentthe request parameters as array
Returns
the JSON Telegram's reply.

◆ uploadStickerFile()

uploadStickerFile ( array  $content)

Upload Sticker File.

See uploadStickerFile for the input values

Parameters
$contentthe request parameters as array
Returns
the JSON Telegram's reply.

Field Documentation

◆ ANIMATION

const ANIMATION = 'animation'

Constant for type animation.

◆ AUDIO

const AUDIO = 'audio'

Constant for type Audio.

◆ CALLBACK_QUERY

const CALLBACK_QUERY = 'callback_query'

Constant for type Callback Query.

◆ CHANNEL_POST

const CHANNEL_POST = 'channel_post'

Constant for type Channel Post.

◆ CONTACT

const CONTACT = 'contact'

Constant for type Contact.

◆ DOCUMENT

const DOCUMENT = 'document'

Constant for type Document.

◆ EDITED_MESSAGE

const EDITED_MESSAGE = 'edited_message'

Constant for type Edited Message.

◆ INLINE_QUERY

const INLINE_QUERY = 'inline_query'

Constant for type Inline Query.

◆ LEFT_CHAT_MEMBER

const LEFT_CHAT_MEMBER = 'left_chat_member'

Constant for type Left Chat Member.

◆ LOCATION

const LOCATION = 'location'

Constant for type Location.

◆ MESSAGE

const MESSAGE = 'message'

Constant for type Message.

◆ MY_CHAT_MEMBER

const MY_CHAT_MEMBER = 'my_chat_member'

Constant for type My Chat Member.

◆ NEW_CHAT_MEMBER

const NEW_CHAT_MEMBER = 'new_chat_member'

Constant for type New Chat Member.

◆ PHOTO

const PHOTO = 'photo'

Constant for type Photo.

◆ REPLY

const REPLY = 'reply'

Constant for type Reply.

◆ STICKER

const STICKER = 'sticker'

Constant for type sticker.

◆ VIDEO

const VIDEO = 'video'

Constant for type Video.

◆ VOICE

const VOICE = 'voice'

Constant for type Voice.


The documentation for this class was generated from the following file: