TelegramBotPHP
A very simple PHP Telegram Bot API for sending messages
|
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' |
Telegram Bot Class.
__construct | ( | $bot_token, | |
$log_errors = true , |
|||
array | $proxy = [] |
||
) |
Class constructor.
Create a Telegram instance from the bot token
$bot_token | the bot token |
$log_errors | enable or disable the logging |
$proxy | array with the proxy configuration (url, port, type, auth) |
addStickerToSet | ( | array | $content | ) |
Add Sticker To Set.
See addStickerToSet for the input values
$content | the request parameters as array |
answerCallbackQuery | ( | array | $content | ) |
Answer a callback Query.
See answerCallbackQuery for the input values
$content | the request parameters as array |
answerInlineQuery | ( | array | $content | ) |
See answerInlineQuery for the input values
$content | the request parameters as array |
answerPreCheckoutQuery | ( | array | $content | ) |
Answer a PreCheckout query.
See answerPreCheckoutQuery for the input values
$content | the request parameters as array |
answerShippingQuery | ( | array | $content | ) |
Answer a shipping query.
See answerShippingQuery for the input values
$content | the request parameters as array |
approveChatJoinRequest | ( | array | $content | ) |
See approveChatJoinRequest for the input values
$content | the request parameters as array |
banChatMember | ( | array | $content | ) |
Ban Chat Member.
See banChatMember for the input values
$content | the request parameters as array |
banChatSenderChat | ( | array | $content | ) |
Ban a channel chat in a super group or channel.
See banChatSenderChat for the input values
$content | the request parameters as array |
buildInlineKeyBoard | ( | array | $options | ) |
Set an InlineKeyBoard.
This object represents an inline keyboard that appears right next to the message it belongs to.
$options | Array of Array of InlineKeyboardButton; Array of button rows, each represented by an Array of InlineKeyboardButton |
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.
$text | String; Array of button rows, each represented by an Array of Strings |
$url | String Optional. HTTP url to be opened when button is pressed |
$callback_data | String Optional. Data to be sent in a callback query to the bot when button is pressed |
$switch_inline_query | String 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_chat | String 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_game | String Optional. Description of the game that will be launched when the user presses the button. |
$pay | Boolean Optional. Specify True, to send a Pay button. |
buildKeyBoard | ( | array | $options, |
$onetime = false , |
|||
$resize = false , |
|||
$selective = true |
|||
) |
Set a custom keyboard.
This object represents a custom keyboard with reply options
$options | Array of Array of String; Array of button rows, each represented by an Array of Strings |
$onetime | Boolean Requests clients to hide the keyboard as soon as it's been used. Defaults to false. |
$resize | Boolean 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. |
$selective | Boolean 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. |
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.
$text | String; Array of button rows, each represented by an Array of Strings |
$request_contact | Boolean 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_location | Boolean Optional. If True, the user's current location will be sent when the button is pressed. Available in private chats only |
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.
$selective | Boolean 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. |
Callback_ChatID | ( | ) |
Get the Get the chat_id of the current callback.
Callback_Data | ( | ) |
Get the Get the data of the current callback.
Callback_FromID | ( | ) |
Get the Get the from_id of the current callback.
Callback_ID | ( | ) |
Get the callback_query id of the current update.
Callback_Message | ( | ) |
Get the Get the message of the current callback.
Callback_Query | ( | ) |
Get the callback_query of the current update.
Chat | ( | ) |
ChatID | ( | ) |
Get the chat_id of the current message.
copyMessage | ( | array | $content | ) |
Copy a message.
See copyMessage for the input values
$content | the request parameters as array |
createChatInviteLink | ( | array | $content | ) |
See createChatInviteLink for the input values
$content | the request parameters as array |
createNewStickerSet | ( | array | $content | ) |
Create New Sticker Set.
See createNewStickerSet for the input values
$content | the request parameters as array |
Date | ( | ) |
Get the date of the current message.
declineChatJoinRequest | ( | array | $content | ) |
See declineChatJoinRequest for the input values
$content | the request parameters as array |
deleteChatPhoto | ( | array | $content | ) |
Delete Chat Photo.
See deleteChatPhoto for the input values
$content | the request parameters as array |
deleteChatStickerSet | ( | array | $content | ) |
Delete Chat Sticker Set.
See deleteChatStickerSet for the input values
$content | the request parameters as array |
deleteMessage | ( | array | $content | ) |
Delete a message.
See deleteMessage for the input values
$content | the request parameters as array |
deleteMyCommands | ( | array | $content | ) |
Delete the list of the bot commands.
See deleteMyCommands for the input values
$content | the request parameters as array |
deleteStickerFromSet | ( | array | $content | ) |
Delete Sticker From Set.
See deleteStickerFromSet for the input values
$content | the request parameters as array |
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.
downloadFile | ( | $telegram_file_path, | |
$local_file_path | |||
) |
editChatInviteLink | ( | array | $content | ) |
See editChatInviteLink for the input values
$content | the request parameters as array |
editMessageCaption | ( | array | $content | ) |
See editMessageCaption for the input values
$content | the request parameters as array |
editMessageLiveLocation | ( | array | $content | ) |
Edit Message Live Location.
See editMessageLiveLocation for the input values
$content | the request parameters as array |
editMessageMedia | ( | array | $content | ) |
See editMessageMedia for the input values
$content | the request parameters as array |
editMessageReplyMarkup | ( | array | $content | ) |
See editMessageReplyMarkup for the input values
$content | the request parameters as array |
editMessageText | ( | array | $content | ) |
See editMessageText for the input values
$content | the request parameters as array |
endpoint | ( | $api, | |
array | $content, | ||
$post = true |
|||
) |
exportChatInviteLink | ( | array | $content | ) |
See exportChatInviteLink for the input values
$content | the request parameters as array |
forwardMessage | ( | array | $content | ) |
Forward a message.
See forwardMessage for the input values
$content | the request parameters as array |
getChat | ( | array | $content | ) |
getChatAdministrators | ( | array | $content | ) |
Get chat Administrators.
See getChatAdministrators for the input values
$content | the request parameters as array |
getChatMember | ( | array | $content | ) |
See getChatMember for the input values
$content | the request parameters as array |
getChatMemberCount | ( | array | $content | ) |
Get chat member count.
See getChatMemberCount for the input values
$content | the request parameters as array |
getChatMembersCount | ( | array | $content | ) |
For retrocompatibility
$content | the request parameters as array |
getChatMenuButton | ( | array | $content | ) |
Get the chat menu button.
See getChatMenuButton for the input values
$content | the request parameters as array |
getContactPhoneNumber | ( | ) |
Get the contact phone number.
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.
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.
$file_id | String File identifier to get info about |
getGameHighScores | ( | array | $content | ) |
Get Game Hi Scores.
See getGameHighScores for the input values
$content | the request parameters as array |
getMyCommands | ( | array | $content | ) |
Get the list of the bot commands.
See getMyCommands for the input values
$content | the request parameters as array |
getMyDefaultAdministratorRights | ( | array | $content | ) |
Get the default aministrator rights.
See getMyDefaultAdministratorRights for the input values
$content | the request parameters as array |
getStickerSet | ( | array | $content | ) |
Get Sticker Set.
See getStickerSet for the input values
$content | the request parameters as array |
getUpdates | ( | $offset = 0 , |
|
$limit = 100 , |
|||
$timeout = 0 , |
|||
$update = true |
|||
) |
Receive incoming messages using polling.
Use this method to receive incoming updates using long polling.
$offset | Integer 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. |
$limit | Integer Limits the number of updates to be retrieved. Values between 1—100 are accepted. Defaults to 100 |
$timeout | Integer Timeout in seconds for long polling. Defaults to 0, i.e. usual short polling |
$update | Boolean If true updates the pending message list to the last update received. Default to true. |
getUpdateType | ( | ) |
Return current update type.
Return current update type False
on failure.
getUserProfilePhotos | ( | array | $content | ) |
Get a list of profile pictures for a user.
See getUserProfilePhotos for the input values
$content | the request parameters as array |
Inline_Query | ( | ) |
Get the inline_query of the current update.
kickChatMember | ( | array | $content | ) |
Kick Chat Member.
Deprecated
$content | the request parameters as array |
leaveChat | ( | array | $content | ) |
messageFromGroup | ( | ) |
Tell if a message is from a group or user chat.
messageFromGroupTitle | ( | ) |
Get the title of the group chat.
MessageID | ( | ) |
Get the message_id of the current message.
pinChatMessage | ( | array | $content | ) |
Pin Chat Message.
See pinChatMessage for the input values
$content | the request parameters as array |
promoteChatMember | ( | array | $content | ) |
Promote Chat Member.
See promoteChatMember for the input values
$content | the request parameters as array |
ReplyToMessageFromUserID | ( | ) |
Get the reply_to_message forward_from user_id of the current message.
ReplyToMessageID | ( | ) |
Get the reply_to_message message_id of the current message.
restrictChatMember | ( | array | $content | ) |
Restrict Chat Member.
See restrictChatMember for the input values
$content | the request parameters as array |
revokeChatInviteLink | ( | array | $content | ) |
See revokeChatInviteLink for the input values
$content | the request parameters as array |
sendAnimation | ( | array | $content | ) |
Send an animation.
See sendAnimation for the input values
$content | the request parameters as array |
sendAudio | ( | array | $content | ) |
sendChatAction | ( | array | $content | ) |
Send a chat action.
See sendChatAction for the input values
$content | the request parameters as array |
sendContact | ( | array | $content | ) |
See sendContact for the input values
$content | the request parameters as array |
sendDice | ( | array | $content | ) |
sendDocument | ( | array | $content | ) |
Send a document.
See sendDocument for the input values
$content | the request parameters as array |
sendGame | ( | array | $content | ) |
sendInvoice | ( | array | $content | ) |
Send an invoice.
See sendInvoice for the input values
$content | the request parameters as array |
sendLocation | ( | array | $content | ) |
Send a location.
See sendLocation for the input values
$content | the request parameters as array |
sendMediaGroup | ( | array | $content | ) |
Send Media Group.
See sendMediaGroup for the input values
$content | the request parameters as array |
sendMessage | ( | array | $content | ) |
Send a message.
See sendMessage for the input values
$content | the request parameters as array |
sendPhoto | ( | array | $content | ) |
sendPoll | ( | array | $content | ) |
sendSticker | ( | array | $content | ) |
Send a sticker.
See sendSticker for the input values
$content | the request parameters as array |
sendVenue | ( | array | $content | ) |
sendVideo | ( | array | $content | ) |
sendVideoNote | ( | array | $content | ) |
Send a video note.
See sendVideoNote for the input values
$content | the request parameters as array |
sendVoice | ( | array | $content | ) |
serveUpdate | ( | $update | ) |
Serve an update.
Use this method to use the bultin function like Text() or Username() on a specific update.
$update | Integer The index of the update in the updates array. |
setChatAdministratorCustomTitle | ( | array | $content | ) |
Set chat Administrator custom title.
See setChatAdministratorCustomTitle for the input values
$content | the request parameters as array |
setChatDescription | ( | array | $content | ) |
Set Chat Description.
See setChatDescription for the input values
$content | the request parameters as array |
setChatMenuButton | ( | array | $content | ) |
Set the chat menu button.
See setChatMenuButton for the input values
$content | the request parameters as array |
setChatPermissions | ( | array | $content | ) |
Set default chat permission for all members.
See setChatPermissions for the input values
$content | the request parameters as array |
setChatPhoto | ( | array | $content | ) |
Set Chat Photo.
See setChatPhoto for the input values
$content | the request parameters as array |
setChatStickerSet | ( | array | $content | ) |
Set Chat Sticker Set.
See setChatStickerSet for the input values
$content | the request parameters as array |
setChatTitle | ( | array | $content | ) |
Set Chat Title.
See setChatTitle for the input values
$content | the request parameters as array |
setGameScore | ( | array | $content | ) |
Set Game Score.
See setGameScore for the input values
$content | the request parameters as array |
setMyCommands | ( | array | $content | ) |
Set the list of the bot commands.
See setMyCommands for the input values
$content | the request parameters as array |
setMyDefaultAdministratorRights | ( | array | $content | ) |
Set the default aministrator rights.
See setMyDefaultAdministratorRights for the input values
$content | the request parameters as array |
setPassportDataErrors | ( | array | $content | ) |
Set Passport data errors.
See setPassportDataErrors for the input values
$content | the request parameters as array |
setStickerPositionInSet | ( | array | $content | ) |
Set Sticker Position In Set.
See setStickerPositionInSet for the input values
$content | the request parameters as array |
setStickerSetThumb | ( | array | $content | ) |
Set Sticker Thumb From Set.
See setStickerSetThumb for the input values
$content | the request parameters as array |
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.
$url | String HTTPS url to send updates to. Use an empty string to remove webhook integration |
$certificate | InputFile Upload your public key certificate so that the root certificate in use can be checked |
stopMessageLiveLocation | ( | array | $content | ) |
Stop Message Live Location.
See stopMessageLiveLocation for the input values
$content | the request parameters as array |
stopPoll | ( | array | $content | ) |
Text | ( | ) |
Get the text of the current message.
unbanChatMember | ( | array | $content | ) |
Unban Chat Member.
See unbanChatMember for the input values
$content | the request parameters as array |
unbanChatSenderChat | ( | array | $content | ) |
Unban a channel chat in a super group or channel.
See unbanChatSenderChat for the input values
$content | the request parameters as array |
unpinAllChatMessages | ( | array | $content | ) |
Unpin All Chat Messages.
See unpinAllChatMessages for the input values
$content | the request parameters as array |
unpinChatMessage | ( | array | $content | ) |
Unpin Chat Message.
See unpinChatMessage for the input values
$content | the request parameters as array |
uploadStickerFile | ( | array | $content | ) |
Upload Sticker File.
See uploadStickerFile for the input values
$content | the request parameters as array |
const ANIMATION = 'animation' |
Constant for type animation.
const AUDIO = 'audio' |
Constant for type Audio.
const CALLBACK_QUERY = 'callback_query' |
Constant for type Callback Query.
const CHANNEL_POST = 'channel_post' |
Constant for type Channel Post.
const CONTACT = 'contact' |
Constant for type Contact.
const DOCUMENT = 'document' |
Constant for type Document.
const EDITED_MESSAGE = 'edited_message' |
Constant for type Edited Message.
const INLINE_QUERY = 'inline_query' |
Constant for type Inline Query.
const LEFT_CHAT_MEMBER = 'left_chat_member' |
Constant for type Left Chat Member.
const LOCATION = 'location' |
Constant for type Location.
const MESSAGE = 'message' |
Constant for type Message.
const MY_CHAT_MEMBER = 'my_chat_member' |
Constant for type My Chat Member.
const NEW_CHAT_MEMBER = 'new_chat_member' |
Constant for type New Chat Member.
const PHOTO = 'photo' |
Constant for type Photo.
const REPLY = 'reply' |
Constant for type Reply.
const STICKER = 'sticker' |
Constant for type sticker.
const VIDEO = 'video' |
Constant for type Video.
const VOICE = 'voice' |
Constant for type Voice.