Clear and simple Telegram bot API
WebAppInfoType
. Classes InlineKeyboardButtonType
and KeyboardButtonType
extended with parameter webApp
;MenuButtonType
;GetChatMenuButtonMethod
and SetChatMenuButtonMethod
for setting chat menu button and getting info about it;SetChatMenuButtonNormalizer
for normalize data from SetChatMenuButtonMethod
before making request;$bot = new \TgBotApi\BotApiBase\BotApi('<bot key>', $apiClient, new \TgBotApi\BotApiBase\BotApiNormalizer(), '<your-domain>');
logOut
(LogOutMethod
), which can be used to log out from the cloud Bot API server before launching your bot locally. You must log out the bot before running it locally, otherwise there is no guarantee that the bot will receive all updates.close
(CloseMethod
), which can be used to close the bot instance before moving it from one local server to another.ipAddress
to the class SetWebhookMethod
, allowing to bypass DNS resolving and use the specified fixed IP address to send webhook requests.ipAddress
to the class WebhookInfoType
, containing the current IP address used for webhook connections creation.dropPendingUpdates
to the class SetWebhookMethod
and to DeleteWebhookMethod
.getChat
request now returns the identifier of the linked chat for supergroups and channels, i.e. the discussion group identifier for a channel and vice versa in the linkedChatId
property.getChat
request now returns the location to which the supergroup is connected (see ChatType::$location
). Added the class ChatLocationType
to represent the location.onlyIfBanned
to the class UnbanChatMemberMethod
to allow safe unban.fileName
to the classes AudioType
and VideoType
, containing the name of the original file.disableContentTypeDetection
in the SendDocumentMethod
and the class inputMediaDocument.messageId
to the UnpinChatMessageMethod
to allow unpinning of the specific pinned message.UnpinAllChatMessagesMethod
, which can be used to unpin all pinned messages in a chat.SendMediaGroupMethod
.livePeriod
to the class LocationType
, representing a maximum period for which the live location can be updated.heading
to the classes LocationType
, InlineQueryResultLocationType
, InputLocationMessageContentType
, SendLocationMethod
and EditMessageLiveLocationMethod
.proximityAlertRadius
to the classes LocationType
, InlineQueryResultLocationType
, InputLocationMessageContentType
, SendLocationMethod
and EditMessageLiveLocationMethod
.ProximityAlertTriggered
and the field proximityAlertTriggered
to the class Message.horizontalAccuracy
to the classes LocationType
, InlineQueryResultLocationType
, InputLocationMessageContentType
, SendLocationMethod
and EditMessageLiveLocationMethod
.senderChat
to the class MessageType
, containing the sender of a message which is a chat (group or channel). For backward compatibility in non-channel chats, the field from in such messages will contain the user 777000 for messages automatically forwarded to the discussion group and the user 1087968824 (@GroupAnonymousBot) for messages from anonymous group administrators.isAnonymous
to the class ChatMemberType
, which can be used to distinguish anonymous chat administrators.isAnonymous
to the PromoteChatMemberMethod
, which allows to promote anonymous chat administrators. The bot itself should have the isAnonymous
right to do this. Despite the fact that bots can have the isAnonymous
right, they will never appear as anonymous in the chat. Bots can use the right only for passing to other administrators.MessageType
as authorSignature
.BotApi::copyMessage
and CopyMessageMethod
, which sends a copy of any message.entities
or captionEntities
) instead of specifying the parseMode
in the classes
InputMediaPhotoType
InputMediaVideoType
InputMediaAnimationType
InputMediaAudioType
InputMediaDocumentType
InlineQueryResultPhotoType
InlineQueryResultGifType
InlineQueryResultMpeg4GifType
InlineQueryResultVideoType
InlineQueryResultAudioType
InlineQueryResultVoiceType
InlineQueryResultDocumentType
InlineQueryResultCachedPhotoType
InlineQueryResultCachedGifType
InlineQueryResultCachedMpeg4GifType
InlineQueryResultCachedVideoType
InlineQueryResultCachedAudioType
InlineQueryResultCachedVoiceType
InlineQueryResultCachedDocumentType
InputTextMessageContentType
SendMessageMethod
SendPhotoMethod
SendVideoMethod
SendAnimationMethod
SendAudioMethod
SendDocumentMethod
SendVoiceMethod
SendPollMethod
EditMessageTextMethod
EditMessageCaptionMethod
googlePlaceId
and googlePlaceType
to the classes VenueType
, InlineQueryResultVenueType
, InputVenueMessageContentType
and to the methods SendVenueMethod
to support Google Places as a venue API provider.allowSendingWithoutReply
to allow sending messages not a as reply if the replied-to message has already been deleted to following classes:
sendMessageMethod
sendPhotoMethod
sendVideoMethod
SendAnimationMethod
SendAudioMethod
SendDocumentMethod
SendStickerMethod
SendVideoNoteMethod
SendVoiceMethod
SendLocationMethod
SendVenueMethod
SendContactMethod
SendPollMethod
SendDiceMethod
SendInvoiceMethod
SendGameMethod
SendMediaGroupMethod
viaBot
to the MessageType
class.
You can now know which bot was used to send a message.SendDiceMethod
.
Added to the class new factory method SendDiceMethod::createWithBasketball
and new constant SendDiceMethod::EMOJI_BASKETBALL
.explanationParseMode
in the method SendPollMethod
.explanationEntities
to the PollType
class.openPeriod
or closeDate
in the SendPollMethod
.openPeriod
and closeDate
to the PollType
class.emoji
in the SendDiceMethod
. Added two factory methods createWithDice
and createWithDarts
for SendDiceMethod
.emoji
to the DiceType
class.sendDice
send(SendDiceMethod)
for sending a dice message, which will have a random value from 1 to 6.
(Yes, we're aware of the “proper” singular of die. But it's awkward, and we decided to help it change One dice at a time!)dice
to the MessageType
object.getMyCommands
for getting the current list of the bot's commands.setMyCommands
set(SetMyCommandMethod)
for changing the list of the bot's commands
through the Bot API instead of @BotFather.tgsSticker
instead of pngSticker
in the class CreateNewStickerSetMethod
.tgsSticker
instead of pngSticker
in the class AddStickerToSetMethod
.thumb
to the StickerSetType
object.setStickerSetThumb
set(SetStickerSetThumbMethod)
.AddStickerToSetMethod::create()
- please use createStatic
or createAnimated
methodsCreateNewStickerSetMethod::create()
- please use createStatic
or createAnimated
methodsadded absent field to MessageType