Page MenuHomePhabricator (Chris)

No OneTemporary

Authored By
Unknown
Size
182 KB
Referenced Files
None
Subscribers
None
diff --git a/src/Entities/Chat.php b/src/Entities/Chat.php
index 284e58b..cd3ee00 100644
--- a/src/Entities/Chat.php
+++ b/src/Entities/Chat.php
@@ -1,145 +1,156 @@
<?php
/**
* This file is part of the TelegramBot package.
*
* (c) Avtandil Kikabidze aka LONGMAN <akalongman@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Longman\TelegramBot\Entities;
use Longman\TelegramBot\Entities\ReactionType\Factory as ReactionTypeFactory;
use Longman\TelegramBot\Entities\ReactionType\ReactionType;
/**
* This object represents a chat.
*
* @link https://core.telegram.org/bots/api#chat
*
* @property string type Type of chat, can be either "private ", "group", "supergroup" or "channel"
*
* @method int getId() Unique identifier for this chat. This number may be greater than 32 bits and some programming languages may have difficulty/silent defects in interpreting it. But it smaller than 52 bits, so a signed 64 bit integer or double-precision float type are safe for storing this identifier.
* @method string getType() Type of chat, can be either "private ", "group", "supergroup" or "channel"
* @method string getTitle() Optional. Title, for channels and group chats
* @method string getUsername() Optional. Username, for private chats, supergroups and channels if available
* @method string getFirstName() Optional. First name of the other party in a private chat
* @method string getLastName() Optional. Last name of the other party in a private chat
* @method bool getIsForum() Optional. True, if the supergroup chat is a forum (has topics enabled)
+ * @method bool getIsDirectMessages() Optional. True, if the chat is the direct messages chat of a channel
* @method int getAccentColorId() Identifier of the accent color for the chat name and backgrounds of the chat photo, reply header, and link preview. See accent colors for more details.
* @method ChatPhoto getPhoto() Optional. Chat photo. Returned only in getChat.
* @method string[] getActiveUsernames() Optional. If non-empty, the list of all active chat usernames; for private chats, supergroups and channels. Returned only in getChat.
* @method ReactionType[] getAvailableReactions() Optional. List of available reactions allowed in the chat. If omitted, then all emoji reactions are allowed. Returned only in getChat.
* @method string getBackgroundCustomEmojiId() Optional. Custom emoji identifier of the emoji chosen by the chat for the reply header and link preview background
* @method int getProfileAccentColorId() Optional. Identifier of the accent color for the chat's profile background. See profile accent colors for more details.
* @method string getProfileBackgroundCustomEmojiId() Optional. Custom emoji identifier of the emoji chosen by the chat for its profile background
* @method string getEmojiStatusCustomEmojiId() Optional. Custom emoji identifier of emoji status of the other party in a private chat. Returned only in getChat.
* @method int getEmojiStatusExpirationDate() Optional. Expiration date of the emoji status of the other party in a private chat in Unix time, if any. Returned only in getChat.
* @method string getBio() Optional. Bio of the other party in a private chat. Returned only in getChat.
* @method bool getHasPrivateForwards() Optional. True, if privacy settings of the other party in the private chat allows to use tg://user?id=<user_id> links only in chats with the user. Returned only in getChat.
* @method bool getHasRestrictedVoiceAndVideoMessages() Optional. True, if the privacy settings of the other party restrict sending voice and video note messages in the private chat. Returned only in getChat.
* @method bool getJoinToSendMessages() Optional. True, if users need to join the supergroup before they can send messages. Returned only in getChat.
* @method bool getJoinByRequest() Optional. True, if all users directly joining the supergroup need to be approved by supergroup administrators. Returned only in getChat.
* @method string getDescription() Optional. Description, for groups, supergroups and channel chats. Returned only in getChat.
* @method string getInviteLink() Optional. Chat invite link, for groups, supergroups and channel chats. Each administrator in a chat generates their own invite links, so the bot must first generate the link using exportChatInviteLink. Returned only in getChat.
* @method Message getPinnedMessage() Optional. Pinned message, for groups, supergroups and channels. Returned only in getChat.
* @method ChatPermissions getPermissions() Optional. Default chat member permissions, for groups and supergroups. Returned only in getChat.
* @method int getSlowModeDelay() Optional. For supergroups, the minimum allowed delay between consecutive messages sent by each unpriviledged user. Returned only in getChat.
* @method int getUnrestrictBoostCount() Optional. For supergroups, the minimum number of boosts that a non-administrator user needs to add in order to ignore slow mode and chat permissions.
* @method int getMessageAutoDeleteTime() Optional. The time after which all messages sent to the chat will be automatically deleted; in seconds. Returned only in getChat.
* @method bool getHasAggressiveAntiSpamEnabled() Optional. True, if aggressive anti-spam checks are enabled in the supergroup. The field is only available to chat administrators. Returned only in getChat.
* @method bool getHasHiddenMembers() Optional. True, if non-administrators can only get the list of bots and administrators in the chat. Returned only in getChat.
* @method bool getHasProtectedContent() Optional. True, if messages from the chat can't be forwarded to other chats. Returned only in getChat.
* @method bool getHasVisibleHistory() Optional. True, if new chat members will have access to old messages; available only to chat administrators
* @method string getStickerSetName() Optional. For supergroups, name of group sticker set. Returned only in getChat.
* @method bool getCanSetStickerSet() Optional. True, if the bot can change the group sticker set. Returned only in getChat.
* @method string getCustomEmojiStickerSetName() Optional. For supergroups, the name of the group's custom emoji sticker set. Custom emoji from this set can be used by all users and bots in the group.
* @method int getLinkedChatId() Optional. Unique identifier for the linked chat. Returned only in getChat.
* @method ChatLocation getLocation() Optional. For supergroups, the location to which the supergroup is connected. Returned only in getChat.
+ * @method BusinessIntro getBusinessIntro() Optional. For private chats with business accounts, the intro of the business. Returned only in getChat.
+ * @method BusinessLocation getBusinessLocation() Optional. For private chats with business accounts, the location of the business. Returned only in getChat.
+ * @method BusinessOpeningHours getBusinessOpeningHours() Optional. For private chats with business accounts, the opening hours of the business. Returned only in getChat.
+ * @method Chat getPersonalChat() Optional. For private chats, the personal channel of the user. Returned only in getChat.
+ * @method Birthdate getBirthdate() Optional. For private chats with ordinary users, the user's birthdate. Returned only in getChat.
*/
class Chat extends Entity
{
/**
* {@inheritdoc}
*/
protected function subEntities(): array
{
return [
- 'photo' => ChatPhoto::class,
- 'available_reactions' => [ReactionTypeFactory::class],
- 'pinned_message' => Message::class,
- 'permissions' => ChatPermissions::class,
- 'location' => ChatLocation::class,
+ 'photo' => ChatPhoto::class,
+ 'available_reactions' => [ReactionTypeFactory::class],
+ 'pinned_message' => Message::class,
+ 'permissions' => ChatPermissions::class,
+ 'location' => ChatLocation::class,
+ 'business_intro' => BusinessIntro::class,
+ 'business_location' => BusinessLocation::class,
+ 'business_opening_hours' => BusinessOpeningHours::class,
+ 'personal_chat' => Chat::class,
+ 'birthdate' => Birthdate::class,
];
}
public function __construct(array $data)
{
parent::__construct($data);
$id = $this->getId();
$type = $this->getType();
if (!$type) {
$id > 0 && $this->type = 'private';
$id < 0 && $this->type = 'group';
}
}
/**
* Try to mention the user of this chat, else return the title
*
* @param bool $escape_markdown
*
* @return string
*/
public function tryMention($escape_markdown = false): string
{
if ($this->isPrivateChat()) {
return parent::tryMention($escape_markdown);
}
return $this->getTitle();
}
/**
* Check if this is a group chat
*
* @return bool
*/
public function isGroupChat(): bool
{
return $this->getType() === 'group';
}
/**
* Check if this is a private chat
*
* @return bool
*/
public function isPrivateChat(): bool
{
return $this->getType() === 'private';
}
/**
* Check if this is a super group
*
* @return bool
*/
public function isSuperGroup(): bool
{
return $this->getType() === 'supergroup';
}
/**
* Check if this is a channel
*
* @return bool
*/
public function isChannel(): bool
{
return $this->getType() === 'channel';
}
}
diff --git a/src/Entities/ChatAdministratorRights.php b/src/Entities/ChatAdministratorRights.php
index c6c50ff..31aea0d 100644
--- a/src/Entities/ChatAdministratorRights.php
+++ b/src/Entities/ChatAdministratorRights.php
@@ -1,43 +1,47 @@
<?php
namespace Longman\TelegramBot\Entities;
/**
* Represents the rights of an administrator in a chat.
*
* @method bool getIsAnonymous() True, if the user's presence in the chat is hidden
* @method bool getCanManageChat() True, if the administrator can access the chat event log, chat statistics, message statistics in channels, see channel members, see anonymous administrators in supergroups and ignore slow mode. Implied by any other administrator privilege
* @method bool getCanDeleteMessages() True, if the administrator can delete messages of other users
* @method bool getCanManageVideoChats() True, if the administrator can manage video chats
* @method bool getCanRestrictMembers() True, if the administrator can restrict, ban or unban chat members
* @method bool getCanPromoteMembers() True, if the administrator can add new administrators with a subset of their own privileges or demote administrators that he has promoted, directly or indirectly (promoted by administrators that were appointed by the user)
* @method bool getCanChangeInfo() True, if the user is allowed to change the chat title, photo and other settings
* @method bool getCanInviteUsers() True, if the user is allowed to invite new users to the chat
* @method bool getCanPostMessages() Optional. True, if the administrator can post in the channel; channels only
* @method bool getCanEditMessages() Optional. True, if the administrator can edit messages of other users and can pin messages; channels only
* @method bool getCanPinMessages() Optional. True, if the user is allowed to pin messages; groups and supergroups only
* @method bool getCanPostStories() Optional. True, if the administrator can post stories in the channel; channels only
* @method bool getCanEditStories() Optional. True, if the administrator can edit stories posted by other users; channels only
* @method bool getCanDeleteStories() Optional. True, if the administrator can delete stories posted by other users; channels only
* @method bool getCanManageTopics() Optional. True, if the user is allowed to create, rename, close, and reopen forum topics; supergroups only
+ * @method bool getCanManageDirectMessages() Optional. True, if the administrator can manage direct messages of the channel and decline suggested posts; for channels only
+ * @method bool getCanManageTags() Optional. True, if the administrator can manage chat member tags; for groups and supergroups only
*
* @method $this setIsAnonymous(bool $is_anonymous) True, if the user's presence in the chat is hidden
* @method $this setCanManageChat(bool $can_manage_chat) True, if the administrator can access the chat event log, chat statistics, message statistics in channels, see channel members, see anonymous administrators in supergroups and ignore slow mode. Implied by any other administrator privilege
* @method $this setCanDeleteMessages(bool $can_delete_messages) True, if the administrator can delete messages of other users
* @method $this setCanManageVideoChats(bool $can_manage_video_chats) True, if the administrator can manage video chats
* @method $this setCanRestrictMembers(bool $can_restrict_members) True, if the administrator can restrict, ban or unban chat members
* @method $this setCanPromoteMembers(bool $can_promote_members) True, if the administrator can add new administrators with a subset of their own privileges or demote administrators that he has promoted, directly or indirectly (promoted by administrators that were appointed by the user)
* @method $this setCanChangeInfo(bool $can_change_info) True, if the user is allowed to change the chat title, photo and other settings
* @method $this setCanInviteUsers(bool $can_invite_users) True, if the user is allowed to invite new users to the chat
* @method $this setCanPostMessages(bool $can_post_messages) Optional. True, if the administrator can post in the channel; channels only
* @method $this setCanEditMessages(bool $can_edit_messages) Optional. True, if the administrator can edit messages of other users and can pin messages; channels only
* @method $this setCanPinMessages(bool $can_pin_messages) Optional. True, if the user is allowed to pin messages; groups and supergroups only
* @method $this setCanPostStories(bool $can_post_stories) Optional. True, if the administrator can post stories in the channel; channels only
* @method $this setCanEditStories(bool $can_edit_stories) Optional. True, if the administrator can edit stories posted by other users; channels only
* @method $this setCanDeleteStories(bool $can_delete_stories) Optional. True, if the administrator can delete stories posted by other users; channels only
* @method $this setCanManageTopics(bool $can_manage_topics) Optional. True, if the user is allowed to create, rename, close, and reopen forum topics; supergroups only
+ * @method $this setCanManageDirectMessages(bool $can_manage_direct_messages) Optional. True, if the administrator can manage direct messages of the channel and decline suggested posts; for channels only
+ * @method $this setCanManageTags(bool $can_manage_tags) Optional. True, if the administrator can manage chat member tags; for groups and supergroups only
*/
class ChatAdministratorRights extends Entity
{
}
diff --git a/src/Entities/ChatJoinRequest.php b/src/Entities/ChatJoinRequest.php
index 5d2c343..894e91a 100644
--- a/src/Entities/ChatJoinRequest.php
+++ b/src/Entities/ChatJoinRequest.php
@@ -1,29 +1,30 @@
<?php
namespace Longman\TelegramBot\Entities;
/**
* Class ChatJoinRequest
*
* Represents a join request sent to a chat.
*
* @link https://core.telegram.org/bots/api#chatjoinrequest
*
* @method Chat getChat() Chat to which the request was sent
* @method User getFrom() User that sent the join request
* @method int getUserChatId() Identifier of a private chat with the user who sent the join request.
* @method int getDate() Date the request was sent in Unix time
+ * @method string getQueryId() Optional. Unique identifier for the join request query.
* @method string getBio() Optional. Bio of the user.
* @method ChatInviteLink getInviteLink() Optional. Chat invite link that was used by the user to send the join request
*/
class ChatJoinRequest extends Entity
{
protected function subEntities(): array
{
return [
'chat' => Chat::class,
'from' => User::class,
'invite_link' => ChatInviteLink::class,
];
}
}
diff --git a/src/Entities/ChatMember/ChatMemberAdministrator.php b/src/Entities/ChatMember/ChatMemberAdministrator.php
index 46a9cb3..5da8753 100644
--- a/src/Entities/ChatMember/ChatMemberAdministrator.php
+++ b/src/Entities/ChatMember/ChatMemberAdministrator.php
@@ -1,44 +1,47 @@
<?php
namespace Longman\TelegramBot\Entities\ChatMember;
use Longman\TelegramBot\Entities\Entity;
use Longman\TelegramBot\Entities\User;
/**
* Class ChatMemberAdministrator
*
* @link https://core.telegram.org/bots/api#chatmemberadministrator
*
* @method string getStatus() The member's status in the chat, always “administrator”
* @method User getUser() Information about the user
* @method bool getCanBeEdited() True, if the bot is allowed to edit administrator privileges of that user
* @method bool getIsAnonymous() True, if the user's presence in the chat is hidden
* @method bool getCanManageChat() True, if the administrator can access the chat event log, chat statistics, message statistics in channels, see channel members, see anonymous administrators in supergroups and ignore slow mode. Implied by any other administrator privilege
* @method bool getCanDeleteMessages() True, if the administrator can delete messages of other users
* @method bool getCanManageVideoChats() True, if the administrator can manage video chats
* @method bool getCanRestrictMembers() True, if the administrator can restrict, ban or unban chat members
* @method bool getCanPromoteMembers() True, if the administrator can add new administrators with a subset of their own privileges or demote administrators that he has promoted, directly or indirectly (promoted by administrators that were appointed by the user)
* @method bool getCanChangeInfo() True, if the user is allowed to change the chat title, photo and other settings
* @method bool getCanInviteUsers() True, if the user is allowed to invite new users to the chat
* @method bool getCanPostMessages() Optional. True, if the administrator can post in the channel; channels only
* @method bool getCanEditMessages() Optional. True, if the administrator can edit messages of other users and can pin messages; channels only
* @method bool getCanPinMessages() Optional. True, if the user is allowed to pin messages; groups and supergroups only
* @method bool getCanPostStories() Optional. True, if the administrator can post stories in the channel; channels only
* @method bool getCanEditStories() Optional. True, if the administrator can edit stories posted by other users; channels only
* @method bool getCanDeleteStories() Optional. True, if the administrator can delete stories posted by other users; channels only
* @method bool getCanManageTopics() Optional. True, if the user is allowed to create, rename, close, and reopen forum topics; supergroups only
+ * @method bool getCanManageDirectMessages() Optional. True, if the administrator can manage direct messages of the channel and decline suggested posts; for channels only
+ * @method bool getCanManageTags() Optional. True, if the administrator can manage chat member tags; for groups and supergroups only
* @method string getCustomTitle() Custom title for this user
+ * @method string getTag() Optional. Tag of the member
*/
class ChatMemberAdministrator extends Entity implements ChatMember
{
/**
* @inheritDoc
*/
protected function subEntities(): array
{
return [
'user' => User::class,
];
}
}
diff --git a/src/Entities/ChatMember/ChatMemberMember.php b/src/Entities/ChatMember/ChatMemberMember.php
index 15c82a9..373bd98 100644
--- a/src/Entities/ChatMember/ChatMemberMember.php
+++ b/src/Entities/ChatMember/ChatMemberMember.php
@@ -1,27 +1,29 @@
<?php
namespace Longman\TelegramBot\Entities\ChatMember;
use Longman\TelegramBot\Entities\Entity;
use Longman\TelegramBot\Entities\User;
/**
* Class ChatMemberMember
*
* @link https://core.telegram.org/bots/api#chatmembermember
*
- * @method string getStatus() The member's status in the chat, always “member”
- * @method User getUser() Information about the user
+ * @method string getStatus() The member's status in the chat, always “member”
+ * @method User getUser() Information about the user
+ * @method int getUntilDate() Optional. Date when the user's subscription will expire; unix time
+ * @method string getTag() Optional. Tag of the member
*/
class ChatMemberMember extends Entity implements ChatMember
{
/**
* @inheritDoc
*/
protected function subEntities(): array
{
return [
'user' => User::class,
];
}
}
diff --git a/src/Entities/ChatMember/ChatMemberOwner.php b/src/Entities/ChatMember/ChatMemberOwner.php
index 9be4b13..f6afc85 100644
--- a/src/Entities/ChatMember/ChatMemberOwner.php
+++ b/src/Entities/ChatMember/ChatMemberOwner.php
@@ -1,29 +1,30 @@
<?php
namespace Longman\TelegramBot\Entities\ChatMember;
use Longman\TelegramBot\Entities\Entity;
use Longman\TelegramBot\Entities\User;
/**
* Class ChatMemberOwner
*
* @link https://core.telegram.org/bots/api#chatmemberowner
*
* @method string getStatus() The member's status in the chat, always “creator”
* @method User getUser() Information about the user
* @method string getCustomTitle() Custom title for this user
* @method bool getIsAnonymous() True, if the user's presence in the chat is hidden
+ * @method string getTag() Optional. Tag of the member
*/
class ChatMemberOwner extends Entity implements ChatMember
{
/**
* {@inheritdoc}
*/
protected function subEntities(): array
{
return [
'user' => User::class,
];
}
}
diff --git a/src/Entities/ChatMember/ChatMemberRestricted.php b/src/Entities/ChatMember/ChatMemberRestricted.php
index d4f36b7..6845ea4 100644
--- a/src/Entities/ChatMember/ChatMemberRestricted.php
+++ b/src/Entities/ChatMember/ChatMemberRestricted.php
@@ -1,60 +1,63 @@
<?php
namespace Longman\TelegramBot\Entities\ChatMember;
use Longman\TelegramBot\Entities\Entity;
use Longman\TelegramBot\Entities\User;
/**
* Class ChatMemberRestricted
*
* @link https://core.telegram.org/bots/api#chatmemberrestricted
*
* @method string getStatus() The member's status in the chat, always “restricted”
* @method User getUser() Information about the user
* @method bool getIsMember() True, if the user is a member of the chat at the moment of the request
* @method bool getCanChangeInfo() True, if the user is allowed to change the chat title, photo and other settings
* @method bool getCanInviteUsers() True, if the user is allowed to invite new users to the chat
* @method bool getCanPinMessages() True, if the user is allowed to pin messages; groups and supergroups only
* @method bool getCanManageTopics() True, if the user is allowed to create forum topics
* @method bool getCanSendMessages() True, if the user is allowed to send text messages, contacts, locations and venues
* @method bool getCanSendAudios() True, if the user is allowed to send audios
* @method bool getCanSendDocuments() True, if the user is allowed to send documents
* @method bool getCanSendPhotos() True, if the user is allowed to send photos
* @method bool getCanSendVideos() True, if the user is allowed to send videos
* @method bool getCanSendVideoNotes() True, if the user is allowed to send video notes
* @method bool getCanSendVoiceNotes() True, if the user is allowed to send voice notes
* @method bool getCanSendPolls() True, if the user is allowed to send polls
* @method bool getCanSendOtherMessages() True, if the user is allowed to send animations, games, stickers and use inline bots
* @method bool getCanAddWebPagePreviews() True, if the user is allowed to add web page previews to their messages
+ * @method bool getCanEditTag() True, if the user is allowed to edit their own tag
+ * @method bool getCanReactToMessages() True, if the user is allowed to add reactions to messages
+ * @method string getTag() Optional. Tag of the member
* @method int getUntilDate() Date when restrictions will be lifted for this user; unix time
*/
class ChatMemberRestricted extends Entity implements ChatMember
{
/**
* @inheritDoc
*/
protected function subEntities(): array
{
return [
'user' => User::class,
];
}
/**
* True, if the user is allowed to send audios, documents, photos, videos, video notes OR voice notes
*
* @deprecated Use new fine-grained methods provided by Telegram Bot API.
*
* @return bool
*/
public function getCanSendMediaMessages(): bool
{
return $this->getCanSendAudios() ||
$this->getCanSendDocuments() ||
$this->getCanSendPhotos() ||
$this->getCanSendVideos() ||
$this->getCanSendVideoNotes() ||
$this->getCanSendVoiceNotes();
}
}
diff --git a/src/Entities/ChatMemberUpdated.php b/src/Entities/ChatMemberUpdated.php
index 172ddfb..3105fa4 100644
--- a/src/Entities/ChatMemberUpdated.php
+++ b/src/Entities/ChatMemberUpdated.php
@@ -1,47 +1,48 @@
<?php
/**
* This file is part of the TelegramBot package.
*
* (c) Avtandil Kikabidze aka LONGMAN <akalongman@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Longman\TelegramBot\Entities;
use Longman\TelegramBot\Entities\ChatMember\ChatMember;
use Longman\TelegramBot\Entities\ChatMember\Factory as ChatMemberFactory;
/**
* Class ChatMemberUpdated
*
* Represents changes in the status of a chat member
*
* @link https://core.telegram.org/bots/api#chatmemberupdated
*
* @method Chat getChat() Chat the user belongs to
* @method User getFrom() Performer of the action, which resulted in the change
* @method int getDate() Date the change was done in Unix time
* @method ChatMember getOldChatMember() Previous information about the chat member
* @method ChatMember getNewChatMember() New information about the chat member
* @method ChatInviteLink getInviteLink() Optional. Chat invite link, which was used by the user to join the chat; for joining by invite link events only.
* @method bool getViaChatFolderInviteLink() Optional. True, if the user joined the chat via a chat folder invite link
+ * @method bool getViaJoinRequest() Optional. True, if the user joined the chat after sending a direct join request without using an invite link and being approved by an administrator
*/
class ChatMemberUpdated extends Entity
{
/**
* {@inheritdoc}
*/
protected function subEntities(): array
{
return [
'chat' => Chat::class,
'from' => User::class,
'old_chat_member' => ChatMemberFactory::class,
'new_chat_member' => ChatMemberFactory::class,
'invite_link' => ChatInviteLink::class,
];
}
}
diff --git a/src/Entities/ChatPermissions.php b/src/Entities/ChatPermissions.php
index 504ccea..6d8a0f9 100644
--- a/src/Entities/ChatPermissions.php
+++ b/src/Entities/ChatPermissions.php
@@ -1,52 +1,54 @@
<?php
/**
* This file is part of the TelegramBot package.
*
* (c) Avtandil Kikabidze aka LONGMAN <akalongman@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Longman\TelegramBot\Entities;
/**
* Class ChatPermissions
*
* @link https://core.telegram.org/bots/api#chatpermissions
*
* @method bool getCanSendMessages() Optional. True, if the user is allowed to send text messages, contacts, locations and venues
* @method bool getCanSendAudios() Optional. True, if the user is allowed to send audios
* @method bool getCanSendDocuments() Optional. True, if the user is allowed to send documents
* @method bool getCanSendPhotos() Optional. True, if the user is allowed to send photos
* @method bool getCanSendVideos() Optional. True, if the user is allowed to send videos
* @method bool getCanSendVideoNotes() Optional. True, if the user is allowed to send video notes
* @method bool getCanSendVoiceNotes() Optional. True, if the user is allowed to send voice notes
* @method bool getCanSendPolls() Optional. True, if the user is allowed to send polls, implies can_send_messages
* @method bool getCanSendOtherMessages() Optional. True, if the user is allowed to send animations, games, stickers and use inline bots, implies can_send_media_messages
* @method bool getCanAddWebPagePreviews() Optional. True, if the user is allowed to add web page previews to their messages, implies can_send_media_messages
* @method bool getCanChangeInfo() Optional. True, if the user is allowed to change the chat title, photo and other settings. Ignored in public supergroups
* @method bool getCanInviteUsers() Optional. True, if the user is allowed to invite new users to the chat
* @method bool getCanPinMessages() Optional. True, if the user is allowed to pin messages. Ignored in public supergroups
* @method bool getCanManageTopics() Optional. True, if the user is allowed to create forum topics. If omitted defaults to the value of can_pin_messages
+ * @method bool getCanEditTag() Optional. True, if the user is allowed to edit their own tag
+ * @method bool getCanReactToMessages() Optional. True, if the user is allowed to add reactions to messages
*/
class ChatPermissions extends Entity
{
/**
* True, if the user is allowed to send audios, documents, photos, videos, video notes OR voice notes
*
* @deprecated Use new fine-grained methods provided by Telegram Bot API.
*
* @return bool
*/
public function getCanSendMediaMessages(): bool
{
return $this->getCanSendAudios() ||
$this->getCanSendDocuments() ||
$this->getCanSendPhotos() ||
$this->getCanSendVideos() ||
$this->getCanSendVideoNotes() ||
$this->getCanSendVoiceNotes();
}
}
diff --git a/src/Entities/ChatShared.php b/src/Entities/ChatShared.php
index 5987d36..0b23864 100644
--- a/src/Entities/ChatShared.php
+++ b/src/Entities/ChatShared.php
@@ -1,18 +1,29 @@
<?php
namespace Longman\TelegramBot\Entities;
/**
* Class ChatShared
*
* This object contains information about the chat whose identifier was shared with the bot using a KeyboardButtonRequestChat button.
*
* @link https://core.telegram.org/bots/api#chatshared
*
- * @method int getRequestId() Identifier of the request
- * @method int getChatId() Identifier of the shared chat.
+ * @method int getRequestId() Identifier of the request
+ * @method int getChatId() Identifier of the shared chat. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a 64-bit integer or double-precision float type are safe for storing this identifier. The bot may not have access to the chat and could be unable to use this identifier, unless the chat is already known to the bot by some other means.
+ * @method string getTitle() Optional. Title of the chat, if the title was requested by the bot
+ * @method string getUsername() Optional. Username of the chat, if the username was requested by the bot
+ * @method PhotoSize[] getPhoto() Optional. Available sizes of the chat photo, if the photo was requested by the bot
*/
class ChatShared extends Entity
{
-
+ /**
+ * {@inheritdoc}
+ */
+ protected function subEntities(): array
+ {
+ return [
+ 'photo' => [PhotoSize::class],
+ ];
+ }
}
diff --git a/src/Entities/ExternalReplyInfo.php b/src/Entities/ExternalReplyInfo.php
index e879973..7cd95a9 100644
--- a/src/Entities/ExternalReplyInfo.php
+++ b/src/Entities/ExternalReplyInfo.php
@@ -1,74 +1,82 @@
<?php
/**
* This file is part of the TelegramBot package.
*
* (c) Avtandil Kikabidze aka LONGMAN <akalongman@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Longman\TelegramBot\Entities;
+use Longman\TelegramBot\Entities\MessageOrigin\Factory as MessageOriginFactory;
+
/**
* This object contains information about a message that is being replied to, which may come from another chat or forum topic.
*
* @link https://core.telegram.org/bots/api#externalreplyinfo
*
* @method MessageOrigin getOrigin() Origin of the message replied to by the given message
* @method Chat getChat() Optional. Chat the original message belongs to. Available only if the chat is a supergroup or a channel.
* @method int getMessageId() Optional. Unique message identifier inside the original chat. Available only if the original chat is a supergroup or a channel.
* @method LinkPreviewOptions getLinkPreviewOptions() Optional. Options used for link preview generation for the original message, if it is a text message
* @method Animation getAnimation() Optional. Message is an animation, information about the animation
* @method Audio getAudio() Optional. Message is an audio file, information about the file
* @method Document getDocument() Optional. Message is a general file, information about the file
* @method PhotoSize[] getPhoto() Optional. Message is a photo, available sizes of the photo
* @method Sticker getSticker() Optional. Message is a sticker, information about the sticker
* @method Story getStory() Optional. Message is a forwarded story
* @method Video getVideo() Optional. Message is a video, information about the video
* @method VideoNote getVideoNote() Optional. Message is a video note, information about the video message
* @method Voice getVoice() Optional. Message is a voice message, information about the file
* @method bool getHasMediaSpoiler() Optional. True, if the message media is covered by a spoiler animation
+ * @method Checklist getChecklist() Optional. Message is a checklist
* @method Contact getContact() Optional. Message is a shared contact, information about the contact
* @method Dice getDice() Optional. Message is a dice with random value
* @method Game getGame() Optional. Message is a game, information about the game. More about games »
* @method Giveaway getGiveaway() Optional. Message is a scheduled giveaway, information about the giveaway
* @method GiveawayWinners getGiveawayWinners() Optional. A giveaway with public winners was completed
* @method Invoice getInvoice() Optional. Message is an invoice for a payment, information about the invoice. More about payments »
+ * @method LivePhoto getLivePhoto() Optional. Message is a live photo, information about the live photo
* @method Location getLocation() Optional. Message is a shared location, information about the location
* @method Poll getPoll() Optional. Message is a native poll, information about the poll
* @method Venue getVenue() Optional. Message is a venue, information about the venue
+ * @method PaidMediaInfo getPaidMedia() Optional. Message is a paid media purchase, information about the paid media
*/
class ExternalReplyInfo extends Entity
{
/**
* {@inheritdoc}
*/
protected function subEntities(): array
{
return [
- 'origin' => MessageOrigin::class,
+ 'origin' => MessageOriginFactory::class,
'chat' => Chat::class,
'link_preview_options' => LinkPreviewOptions::class,
'animation' => Animation::class,
'audio' => Audio::class,
'document' => Document::class,
'photo' => [PhotoSize::class],
'sticker' => Sticker::class,
'story' => Story::class,
'video' => Video::class,
'video_note' => VideoNote::class,
'voice' => Voice::class,
+ 'checklist' => Checklist::class,
'contact' => Contact::class,
'dice' => Dice::class,
'game' => Game::class,
'giveaway' => Giveaway::class,
'giveaway_winners' => GiveawayWinners::class,
'invoice' => Invoice::class,
+ 'live_photo' => LivePhoto::class,
'location' => Location::class,
'poll' => Poll::class,
'venue' => Venue::class,
+ 'paid_media' => PaidMediaInfo::class,
];
}
}
diff --git a/src/Entities/InlineKeyboardButton.php b/src/Entities/InlineKeyboardButton.php
index e23439e..04e9068 100644
--- a/src/Entities/InlineKeyboardButton.php
+++ b/src/Entities/InlineKeyboardButton.php
@@ -1,80 +1,100 @@
<?php
/**
* This file is part of the TelegramBot package.
*
* (c) Avtandil Kikabidze aka LONGMAN <akalongman@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Longman\TelegramBot\Entities;
use Longman\TelegramBot\Entities\Games\CallbackGame;
-use Longman\TelegramBot\Exception\TelegramException;
/**
* Class InlineKeyboardButton
*
* @link https://core.telegram.org/bots/api#inlinekeyboardbutton
*
- * @method string getText() Label text on the button
- * @method string getUrl() Optional. HTTP url to be opened when button is pressed
- * @method LoginUrl getLoginUrl() Optional. An HTTP URL used to automatically authorize the user. Can be used as a replacement for the Telegram Login Widget.
- * @method string getCallbackData() Optional. Data to be sent in a callback query to the bot when button is pressed, 1-64 bytes
- * @method WebAppInfo getWebApp() Optional. Description of the Web App that will be launched when the user presses the button. The Web App will be able to send an arbitrary message on behalf of the user using the method answerWebAppQuery. Available only in private chats between a user and the bot.
- * @method string getSwitchInlineQuery() 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.
- * @method string getSwitchInlineQueryCurrentChat() 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.
+ * @method string getText() Label text on the button
+ * @method string getUrl() Optional. HTTP url to be opened when button is pressed
+ * @method LoginUrl getLoginUrl() Optional. An HTTP URL used to automatically authorize the user. Can be used as a replacement for the Telegram Login Widget.
+ * @method string getCallbackData() Optional. Data to be sent in a callback query to the bot when button is pressed, 1-64 bytes
+ * @method WebAppInfo getWebApp() Optional. Description of the Web App that will be launched when the user presses the button. The Web App will be able to send an arbitrary message on behalf of the user using the method answerWebAppQuery. Available only in private chats between a user and the bot.
+ * @method string getSwitchInlineQuery() 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.
+ * @method string getSwitchInlineQueryCurrentChat() 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.
* @method SwitchInlineQueryChosenChat getSwitchInlineQueryChosenChat() Optional. If set, pressing the button will prompt the user to select one of their chats of the specified type, open that chat and insert the bot's username and the specified inline query in the input field
- * @method CallbackGame getCallbackGame() Optional. Description of the game that will be launched when the user presses the button.
- * @method bool getPay() Optional. Specify True, to send a Pay button.
+ * @method CallbackGame getCallbackGame() Optional. Description of the game that will be launched when the user presses the button.
+ * @method bool getPay() Optional. Specify True, to send a Pay button.
+ * @method CopyTextButton getCopyText() Optional. Description of the button that copies the specified text to the clipboard.
+ * @method string getStyle() Optional. Style of the button. Must be one of “danger” (red), “success” (green) or “primary” (blue). If omitted, then an app-specific style is used.
+ * @method string getIconCustomEmojiId() Optional. Unique identifier of the custom emoji shown as the button icon.
*
* @method $this setText(string $text) Label text on the button
* @method $this setUrl(string $url) Optional. HTTP url to be opened when button is pressed
* @method $this setLoginUrl(LoginUrl $login_url) Optional. HTTP url to be opened when button is pressed
* @method $this setCallbackData(string $callback_data) Optional. Data to be sent in a callback query to the bot when button is pressed, 1-64 bytes
* @method $this setWebApp(WebAppInfo $web_app) Optional. Description of the Web App that will be launched when the user presses the button. The Web App will be able to send an arbitrary message on behalf of the user using the method answerWebAppQuery. Available only in private chats between a user and the bot.
* @method $this setSwitchInlineQuery(string $switch_inline_query) 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.
* @method $this setSwitchInlineQueryCurrentChat(string $switch_inline_query_current_chat) 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.
* @method $this setSwitchInlineQueryChosenChat(SwitchInlineQueryChosenChat $switch_inline_query_chosen_chat) Optional. If set, pressing the button will prompt the user to select one of their chats of the specified type, open that chat and insert the bot's username and the specified inline query in the input field
* @method $this setCallbackGame(CallbackGame $callback_game) Optional. Description of the game that will be launched when the user presses the button.
* @method $this setPay(bool $pay) Optional. Specify True, to send a Pay button.
+ * @method $this setCopyText(CopyTextButton $copy_text) Optional. Description of the button that copies the specified text to the clipboard.
+ * @method $this setStyle(string $style) Optional. Style of the button. Must be one of “danger” (red), “success” (green) or “primary” (blue). If omitted, then an app-specific style is used.
+ * @method $this setIconCustomEmojiId(string $icon_custom_emoji_id) Optional. Unique identifier of the custom emoji shown as the button icon.
*/
class InlineKeyboardButton extends KeyboardButton
{
+ /**
+ * {@inheritdoc}
+ */
+ protected function subEntities(): array
+ {
+ return [
+ 'login_url' => LoginUrl::class,
+ 'web_app' => WebAppInfo::class,
+ 'switch_inline_query_chosen_chat' => SwitchInlineQueryChosenChat::class,
+ 'callback_game' => CallbackGame::class,
+ 'copy_text' => CopyTextButton::class,
+ ];
+ }
+
/**
* Check if the passed data array could be an InlineKeyboardButton.
*
* @param array $data
*
* @return bool
*/
public static function couldBe(array $data): bool
{
return array_key_exists('text', $data) && (
array_key_exists('url', $data) ||
array_key_exists('login_url', $data) ||
array_key_exists('callback_data', $data) ||
array_key_exists('web_app', $data) ||
array_key_exists('switch_inline_query', $data) ||
array_key_exists('switch_inline_query_current_chat', $data) ||
array_key_exists('switch_inline_query_chosen_chat', $data) ||
array_key_exists('callback_game', $data) ||
- array_key_exists('pay', $data)
+ array_key_exists('pay', $data) ||
+ array_key_exists('copy_text', $data)
);
}
/**
* {@inheritdoc}
*/
public function __call($method, $args)
{
// Only 1 of these can be set, so clear the others when setting a new one.
- if (in_array($method, ['setUrl', 'setLoginUrl', 'setCallbackData', 'setWebApp', 'setSwitchInlineQuery', 'setSwitchInlineQueryCurrentChat', 'setSwitchInlineQueryChosenChat', 'setCallbackGame', 'setPay'], true)) {
- unset($this->url, $this->login_url, $this->callback_data, $this->web_app, $this->switch_inline_query, $this->switch_inline_query_current_chat, $this->switch_inline_query_chosen_chat, $this->callback_game, $this->pay);
+ if (in_array($method, ['setUrl', 'setLoginUrl', 'setCallbackData', 'setWebApp', 'setSwitchInlineQuery', 'setSwitchInlineQueryCurrentChat', 'setSwitchInlineQueryChosenChat', 'setCallbackGame', 'setPay', 'setCopyText'], true)) {
+ unset($this->url, $this->login_url, $this->callback_data, $this->web_app, $this->switch_inline_query, $this->switch_inline_query_current_chat, $this->switch_inline_query_chosen_chat, $this->callback_game, $this->pay, $this->copy_text);
}
return parent::__call($method, $args);
}
}
diff --git a/src/Entities/InlineQuery/InlineQueryResultArticle.php b/src/Entities/InlineQuery/InlineQueryResultArticle.php
index 70ef660..61a3b2d 100644
--- a/src/Entities/InlineQuery/InlineQueryResultArticle.php
+++ b/src/Entities/InlineQuery/InlineQueryResultArticle.php
@@ -1,72 +1,69 @@
<?php
/**
* This file is part of the TelegramBot package.
*
* (c) Avtandil Kikabidze aka LONGMAN <akalongman@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Longman\TelegramBot\Entities\InlineQuery;
use Longman\TelegramBot\Entities\InlineKeyboard;
use Longman\TelegramBot\Entities\InputMessageContent\InputMessageContent;
/**
* Class InlineQueryResultArticle
*
* @link https://core.telegram.org/bots/api#inlinequeryresultarticle
*
* <code>
* $data = [
* 'id' => '',
* 'title' => '',
* 'input_message_content' => <InputMessageContent>,
* 'reply_markup' => <InlineKeyboard>,
* 'url' => '',
- * 'hide_url' => true,
* 'description' => '',
* 'thumbnail_url' => '',
* 'thumbnail_width' => 30,
* 'thumbnail_height' => 30,
* ];
* </code>
*
* @method string getType() Type of the result, must be article
* @method string getId() Unique identifier for this result, 1-64 Bytes
* @method string getTitle() Title of the result
* @method InputMessageContent getInputMessageContent() Content of the message to be sent
* @method InlineKeyboard getReplyMarkup() Optional. Inline keyboard attached to the message
* @method string getUrl() Optional. URL of the result
- * @method bool getHideUrl() Optional. Pass True, if you don't want the URL to be shown in the message
* @method string getDescription() Optional. Short description of the result
* @method string getThumbnailUrl() Optional. Url of the thumbnail for the result
* @method int getThumbnailWidth() Optional. Thumbnail width
* @method int getThumbnailHeight() Optional. Thumbnail height
*
* @method $this setId(string $id) Unique identifier for this result, 1-64 Bytes
* @method $this setTitle(string $title) Title of the result
* @method $this setInputMessageContent(InputMessageContent $input_message_content) Content of the message to be sent
* @method $this setReplyMarkup(InlineKeyboard $reply_markup) Optional. Inline keyboard attached to the message
* @method $this setUrl(string $url) Optional. URL of the result
- * @method $this setHideUrl(bool $hide_url) Optional. Pass True, if you don't want the URL to be shown in the message
* @method $this setDescription(string $description) Optional. Short description of the result
* @method $this setThumbnailUrl(string $thumbnail_url) Optional. Url of the thumbnail for the result
* @method $this setThumbnailWidth(int $thumbnail_width) Optional. Thumbnail width
* @method $this setThumbnailHeight(int $thumbnail_height) Optional. Thumbnail height
*/
class InlineQueryResultArticle extends InlineEntity implements InlineQueryResult
{
/**
* InlineQueryResultArticle constructor
*
* @param array $data
*/
public function __construct(array $data = [])
{
$data['type'] = 'article';
parent::__construct($data);
}
}
diff --git a/src/Entities/InputMedia/InputMediaAnimation.php b/src/Entities/InputMedia/InputMediaAnimation.php
index 7671923..e108f63 100644
--- a/src/Entities/InputMedia/InputMediaAnimation.php
+++ b/src/Entities/InputMedia/InputMediaAnimation.php
@@ -1,66 +1,69 @@
<?php
/**
* This file is part of the TelegramBot package.
*
* (c) Avtandil Kikabidze aka LONGMAN <akalongman@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Longman\TelegramBot\Entities\InputMedia;
use Longman\TelegramBot\Entities\Entity;
+use Longman\TelegramBot\Entities\MessageEntity;
/**
* Class InputMediaAnimation
*
* @link https://core.telegram.org/bots/api#inputmediaanimation
*
* <code>
* $data = [
* 'media' => '123abc',
* 'thumbnail' => '456def',
* 'caption' => '*Animation* caption',
* 'parse_mode' => 'markdown',
* 'width' => 200,
* 'height' => 150,
* 'duration' => 11,
* ];
* </code>
*
- * @method string getType() Type of the result, must be animation
- * @method string getMedia() File to send. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass “attach://<file_attach_name>” to upload a new one using multipart/form-data under <file_attach_name> name. More info on Sending Files »
- * @method string getThumbnail() Optional. Thumbnail of the file sent. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail‘s width and height should not exceed 90. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can’t be reused and can be only uploaded as a new file, so you can pass “attach://<file_attach_name>” if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. More info on Sending Files »
- * @method string getCaption() Optional. Caption of the animation to be sent, 0-200 characters
- * @method string getParseMode() Optional. Mode for parsing entities in the animation caption
- * @method MessageEntity[] getCaptionEntities() Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode
- * @method int getWidth() Optional. Animation width
- * @method int getHeight() Optional. Animation height
- * @method int getDuration() Optional. Animation duration
- * @method bool getHasSpoiler() Optional. Pass True if the animation needs to be covered with a spoiler animation
+ * @method string getType() Type of the result, must be animation
+ * @method string getMedia() File to send. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass “attach://<file_attach_name>” to upload a new one using multipart/form-data under <file_attach_name> name. More info on Sending Files »
+ * @method string getThumbnail() Optional. Thumbnail of the file sent. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail‘s width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can’t be reused and can be only uploaded as a new file, so you can pass “attach://<file_attach_name>” if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. More info on Sending Files »
+ * @method string getCaption() Optional. Caption of the animation to be sent, 0-200 characters
+ * @method string getParseMode() Optional. Mode for parsing entities in the animation caption
+ * @method MessageEntity[] getCaptionEntities() Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode
+ * @method bool getShowCaptionAboveMedia() Optional. True, if the caption must be shown above the message media
+ * @method int getWidth() Optional. Animation width
+ * @method int getHeight() Optional. Video height
+ * @method int getDuration() Optional. Animation duration
+ * @method bool getHasSpoiler() Optional. Pass True if the animation needs to be covered with a spoiler animation
*
* @method $this setMedia(string $media) File to send. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass “attach://<file_attach_name>” to upload a new one using multipart/form-data under <file_attach_name> name. More info on Sending Files »
- * @method $this setThumbnail(string $thumbnail) Optional. Thumbnail of the file sent. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail‘s width and height should not exceed 90. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can’t be reused and can be only uploaded as a new file, so you can pass “attach://<file_attach_name>” if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. More info on Sending Files »
+ * @method $this setThumbnail(string $thumbnail) Optional. Thumbnail of the file sent. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail‘s width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can’t be reused and can be only uploaded as a new file, so you can pass “attach://<file_attach_name>” if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. More info on Sending Files »
* @method $this setCaption(string $caption) Optional. Caption of the animation to be sent, 0-200 characters
* @method $this setParseMode(string $parse_mode) Optional. Mode for parsing entities in the animation caption
* @method $this setCaptionEntities(array $caption_entities) Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode
+ * @method $this setShowCaptionAboveMedia(bool $show_caption_above_media) Optional. True, if the caption must be shown above the message media
* @method $this setWidth(int $width) Optional. Animation width
* @method $this setHeight(int $height) Optional. Animation height
* @method $this setDuration(int $duration) Optional. Animation duration
* @method $this setHasSpoiler(bool $has_spoiler) Optional. Pass True if the animation needs to be covered with a spoiler animation
*/
class InputMediaAnimation extends Entity implements InputMedia
{
/**
* InputMediaAnimation constructor
*
* @param array $data
*/
public function __construct(array $data = [])
{
$data['type'] = 'animation';
parent::__construct($data);
}
}
diff --git a/src/Entities/InputMedia/InputMediaAudio.php b/src/Entities/InputMedia/InputMediaAudio.php
index a992095..73c4f40 100644
--- a/src/Entities/InputMedia/InputMediaAudio.php
+++ b/src/Entities/InputMedia/InputMediaAudio.php
@@ -1,64 +1,65 @@
<?php
/**
* This file is part of the TelegramBot package.
*
* (c) Avtandil Kikabidze aka LONGMAN <akalongman@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Longman\TelegramBot\Entities\InputMedia;
use Longman\TelegramBot\Entities\Entity;
+use Longman\TelegramBot\Entities\MessageEntity;
/**
* Class InputMediaAudio
*
* @link https://core.telegram.org/bots/api#inputmediaaudio
*
* <code>
* $data = [
* 'media' => '123abc',
* 'thumbnail' => '456def',
* 'caption' => '*Audio* caption',
* 'parse_mode' => 'markdown',
* 'duration' => 42,
* 'performer' => 'John Doe',
* 'title' => 'The Song',
* ];
* </code>
*
* @method string getType() Type of the result, must be audio
* @method string getMedia() File to send. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass "attach://<file_attach_name>" to upload a new one using multipart/form-data under <file_attach_name> name.
- * @method string getThumbnail() Optional. Thumbnail of the file sent. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail‘s width and height should not exceed 90. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can’t be reused and can be only uploaded as a new file, so you can pass “attach://<file_attach_name>” if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. More info on Sending Files »
+ * @method string getThumbnail() Optional. Thumbnail of the file sent. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail‘s width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can’t be reused and can be only uploaded as a new file, so you can pass “attach://<file_attach_name>” if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. More info on Sending Files »
* @method string getCaption() Optional. Caption of the audio to be sent, 0-200 characters
* @method string getParseMode() Optional. Mode for parsing entities in the audio caption
* @method MessageEntity[] getCaptionEntities() Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode
* @method int getDuration() Optional. Duration of the audio in seconds
* @method string getPerformer() Optional. Performer of the audio
* @method string getTitle() Optional. Title of the audio
*
* @method $this setMedia(string $media) File to send. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass "attach://<file_attach_name>" to upload a new one using multipart/form-data under <file_attach_name> name.
- * @method $this setThumbnail(string $thumbnail) Optional. Thumbnail of the file sent. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail‘s width and height should not exceed 90. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can’t be reused and can be only uploaded as a new file, so you can pass “attach://<file_attach_name>” if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. More info on Sending Files »
+ * @method $this setThumbnail(string $thumbnail) Optional. Thumbnail of the file sent. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail‘s width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can’t be reused and can be only uploaded as a new file, so you can pass “attach://<file_attach_name>” if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. More info on Sending Files »
* @method $this setCaption(string $caption) Optional. Caption of the audio to be sent, 0-200 characters
* @method $this setParseMode(string $parse_mode) Optional. Mode for parsing entities in the audio caption
* @method $this setCaptionEntities(array $caption_entities) Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode
* @method $this setDuration(int $duration) Optional. Duration of the audio in seconds
* @method $this setPerformer(string $performer) Optional. Performer of the audio
* @method $this setTitle(string $title) Optional. Title of the audio
*/
class InputMediaAudio extends Entity implements InputMedia
{
/**
* InputMediaAudio constructor
*
* @param array $data
*/
public function __construct(array $data = [])
{
$data['type'] = 'audio';
parent::__construct($data);
}
}
diff --git a/src/Entities/InputMedia/InputMediaDocument.php b/src/Entities/InputMedia/InputMediaDocument.php
index 138e43e..a80e52f 100644
--- a/src/Entities/InputMedia/InputMediaDocument.php
+++ b/src/Entities/InputMedia/InputMediaDocument.php
@@ -1,57 +1,58 @@
<?php
/**
* This file is part of the TelegramBot package.
*
* (c) Avtandil Kikabidze aka LONGMAN <akalongman@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Longman\TelegramBot\Entities\InputMedia;
use Longman\TelegramBot\Entities\Entity;
+use Longman\TelegramBot\Entities\MessageEntity;
/**
* Class InputMediaDocument
*
* @link https://core.telegram.org/bots/api#inputmediadocument
*
* <code>
* $data = [
* 'media' => '123abc',
* 'thumbnail' => '456def',
* 'caption' => '*Document* caption',
* 'parse_mode' => 'markdown',
* ];
* </code>
*
* @method string getType() Type of the result, must be document
* @method string getMedia() File to send. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass "attach://<file_attach_name>" to upload a new one using multipart/form-data under <file_attach_name> name.
- * @method string getThumbnail() Optional. Thumbnail of the file sent. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail‘s width and height should not exceed 90. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can’t be reused and can be only uploaded as a new file, so you can pass “attach://<file_attach_name>” if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. More info on Sending Files »
+ * @method string getThumbnail() Optional. Thumbnail of the file sent. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail‘s width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can’t be reused and can be only uploaded as a new file, so you can pass “attach://<file_attach_name>” if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. More info on Sending Files »
* @method string getCaption() Optional. Caption of the document to be sent, 0-200 characters
* @method string getParseMode() Optional. Mode for parsing entities in the document caption
* @method MessageEntity[] getCaptionEntities() Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode
* @method bool getDisableContentTypeDetection() Optional. Disables automatic server-side content type detection for files uploaded using multipart/form-data. Always true, if the document is sent as part of an album.
*
* @method $this setMedia(string $media) File to send. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass "attach://<file_attach_name>" to upload a new one using multipart/form-data under <file_attach_name> name.
- * @method $this setThumbnail(string $thumbnail) Optional. Thumbnail of the file sent. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail‘s width and height should not exceed 90. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can’t be reused and can be only uploaded as a new file, so you can pass “attach://<file_attach_name>” if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. More info on Sending Files »
+ * @method $this setThumbnail(string $thumbnail) Optional. Thumbnail of the file sent. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail‘s width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can’t be reused and can be only uploaded as a new file, so you can pass “attach://<file_attach_name>” if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. More info on Sending Files »
* @method $this setCaption(string $caption) Optional. Caption of the document to be sent, 0-200 characters
* @method $this setParseMode(string $parse_mode) Optional. Mode for parsing entities in the document caption
* @method $this setCaptionEntities(array $caption_entities) Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode
* @method $this setDisableContentTypeDetection(bool $disable_content_type_detection) Optional. Disables automatic server-side content type detection for files uploaded using multipart/form-data. Always true, if the document is sent as part of an album.
*/
class InputMediaDocument extends Entity implements InputMedia
{
/**
* InputMediaDocument constructor
*
* @param array $data
*/
public function __construct(array $data = [])
{
$data['type'] = 'document';
parent::__construct($data);
}
}
diff --git a/src/Entities/InputMedia/InputMediaPhoto.php b/src/Entities/InputMedia/InputMediaPhoto.php
index 4a136fc..b96349c 100644
--- a/src/Entities/InputMedia/InputMediaPhoto.php
+++ b/src/Entities/InputMedia/InputMediaPhoto.php
@@ -1,54 +1,57 @@
<?php
/**
* This file is part of the TelegramBot package.
*
* (c) Avtandil Kikabidze aka LONGMAN <akalongman@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Longman\TelegramBot\Entities\InputMedia;
use Longman\TelegramBot\Entities\Entity;
+use Longman\TelegramBot\Entities\MessageEntity;
/**
* Class InputMediaPhoto
*
* @link https://core.telegram.org/bots/api#inputmediaphoto
*
* <code>
* $data = [
* 'media' => '123abc',
* 'caption' => '*Photo* caption',
* 'parse_mode' => 'markdown',
* ];
* </code>
*
- * @method string getType() Type of the result, must be photo
- * @method string getMedia() File to send. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass "attach://<file_attach_name>" to upload a new one using multipart/form-data under <file_attach_name> name.
- * @method string getCaption() Optional. Caption of the photo to be sent, 0-200 characters
- * @method string getParseMode() Optional. Mode for parsing entities in the photo caption
- * @method MessageEntity[] getCaptionEntities() Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode
- * @method bool getHasSpoiler() Optional. Pass True if the photo needs to be covered with a spoiler animation
+ * @method string getType() Type of the result, must be photo
+ * @method string getMedia() File to send. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass "attach://<file_attach_name>" to upload a new one using multipart/form-data under <file_attach_name> name.
+ * @method string getCaption() Optional. Caption of the photo to be sent, 0-200 characters
+ * @method string getParseMode() Optional. Mode for parsing entities in the photo caption
+ * @method MessageEntity[] getCaptionEntities() Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode
+ * @method bool getShowCaptionAboveMedia() Optional. True, if the caption must be shown above the message media
+ * @method bool getHasSpoiler() Optional. Pass True if the photo needs to be covered with a spoiler animation
*
* @method $this setMedia(string $media) File to send. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass "attach://<file_attach_name>" to upload a new one using multipart/form-data under <file_attach_name> name.
* @method $this setCaption(string $caption) Optional. Caption of the photo to be sent, 0-200 characters
* @method $this setParseMode(string $parse_mode) Optional. Mode for parsing entities in the photo caption
* @method $this setCaptionEntities(array $caption_entities) Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode
+ * @method $this setShowCaptionAboveMedia(bool $show_caption_above_media) Optional. True, if the caption must be shown above the message media
* @method $this setHasSpoiler(bool $has_spoiler) Optional. Pass True if the photo needs to be covered with a spoiler animation
*/
class InputMediaPhoto extends Entity implements InputMedia
{
/**
* InputMediaPhoto constructor
*
* @param array $data
*/
public function __construct(array $data = [])
{
$data['type'] = 'photo';
parent::__construct($data);
}
}
diff --git a/src/Entities/InputMedia/InputMediaVideo.php b/src/Entities/InputMedia/InputMediaVideo.php
index 3bc1065..9efecf7 100644
--- a/src/Entities/InputMedia/InputMediaVideo.php
+++ b/src/Entities/InputMedia/InputMediaVideo.php
@@ -1,69 +1,76 @@
<?php
/**
* This file is part of the TelegramBot package.
*
* (c) Avtandil Kikabidze aka LONGMAN <akalongman@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Longman\TelegramBot\Entities\InputMedia;
use Longman\TelegramBot\Entities\Entity;
+use Longman\TelegramBot\Entities\MessageEntity;
/**
* Class InputMediaVideo
*
* @link https://core.telegram.org/bots/api#inputmediavideo
*
* <code>
* $data = [
* 'media' => '123abc',
* 'thumbnail' => '456def',
* 'caption' => '*Video* caption (streamable)',
* 'parse_mode' => 'markdown',
* 'width' => 800,
* 'height' => 600,
* 'duration' => 42,
* 'supports_streaming' => true,
* ];
* </code>
*
- * @method string getType() Type of the result, must be video
- * @method string getMedia() File to send. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass "attach://<file_attach_name>" to upload a new one using multipart/form-data under <file_attach_name> name.
- * @method string getThumbnail() Optional. Thumbnail of the file sent. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail‘s width and height should not exceed 90. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can’t be reused and can be only uploaded as a new file, so you can pass “attach://<file_attach_name>” if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. More info on Sending Files »
- * @method string getCaption() Optional. Caption of the video to be sent, 0-200 characters
- * @method string getParseMode() Optional. Mode for parsing entities in the video caption
- * @method MessageEntity[] getCaptionEntities() Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode
- * @method int getWidth() Optional. Video width
- * @method int getHeight() Optional. Video height
- * @method int getDuration() Optional. Video duration
- * @method bool getSupportsStreaming() Optional. Pass True, if the uploaded video is suitable for streaming
- * @method bool getHasSpoiler() Optional. Pass True if the video needs to be covered with a spoiler animation
+ * @method string getType() Type of the result, must be video
+ * @method string getMedia() File to send. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass "attach://<file_attach_name>" to upload a new one using multipart/form-data under <file_attach_name> name.
+ * @method string getThumbnail() Optional. Thumbnail of the file sent. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail‘s width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can’t be reused and can be only uploaded as a new file, so you can pass “attach://<file_attach_name>” if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. More info on Sending Files »
+ * @method string getCaption() Optional. Caption of the video to be sent, 0-200 characters
+ * @method string getParseMode() Optional. Mode for parsing entities in the video caption
+ * @method MessageEntity[] getCaptionEntities() Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode
+ * @method bool getShowCaptionAboveMedia() Optional. True, if the caption must be shown above the message media
+ * @method int getWidth() Optional. Video width
+ * @method int getHeight() Optional. Video height
+ * @method int getDuration() Optional. Video duration
+ * @method bool getSupportsStreaming() Optional. Pass True, if the uploaded video is suitable for streaming
+ * @method bool getHasSpoiler() Optional. Pass True if the video needs to be covered with a spoiler animation
+ * @method string getCover() Optional. Cover for the video in the message. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass "attach://<file_attach_name>" to upload a new one using multipart/form-data under <file_attach_name> name.
+ * @method int getStartTimestamp() Optional. Timestamp in seconds from which the video will play in the message
*
* @method $this setMedia(string $media) File to send. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass "attach://<file_attach_name>" to upload a new one using multipart/form-data under <file_attach_name> name.
- * @method $this setThumbnail(string $thumbnail) Optional. Thumbnail of the file sent. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail‘s width and height should not exceed 90. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can’t be reused and can be only uploaded as a new file, so you can pass “attach://<file_attach_name>” if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. More info on Sending Files »
+ * @method $this setThumbnail(string $thumbnail) Optional. Thumbnail of the file sent. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail‘s width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can’t be reused and can be only uploaded as a new file, so you can pass “attach://<file_attach_name>” if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. More info on Sending Files »
* @method $this setCaption(string $caption) Optional. Caption of the video to be sent, 0-200 characters
* @method $this setParseMode(string $parse_mode) Optional. Mode for parsing entities in the video caption
* @method $this setCaptionEntities(array $caption_entities) Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode
+ * @method $this setShowCaptionAboveMedia(bool $show_caption_above_media) Optional. True, if the caption must be shown above the message media
* @method $this setWidth(int $width) Optional. Video width
* @method $this setHeight(int $height) Optional. Video height
* @method $this setDuration(int $duration) Optional. Video duration
* @method $this setSupportsStreaming(bool $supports_streaming) Optional. Pass True, if the uploaded video is suitable for streaming
* @method $this setHasSpoiler(bool $has_spoiler) Optional. Pass True if the video needs to be covered with a spoiler animation
+ * @method $this setCover(string $cover) Optional. Cover for the video in the message. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass "attach://<file_attach_name>" to upload a new one using multipart/form-data under <file_attach_name> name.
+ * @method $this setStartTimestamp(int $start_timestamp) Optional. Timestamp in seconds from which the video will play in the message
*/
class InputMediaVideo extends Entity implements InputMedia
{
/**
* InputMediaVideo constructor
*
* @param array $data
*/
public function __construct(array $data = [])
{
$data['type'] = 'video';
parent::__construct($data);
}
}
diff --git a/src/Entities/InputSticker.php b/src/Entities/InputSticker.php
index 2fa40e0..3c23e1a 100644
--- a/src/Entities/InputSticker.php
+++ b/src/Entities/InputSticker.php
@@ -1,20 +1,21 @@
<?php
namespace Longman\TelegramBot\Entities;
/**
* Class InputSticker
*
* This entity describes a sticker to be added to a sticker set.
*
* @link https://core.telegram.org/bots/api#inputsticker
*
* @method string getSticker() The added sticker. Pass a file_id as a String to send a file that already exists on the Telegram servers, pass an HTTP URL as a String for Telegram to get a file from the Internet, upload a new one using multipart/form-data, or pass “attach://<file_attach_name>” to upload a new one using multipart/form-data under <file_attach_name> name. Animated and video stickers can't be uploaded via HTTP URL. More information on Sending Files »
* @method string[] getEmojiList() List of 1-20 emoji associated with the sticker
* @method MaskPosition getMaskPosition() Optional. Position where the mask should be placed on faces. For “mask” stickers only.
* @method string[] getKeywords() Optional. List of 0-20 search keywords for the sticker with total length of up to 64 characters. For “regular” and “custom_emoji” stickers only.
+ * @method string getFormat() Format of the sticker, must be one of “static”, “animated”, “video”
*/
class InputSticker extends Entity
{
}
diff --git a/src/Entities/KeyboardButton.php b/src/Entities/KeyboardButton.php
index 25cc7f0..d3bb7f9 100644
--- a/src/Entities/KeyboardButton.php
+++ b/src/Entities/KeyboardButton.php
@@ -1,91 +1,98 @@
<?php
/**
* This file is part of the TelegramBot package.
*
* (c) Avtandil Kikabidze aka LONGMAN <akalongman@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Longman\TelegramBot\Entities;
/**
* Class KeyboardButton
*
* This object represents one button of the reply keyboard. For simple text buttons String can be used instead of this object to specify text of the button. Optional fields request_contact, request_location, and request_poll are mutually exclusive.
*
* @link https://core.telegram.org/bots/api#keyboardbutton
*
* @property KeyboardButtonRequestUsers $request_users
* @property KeyboardButtonRequestChat $request_chat
+ * @property KeyboardButtonRequestManagedBot $request_managed_bot
* @property bool $request_contact
* @property bool $request_location
* @property KeyboardButtonPollType $request_poll
* @property WebAppInfo $web_app
*
* @method string getText() Text of the button. If none of the optional fields are used, it will be sent to the bot as a message when the button is pressed
* @method KeyboardButtonRequestUsers getRequestUsers() Optional. If specified, pressing the button will open a list of suitable users. Identifiers of selected users will be sent to the bot in a “users_shared” service message. Available in private chats only.
* @method KeyboardButtonRequestChat getRequestChat() Optional. If specified, pressing the button will open a list of suitable chats. Tapping on a chat will send its identifier to the bot in a “chat_shared” service message. Available in private chats only.
* @method bool getRequestContact() Optional. If True, the user's phone number will be sent as a contact when the button is pressed. Available in private chats only
* @method bool getRequestLocation() Optional. If True, the user's current location will be sent when the button is pressed. Available in private chats only
* @method KeyboardButtonPollType getRequestPoll() Optional. If specified, the user will be asked to create a poll and send it to the bot when the button is pressed. Available in private chats only
* @method WebAppInfo getWebApp() Optional. If specified, the described Web App will be launched when the button is pressed. The Web App will be able to send a “web_app_data” service message. Available in private chats only.
+ * @method string getStyle() Optional. Style of the button. Must be one of “danger” (red), “success” (green) or “primary” (blue). If omitted, then an app-specific style is used.
+ * @method string getIconCustomEmojiId() Optional. Unique identifier of the custom emoji shown as the button icon.
*
* @method $this setText(string $text) Text of the button. If none of the optional fields are used, it will be sent to the bot as a message when the button is pressed
* @method $this setRequestUsers(KeyboardButtonRequestUsers $request_users) Optional. If specified, pressing the button will open a list of suitable users. Identifiers of selected users will be sent to the bot in a “users_shared” service message. Available in private chats only.
* @method $this setRequestChat(KeyboardButtonRequestChat $request_chat) Optional. If specified, pressing the button will open a list of suitable chats. Tapping on a chat will send its identifier to the bot in a “chat_shared” service message. Available in private chats only.
+ * @method $this setRequestManagedBot(KeyboardButtonRequestManagedBot $request_managed_bot) Optional. If specified, pressing the button will prompt the user to create and send a managed bot to the given bot.
* @method $this setRequestContact(bool $request_contact) Optional. If True, the user's phone number will be sent as a contact when the button is pressed. Available in private chats only
* @method $this setRequestLocation(bool $request_location) Optional. If True, the user's current location will be sent when the button is pressed. Available in private chats only
* @method $this setRequestPoll(KeyboardButtonPollType $request_poll) Optional. If specified, the user will be asked to create a poll and send it to the bot when the button is pressed. Available in private chats only
* @method $this setWebApp(WebAppInfo $web_app) Optional. If specified, the described Web App will be launched when the button is pressed. The Web App will be able to send a “web_app_data” service message. Available in private chats only.
+ * @method $this setStyle(string $style) Optional. Style of the button. Must be one of “danger” (red), “success” (green) or “primary” (blue). If omitted, then an app-specific style is used.
+ * @method $this setIconCustomEmojiId(string $icon_custom_emoji_id) Optional. Unique identifier of the custom emoji shown as the button icon.
*/
class KeyboardButton extends Entity
{
/**
* @param array|string $data
*/
public function __construct($data)
{
if (is_string($data)) {
$data = ['text' => $data];
}
parent::__construct($data);
}
protected function subEntities(): array
{
return [
'request_users' => KeyboardButtonRequestUsers::class,
'request_chat' => KeyboardButtonRequestChat::class,
+ 'request_managed_bot' => KeyboardButtonRequestManagedBot::class,
'request_poll' => KeyboardButtonPollType::class,
'web_app' => WebAppInfo::class,
];
}
/**
* Check if the passed data array could be a KeyboardButton.
*
* @param array $data
*
* @return bool
*/
public static function couldBe(array $data): bool
{
return array_key_exists('text', $data);
}
/**
* {@inheritdoc}
*/
public function __call($method, $args)
{
// Only 1 of these can be set, so clear the others when setting a new one.
- if (in_array($method, ['setRequestUsers', 'setRequestChat', 'setRequestContact', 'setRequestLocation', 'setRequestPoll', 'setWebApp'], true)) {
- unset($this->request_users, $this->request_chat, $this->request_contact, $this->request_location, $this->request_poll, $this->web_app);
+ if (in_array($method, ['setRequestUsers', 'setRequestChat', 'setRequestManagedBot', 'setRequestContact', 'setRequestLocation', 'setRequestPoll', 'setWebApp'], true)) {
+ unset($this->request_users, $this->request_chat, $this->request_managed_bot, $this->request_contact, $this->request_location, $this->request_poll, $this->web_app);
}
return parent::__call($method, $args);
}
}
diff --git a/src/Entities/KeyboardButtonRequestChat.php b/src/Entities/KeyboardButtonRequestChat.php
index 02cdf29..28362bc 100644
--- a/src/Entities/KeyboardButtonRequestChat.php
+++ b/src/Entities/KeyboardButtonRequestChat.php
@@ -1,33 +1,39 @@
<?php
namespace Longman\TelegramBot\Entities;
/**
* Class KeyboardButtonRequestChat
*
* This entity defines the criteria used to request a suitable chat. The identifier of the selected chat will be shared with the bot when the corresponding button is pressed.
*
* @link https://core.telegram.org/bots/api#keyboardbuttonrequestchat
*
* @method int getRequestId() Signed 32-bit identifier of the request, which will be received back in the ChatShared object. Must be unique within the message
* @method bool getChatIsChannel() Pass True to request a channel chat, pass False to request a group or a supergroup chat.
* @method bool getChatIsForum() Optional. Pass True to request a forum supergroup, pass False to request a non-forum chat. If not specified, no additional restrictions are applied.
* @method bool getChatHasUsername() Optional. Pass True to request a supergroup or a channel with a username, pass False to request a chat without a username. If not specified, no additional restrictions are applied.
* @method bool getChatIsCreated() Optional. Pass True to request a chat owned by the user. Otherwise, no additional restrictions are applied.
* @method ChatAdministratorRights getUserAdministratorRights() Optional. A JSON-serialized object listing the required administrator rights of the user in the chat. The rights must be a superset of bot_administrator_rights. If not specified, no additional restrictions are applied.
* @method ChatAdministratorRights getBotAdministratorRights() Optional. A JSON-serialized object listing the required administrator rights of the bot in the chat. The rights must be a subset of user_administrator_rights. If not specified, no additional restrictions are applied.
* @method bool getBotIsMember() Optional. Pass True to request a chat with the bot as a member. Otherwise, no additional restrictions are applied.
+ * @method bool getRequestTitle() Optional. Pass True to request the chat's title
+ * @method bool getRequestUsername() Optional. Pass True to request the chat's username
+ * @method bool getRequestPhoto() Optional. Pass True to request the chat's photo
*
* @method $this setRequestId(int $request_id) Signed 32-bit identifier of the request, which will be received back in the ChatShared object. Must be unique within the message
* @method $this setChatIsChannel(bool $chat_is_channel) Pass True to request a channel chat, pass False to request a group or a supergroup chat.
* @method $this setChatIsForum(bool $chat_is_forum) Optional. Pass True to request a forum supergroup, pass False to request a non-forum chat. If not specified, no additional restrictions are applied.
* @method $this setChatHasUsername(bool $chat_has_username) Optional. Pass True to request a supergroup or a channel with a username, pass False to request a chat without a username. If not specified, no additional restrictions are applied.
* @method $this setChatIsCreated(bool $chat_is_created) Optional. Pass True to request a chat owned by the user. Otherwise, no additional restrictions are applied.
* @method $this setUserAdministratorRights(ChatAdministratorRights $user_administrator_rights) Optional. A JSON-serialized object listing the required administrator rights of the user in the chat. The rights must be a superset of bot_administrator_rights. If not specified, no additional restrictions are applied.
* @method $this setBotAdministratorRights(ChatAdministratorRights $bot_administrator_rights) Optional. A JSON-serialized object listing the required administrator rights of the bot in the chat. The rights must be a subset of user_administrator_rights. If not specified, no additional restrictions are applied.
* @method $this setBotIsMember(bool $bot_is_member) Optional. Pass True to request a chat with the bot as a member. Otherwise, no additional restrictions are applied.
+ * @method $this setRequestTitle(bool $request_title) Optional. Pass True to request the chat's title
+ * @method $this setRequestUsername(bool $request_username) Optional. Pass True to request the chat's username
+ * @method $this setRequestPhoto(bool $request_photo) Optional. Pass True to request the chat's photo
*/
class KeyboardButtonRequestChat extends Entity
{
}
diff --git a/src/Entities/KeyboardButtonRequestUsers.php b/src/Entities/KeyboardButtonRequestUsers.php
index 945bafa..4347710 100644
--- a/src/Entities/KeyboardButtonRequestUsers.php
+++ b/src/Entities/KeyboardButtonRequestUsers.php
@@ -1,23 +1,29 @@
<?php
namespace Longman\TelegramBot\Entities;
/**
* This object defines the criteria used to request suitable users. The identifiers of the selected users will be shared with the bot when the corresponding button is pressed.
*
* @link https://core.telegram.org/bots/api#keyboardbuttonrequestusers
*
- * @method int getRequestId() Signed 32-bit identifier of the request, which will be received back in the UserShared object. Must be unique within the message
- * @method bool getUserIsBot() Optional. Pass True to request a bot, pass False to request a regular user. If not specified, no additional restrictions are applied.
- * @method bool getUserIsPremium() Optional. Pass True to request a premium user, pass False to request a non-premium user. If not specified, no additional restrictions are applied.
- * @method int getMaxQuantity() Optional. The maximum number of users to be selected; 1-10. Defaults to 1.
+ * @method int getRequestId() Signed 32-bit identifier of the request, which will be received back in the UserShared object. Must be unique within the message
+ * @method bool getUserIsBot() Optional. Pass True to request a bot, pass False to request a regular user. If not specified, no additional restrictions are applied.
+ * @method bool getUserIsPremium() Optional. Pass True to request a premium user, pass False to request a non-premium user. If not specified, no additional restrictions are applied.
+ * @method int getMaxQuantity() Optional. The maximum number of users to be selected; 1-10. Defaults to 1.
+ * @method bool getRequestName() Optional. Pass True to request the users' first and last names
+ * @method bool getRequestUsername() Optional. Pass True to request the users' usernames
+ * @method bool getRequestPhoto() Optional. Pass True to request the users' photos
*
- * @method $this setRequestId(int $request_id) Signed 32-bit identifier of the request, which will be received back in the UserShared object. Must be unique within the message
- * @method $this setUserIsBot(bool $user_is_bot) Optional. Pass True to request a bot, pass False to request a regular user. If not specified, no additional restrictions are applied.
- * @method $this setUserIsPremium(bool $user_is_premium) Optional. Pass True to request a premium user, pass False to request a non-premium user. If not specified, no additional restrictions are applied.
- * @method int setMaxQuantity(int $set_max_quantity) Optional. The maximum number of users to be selected; 1-10. Defaults to 1.
+ * @method $this setRequestId(int $request_id) Signed 32-bit identifier of the request, which will be received back in the UserShared object. Must be unique within the message
+ * @method $this setUserIsBot(bool $user_is_bot) Optional. Pass True to request a bot, pass False to request a regular user. If not specified, no additional restrictions are applied.
+ * @method $this setUserIsPremium(bool $user_is_premium) Optional. Pass True to request a premium user, pass False to request a non-premium user. If not specified, no additional restrictions are applied.
+ * @method $this setMaxQuantity(int $set_max_quantity) Optional. The maximum number of users to be selected; 1-10. Defaults to 1.
+ * @method $this setRequestName(bool $request_name) Optional. Pass True to request the users' first and last names
+ * @method $this setRequestUsername(bool $request_username) Optional. Pass True to request the users' usernames
+ * @method $this setRequestPhoto(bool $request_photo) Optional. Pass True to request the users' photos
*/
class KeyboardButtonRequestUsers extends Entity
{
}
diff --git a/src/Entities/LinkPreviewOptions.php b/src/Entities/LinkPreviewOptions.php
index 7838e86..6644633 100644
--- a/src/Entities/LinkPreviewOptions.php
+++ b/src/Entities/LinkPreviewOptions.php
@@ -1,28 +1,28 @@
<?php
/**
* This file is part of the TelegramBot package.
*
* (c) Avtandil Kikabidze aka LONGMAN <akalongman@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Longman\TelegramBot\Entities;
/**
* Describes the options used for link preview generation.
*
* @link https://core.telegram.org/bots/api#linkpreviewoptions
*
* @method bool getIsDisabled() Optional. True, if the link preview is disabled
* @method string getUrl() Optional. URL to use for the link preview. If empty, then the first URL found in the message text will be used
* @method bool getPreferSmallMedia() Optional. True, if the media in the link preview is supposed to be shrunk; ignored if the URL isn't explicitly specified or media size change isn't supported for the preview
* @method bool getPreferLargeMedia() Optional. True, if the media in the link preview is supposed to be enlarged; ignored if the URL isn't explicitly specified or media size change isn't supported for the preview
- * @method bool getShowAboveText() Optional. True, if the link preview must be shown above the message text; otherwise, the link preview will be shown below the message text *
+ * @method bool getShowAboveText() Optional. True, if the link preview must be shown above the message text; otherwise, the link preview will be shown below the message text
*/
class LinkPreviewOptions extends Entity
{
}
diff --git a/src/Entities/Message.php b/src/Entities/Message.php
index f8baa98..ced0bb5 100644
--- a/src/Entities/Message.php
+++ b/src/Entities/Message.php
@@ -1,343 +1,411 @@
<?php
/**
* This file is part of the TelegramBot package.
*
* (c) Avtandil Kikabidze aka LONGMAN <akalongman@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Longman\TelegramBot\Entities;
use Longman\TelegramBot\Entities\Games\Game;
use Longman\TelegramBot\Entities\Giveaway\Giveaway;
use Longman\TelegramBot\Entities\Giveaway\GiveawayCompleted;
use Longman\TelegramBot\Entities\Giveaway\GiveawayCreated;
use Longman\TelegramBot\Entities\Giveaway\GiveawayWinners;
use Longman\TelegramBot\Entities\Message\Factory as MaybeInaccessibleMessageFactory;
use Longman\TelegramBot\Entities\Message\MaybeInaccessibleMessage;
use Longman\TelegramBot\Entities\MessageOrigin\Factory as MessageOriginFactory;
use Longman\TelegramBot\Entities\MessageOrigin\MessageOrigin;
use Longman\TelegramBot\Entities\Payments\Invoice;
use Longman\TelegramBot\Entities\Payments\SuccessfulPayment;
use Longman\TelegramBot\Entities\TelegramPassport\PassportData;
use Longman\TelegramBot\Entities\Topics\ForumTopicClosed;
use Longman\TelegramBot\Entities\Topics\ForumTopicCreated;
use Longman\TelegramBot\Entities\Topics\ForumTopicEdited;
use Longman\TelegramBot\Entities\Topics\ForumTopicReopened;
use Longman\TelegramBot\Entities\Topics\GeneralForumTopicHidden;
use Longman\TelegramBot\Entities\Topics\GeneralForumTopicUnhidden;
/**
* Class Message
*
* Represents a message
*
* @link https://core.telegram.org/bots/api#message
*
* @method int getMessageId() Unique message identifier
- * @method int getMessageThreadId() Optional. Unique identifier of a message thread to which the message belongs; for supergroups only
+ * @method int getMessageThreadId() Optional. Unique identifier of a message thread to which the message belongs; for supergroups and private chats with topic mode enabled only
+ * @method DirectMessagesTopic getDirectMessagesTopic() Optional. Information about the direct messages chat topic that contains the message
* @method User getFrom() Optional. Sender, can be empty for messages sent to channels
* @method Chat getSenderChat() Optional. Sender of the message, sent on behalf of a chat. The channel itself for channel messages. The supergroup itself for messages from anonymous group administrators. The linked channel for messages automatically forwarded to the discussion group
* @method int getSenderBoostCount() Optional. If the sender of the message boosted the chat, the number of boosts added by the user
+ * @method string getSenderTag() Optional. Tag or custom title of the sender of the message; for supergroups only
* @method int getDate() Date the message was sent in Unix time
* @method Chat getChat() Conversation the message belongs to
* @method MessageOrigin getForwardOrigin() Optional. Information about the original message for forwarded messages
- * @method bool getIsTopicMessage() Optional. True, if the message is sent to a forum topic
+ * @method bool getIsTopicMessage() Optional. True, if the message is sent to a forum topic or a private chat with topic mode enabled
+ * @method GiftInfo getGiftUpgradeSent() Optional. Service message: upgrade of a gift was purchased after the gift was sent
* @method bool getIsAutomaticForward() Optional. True, if the message is a channel post that was automatically forwarded to the connected discussion group
* @method ReplyToMessage getReplyToMessage() Optional. For replies, the original message. Note that the Message object in this field will not contain further reply_to_message fields even if it itself is a reply.
* @method ExternalReplyInfo getExternalReply() Optional. Information about the message that is being replied to, which may come from another chat or forum topic
* @method TextQuote getQuote() Optional. For replies that quote part of the original message, the quoted part of the message
* @method Story getReplyToStory() Optional. For replies to a story, the original story
+ * @method int getReplyToChecklistTaskId() Optional. Identifier of the specific checklist task that is being replied to
* @method User getViaBot() Optional. Bot through which the message was sent
* @method int getEditDate() Optional. Date the message was last edited in Unix time
* @method bool getHasProtectedContent() Optional. True, if the message can't be forwarded
+ * @method SuggestedPostInfo getSuggestedPostInfo() Optional. Information about suggested post parameters if the message is a suggested post in a channel direct messages chat. If the message is an approved or declined suggested post, then it can't be edited.
* @method string getMediaGroupId() Optional. The unique identifier of a media message group this message belongs to
* @method string getAuthorSignature() Optional. Signature of the post author for messages in channels
* @method LinkPreviewOptions getLinkPreviewOptions() Optional. Options used for link preview generation for the message, if it is a text message and link preview options were changed
* @method MessageEntity[] getEntities() Optional. For text messages, special entities like usernames, URLs, bot commands, etc. that appear in the text
* @method MessageEntity[] getCaptionEntities() Optional. For messages with a caption, special entities like usernames, URLs, bot commands, etc. that appear in the caption
* @method Audio getAudio() Optional. Message is an audio file, information about the file
* @method Document getDocument() Optional. Message is a general file, information about the file
* @method Animation getAnimation() Optional. Message is an animation, information about the animation. For backward compatibility, when this field is set, the document field will also be set
* @method Game getGame() Optional. Message is a game, information about the game.
* @method PhotoSize[] getPhoto() Optional. Message is a photo, available sizes of the photo
* @method Sticker getSticker() Optional. Message is a sticker, information about the sticker
* @method Story getStory() Optional. Message is a forwarded story
* @method Video getVideo() Optional. Message is a video, information about the video
* @method Voice getVoice() Optional. Message is a voice message, information about the file
* @method VideoNote getVideoNote() Optional. Message is a video note message, information about the video
* @method string getCaption() Optional. Caption for the document, photo or video, 0-200 characters
* @method bool getHasMediaSpoiler() Optional. True, if the message media is covered by a spoiler animation
+ * @method bool getShowCaptionAboveMedia() Optional. True, if the caption must be shown above the message media
+ * @method Checklist getChecklist() Optional. Message is a checklist
* @method Contact getContact() Optional. Message is a shared contact, information about the contact
* @method Location getLocation() Optional. Message is a shared location, information about the location
* @method Venue getVenue() Optional. Message is a venue, information about the venue
* @method Poll getPoll() Optional. Message is a native poll, information about the poll
* @method Dice getDice() Optional. Message is a dice with random value, 1-6 for “🎲” and “🎯” base emoji, 1-5 for “🏀” and “⚽” base emoji, 1-64 for “🎰” base emoji
* @method User[] getNewChatMembers() Optional. A new member(s) was added to the group, information about them (one of this members may be the bot itself)
* @method User getLeftChatMember() Optional. A member was removed from the group, information about them (this member may be the bot itself)
* @method string getNewChatTitle() Optional. A chat title was changed to this value
* @method PhotoSize[] getNewChatPhoto() Optional. A chat photo was changed to this value
* @method MessageAutoDeleteTimerChanged getMessageAutoDeleteTimerChanged() Optional. Service message: auto-delete timer settings changed in the chat
* @method bool getDeleteChatPhoto() Optional. Service message: the chat photo was deleted
* @method bool getGroupChatCreated() Optional. Service message: the group has been created
* @method bool getSupergroupChatCreated() Optional. Service message: the supergroup has been created. This field can't be received in a message coming through updates, because bot can’t be a member of a supergroup when it is created. It can only be found in reply_to_message if someone replies to a very first message in a directly created supergroup.
* @method bool getChannelChatCreated() Optional. Service message: the channel has been created. This field can't be received in a message coming through updates, because bot can’t be a member of a channel when it is created. It can only be found in reply_to_message if someone replies to a very first message in a channel.
* @method int getMigrateToChatId() Optional. The group has been migrated to a supergroup with the specified identifier. This number may be greater than 32 bits and some programming languages may have difficulty/silent defects in interpreting it. But it smaller than 52 bits, so a signed 64 bit integer or double-precision float type are safe for storing this identifier.
* @method int getMigrateFromChatId() Optional. The supergroup has been migrated from a group with the specified identifier. This number may be greater than 32 bits and some programming languages may have difficulty/silent defects in interpreting it. But it smaller than 52 bits, so a signed 64 bit integer or double-precision float type are safe for storing this identifier.
* @method MaybeInaccessibleMessage getPinnedMessage() Optional. Specified message was pinned. Note that the Message object in this field will not contain further reply_to_message fields even if it is itself a reply.
* @method Invoice getInvoice() Optional. Message is an invoice for a payment, information about the invoice.
* @method SuccessfulPayment getSuccessfulPayment() Optional. Message is a service message about a successful payment, information about the payment.
* @method UsersShared getUsersShared() Optional. Service message: users were shared with the bot
* @method ChatShared getChatShared() Optional. Service message: a chat was shared with the bot
* @method string getConnectedWebsite() Optional. The domain name of the website on which the user has logged in.
* @method WriteAccessAllowed getWriteAccessAllowed() Optional. Service message: the user allowed the bot added to the attachment menu to write messages
* @method PassportData getPassportData() Optional. Telegram Passport data
* @method ProximityAlertTriggered getProximityAlertTriggered() Optional. Service message. A user in the chat triggered another user's proximity alert while sharing Live Location.
* @method ChatBoostAdded getBoostAdded() Optional. Service message: user boosted the chat
* @method ForumTopicCreated getForumTopicCreated() Optional. Service message: forum topic created
* @method ForumTopicEdited getForumTopicEdited() Optional. Service message: forum topic edited
* @method ForumTopicClosed getForumTopicClosed() Optional. Service message: forum topic closed
* @method ForumTopicReopened getForumTopicReopened() Optional. Service message: forum topic reopened
* @method GeneralForumTopicHidden getGeneralForumTopicHidden() Optional. Service message: the 'General' forum topic hidden
* @method GeneralForumTopicUnhidden getGeneralForumTopicUnhidden() Optional. Service message: the 'General' forum topic unhidden
* @method GiveawayCreated getGiveawayCreated() Optional. Service message: a scheduled giveaway was created
* @method Giveaway getGiveaway() Optional. The message is a scheduled giveaway message
* @method GiveawayWinners getGiveawayWinners() Optional. A giveaway with public winners was completed
* @method GiveawayCompleted getGiveawayCompleted() Optional. Service message: a giveaway without public winners was completed
* @method VideoChatScheduled getVideoChatScheduled() Optional. Service message: voice chat scheduled
* @method VideoChatStarted getVideoChatStarted() Optional. Service message: voice chat started
* @method VideoChatEnded getVideoChatEnded() Optional. Service message: voice chat ended
* @method VideoChatParticipantsInvited getVideoChatParticipantsInvited() Optional. Service message: new participants invited to a voice chat
* @method WebAppData getWebAppData() Optional. Service message: data sent by a Web App
+ * @method RichMessage getRichMessage() Optional. Rich formatted message.
* @method InlineKeyboard getReplyMarkup() Optional. Inline keyboard attached to the message. login_url buttons are represented as ordinary url buttons.
+ * @method string getBusinessConnectionId() Optional. Unique identifier of the business connection from which the message was received. If non-empty, the message is business_message.
+ * @method User getSenderBusinessBot() Optional. The bot that actually sent the message on behalf of the business account. Available only for outgoing messages sent on behalf of the business account.
+ * @method bool getIsFromOffline() Optional. True, if the message was sent by an offline user. Applicable to messages sent by the bot on behalf of a user to a fellow user in a private chat.
+ * @method ChatBackground getChatBackgroundSet() Optional. Service message: chat background set
+ * @method ChecklistTasksDone getChecklistTasksDone() Optional. Service message: some tasks in a checklist were marked as done or not done
+ * @method ChecklistTasksAdded getChecklistTasksAdded() Optional. Service message: tasks were added to a checklist
+ * @method DirectMessagePriceChanged getDirectMessagePriceChanged() Optional. Service message: the price for paid messages in the corresponding direct messages chat of a channel has changed
+ * @method string getMessageEffectId() Optional. Unique identifier of the message effect added to the message
+ * @method ChatOwnerLeft getChatOwnerLeft() Optional. Service message: the chat owner left the chat
+ * @method ChatOwnerChanged getChatOwnerChanged() Optional. Service message: the chat owner was changed
+ * @method bool getIsPaidPost() Optional. True, if the message is a paid post
+ * @method PaidMediaInfo getPaidMedia() Optional. Message contains paid media; information about the paid media
+ * @method StarTransaction getTransaction() Optional. Message is a service message about a successful payment for Telegram Stars, information about the transaction.
+ * @method WebAppInfo getWebApp() Optional. Service message: a Web App was launched for the user
+ * @method GiftInfo getGift() Optional. Service message: a regular gift was sent or received
+ * @method UniqueGiftInfo getUniqueGift() Optional. Service message: a unique gift was sent or received
+ * @method PaidMessagePriceChanged getPaidMessagePriceChanged() Optional. Service message: the price for paid messages has changed in the chat
+ * @method SuggestedPostApproved getSuggestedPostApproved() Optional. Service message: a suggested post was approved
+ * @method SuggestedPostApprovalFailed getSuggestedPostApprovalFailed() Optional. Service message: approval of a suggested post has failed
+ * @method SuggestedPostDeclined getSuggestedPostDeclined() Optional. Service message: a suggested post was declined
+ * @method SuggestedPostPaid getSuggestedPostPaid() Optional. Service message: payment for a suggested post was received
+ * @method SuggestedPostRefunded getSuggestedPostRefunded() Optional. Service message: payment for a suggested post was refunded
+ * @method ManagedBotCreated getManagedBotCreated() Optional. Message is a service message about a created managed bot
+ * @method PollOptionAdded getPollOptionAdded() Optional. Message is a service message about a poll option added
+ * @method PollOptionDeleted getPollOptionDeleted() Optional. Message is a service message about a poll option deleted
+ * @method int getReplyToPollOptionId() Optional. Identifier of the poll option to which the message is replied
+ * @method int getPaidStarCount() Optional. The number of Telegram Stars that were paid by the sender of the message to send it
*/
class Message extends Entity implements MaybeInaccessibleMessage
{
/**
* {@inheritdoc}
*/
protected function subEntities(): array
{
return [
+ 'direct_messages_topic' => DirectMessagesTopic::class,
'from' => User::class,
'sender_chat' => Chat::class,
'chat' => Chat::class,
'forward_origin' => MessageOriginFactory::class,
'reply_to_message' => ReplyToMessage::class,
'external_reply' => ExternalReplyInfo::class,
'quote' => TextQuote::class,
'reply_to_story' => Story::class,
'via_bot' => User::class,
'link_preview_options' => LinkPreviewOptions::class,
'entities' => [MessageEntity::class],
'animation' => Animation::class,
'audio' => Audio::class,
'document' => Document::class,
'photo' => [PhotoSize::class],
'sticker' => Sticker::class,
'story' => Story::class,
'video' => Video::class,
'video_note' => VideoNote::class,
'voice' => Voice::class,
'caption_entities' => [MessageEntity::class],
'contact' => Contact::class,
'dice' => Dice::class,
'game' => Game::class,
'poll' => Poll::class,
'venue' => Venue::class,
+
+ 'guest_bot_caller_user' => User::class,
+ 'guest_bot_caller_chat' => Chat::class,
+
+ 'live_photo' => LivePhoto::class,
'location' => Location::class,
'new_chat_members' => [User::class],
'left_chat_member' => User::class,
'new_chat_photo' => [PhotoSize::class],
'message_auto_delete_timer_changed' => MessageAutoDeleteTimerChanged::class,
'pinned_message' => MaybeInaccessibleMessageFactory::class,
'invoice' => Invoice::class,
'successful_payment' => SuccessfulPayment::class,
'users_shared' => UsersShared::class,
'chat_shared' => ChatShared::class,
'write_access_allowed' => WriteAccessAllowed::class,
'passport_data' => PassportData::class,
'proximity_alert_triggered' => ProximityAlertTriggered::class,
'boost_added' => ChatBoostAdded::class,
'forum_topic_created' => ForumTopicCreated::class,
'forum_topic_edited' => ForumTopicEdited::class,
'forum_topic_closed' => ForumTopicClosed::class,
'forum_topic_reopened' => ForumTopicReopened::class,
'general_forum_topic_hidden' => GeneralForumTopicHidden::class,
'general_forum_topic_unhidden' => GeneralForumTopicUnhidden::class,
'giveaway_created' => GiveawayCreated::class,
'giveaway' => Giveaway::class,
'giveaway_winners' => GiveawayWinners::class,
'giveaway_completed' => GiveawayCompleted::class,
'video_chat_scheduled' => VideoChatScheduled::class,
'video_chat_started' => VideoChatStarted::class,
'video_chat_ended' => VideoChatEnded::class,
'video_chat_participants_invited' => VideoChatParticipantsInvited::class,
'web_app_data' => WebAppData::class,
+ 'rich_message' => RichMessage::class,
'reply_markup' => InlineKeyboard::class,
+ 'chat_background_set' => ChatBackground::class,
+ 'checklist' => Checklist::class,
+ 'checklist_tasks_done' => ChecklistTasksDone::class,
+ 'checklist_tasks_added' => ChecklistTasksAdded::class,
+ 'direct_message_price_changed' => DirectMessagePriceChanged::class,
+ 'paid_media' => PaidMediaInfo::class,
+ 'transaction' => StarTransaction::class,
+ 'web_app' => WebAppInfo::class,
+ 'gift' => GiftInfo::class,
+ 'unique_gift' => UniqueGiftInfo::class,
+ 'suggested_post_info' => SuggestedPostInfo::class,
+ 'gift_upgrade_sent' => GiftInfo::class,
+ 'paid_message_price_changed' => PaidMessagePriceChanged::class,
+ 'suggested_post_approved' => SuggestedPostApproved::class,
+ 'suggested_post_approval_failed' => SuggestedPostApprovalFailed::class,
+ 'suggested_post_declined' => SuggestedPostDeclined::class,
+ 'suggested_post_paid' => SuggestedPostPaid::class,
+ 'suggested_post_refunded' => SuggestedPostRefunded::class,
+ 'managed_bot_created' => ManagedBotCreated::class,
+ 'poll_option_added' => PollOptionAdded::class,
+ 'poll_option_deleted' => PollOptionDeleted::class,
+ 'chat_owner_left' => ChatOwnerLeft::class,
+ 'chat_owner_changed' => ChatOwnerChanged::class,
];
}
/**
* return the entire command like /echo or /echo@bot1 if specified
*
* @return string|null
*/
public function getFullCommand(): ?string
{
$text = $this->getProperty('text') ?? '';
if (strpos($text, '/') !== 0) {
return null;
}
$no_EOL = strtok($text, PHP_EOL);
$no_space = strtok($text, ' ');
//try to understand which separator \n or space divide /command from text
return strlen($no_space) < strlen($no_EOL) ? $no_space : $no_EOL;
}
/**
* Get command
*
* @return string|null
*/
public function getCommand(): ?string
{
if ($command = $this->getProperty('command')) {
return $command;
}
$full_command = $this->getFullCommand() ?? '';
if (strpos($full_command, '/') !== 0) {
return null;
}
$full_command = substr($full_command, 1);
//check if command is followed by bot username
$split_cmd = explode('@', $full_command);
if (!isset($split_cmd[1])) {
//command is not followed by name
return $full_command;
}
if (strtolower($split_cmd[1]) === strtolower($this->getBotUsername())) {
//command is addressed to me
return $split_cmd[0];
}
return null;
}
/**
* For text messages, the actual UTF-8 text of the message, 0-4096 characters.
*
* @param bool $without_cmd
*
* @return string|null
*/
public function getText($without_cmd = false): ?string
{
$text = $this->getProperty('text');
if ($without_cmd && $command = $this->getFullCommand()) {
if (strlen($command) + 1 < strlen($text)) {
return substr($text, strlen($command) + 1);
}
return '';
}
return $text;
}
/**
* Bot added in chat
*
* @return bool
*/
public function botAddedInChat(): bool
{
foreach ($this->getNewChatMembers() as $member) {
if ($member instanceof User && $member->getUsername() === $this->getBotUsername()) {
return true;
}
}
return false;
}
/**
* Detect type based on properties.
*
* @return string
*/
public function getType(): string
{
$types = [
'text',
'animation',
'audio',
'document',
'photo',
'sticker',
'video',
'video_note',
'voice',
'contact',
'dice',
'game',
'poll',
'venue',
'location',
'new_chat_members',
'left_chat_member',
'new_chat_title',
'new_chat_photo',
'delete_chat_photo',
'group_chat_created',
'supergroup_chat_created',
'channel_chat_created',
'message_auto_delete_timer_changed',
'migrate_to_chat_id',
'migrate_from_chat_id',
'pinned_message',
'invoice',
'successful_payment',
'users_shared',
'chat_shared',
'write_access_allowed',
'passport_data',
'proximity_alert_triggered',
'boost_added',
'forum_topic_created',
'forum_topic_edited',
'forum_topic_closed',
'forum_topic_reopened',
'general_forum_topic_hidden',
'general_forum_topic_unhidden',
'video_chat_scheduled',
'video_chat_started',
'video_chat_ended',
'video_chat_participants_invited',
'web_app_data',
'reply_markup',
+ 'chat_background_set',
+ 'chat_owner_left',
+ 'chat_owner_changed',
];
$is_command = $this->getCommand() !== null;
foreach ($types as $type) {
if ($this->getProperty($type) !== null) {
if ($is_command && $type === 'text') {
return 'command';
}
return $type;
}
}
return 'message';
}
}
diff --git a/src/Entities/MessageEntity.php b/src/Entities/MessageEntity.php
index d09ab46..63127df 100644
--- a/src/Entities/MessageEntity.php
+++ b/src/Entities/MessageEntity.php
@@ -1,38 +1,40 @@
<?php
/**
* This file is part of the TelegramBot package.
*
* (c) Avtandil Kikabidze aka LONGMAN <akalongman@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Longman\TelegramBot\Entities;
/**
* Class MessageEntity
*
* @link https://core.telegram.org/bots/api#messageentity
*
- * @method string getType() Type of the entity. Currently, can be “mention” (@username), “hashtag” (#hashtag), “cashtag” ($USD), “bot_command” (/start@jobs_bot), “url” (https://telegram.org), “email” (do-not-reply@telegram.org), “phone_number” (+1-212-555-0123), “bold” (bold text), “italic” (italic text), “underline” (underlined text), “strikethrough” (strikethrough text), “spoiler” (spoiler message), “code” (monowidth string), “pre” (monowidth block), “text_link” (for clickable text URLs), “text_mention” (for users without usernames), “custom_emoji” (for inline custom emoji stickers)
+ * @method string getType() Type of the entity. Currently, can be “mention” (@username), “hashtag” (#hashtag), “cashtag” ($USD), “bot_command” (/start@jobs_bot), “url” (https://telegram.org), “email” (do-not-reply@telegram.org), “phone_number” (+1-212-555-0123), “bold” (bold text), “italic” (italic text), “underline” (underlined text), “strikethrough” (strikethrough text), “spoiler” (spoiler message), “blockquote” (block quotation), “expandable_blockquote” (collapsed-by-default block quotation), “date_time” (formatted date and time), “code” (monowidth string), “pre” (monowidth block), “text_link” (for clickable text URLs), “text_mention” (for users without usernames), “custom_emoji” (for inline custom emoji stickers)
* @method int getOffset() Offset in UTF-16 code units to the start of the entity
* @method int getLength() Length of the entity in UTF-16 code units
* @method string getUrl() Optional. For "text_link" only, url that will be opened after user taps on the text
* @method User getUser() Optional. For "text_mention" only, the mentioned user
* @method string getLanguage() Optional. For "pre" only, the programming language of the entity text
* @method string getCustomEmojiId() Optional. For “custom_emoji” only, unique identifier of the custom emoji. Use getCustomEmojiStickers to get full information about the sticker
+ * @method int getUnixTime() Optional. For “date_time” only, the Unix time associated with the entity
+ * @method string getDateTimeFormat() Optional. For “date_time” only, the string that defines the formatting of the date and time
*/
class MessageEntity extends Entity
{
/**
* {@inheritdoc}
*/
protected function subEntities(): array
{
return [
'user' => User::class,
];
}
}
diff --git a/src/Entities/Payments/SuccessfulPayment.php b/src/Entities/Payments/SuccessfulPayment.php
index 8f2b533..2e47fda 100644
--- a/src/Entities/Payments/SuccessfulPayment.php
+++ b/src/Entities/Payments/SuccessfulPayment.php
@@ -1,42 +1,46 @@
<?php
/**
* This file is part of the TelegramBot package.
*
* (c) Avtandil Kikabidze aka LONGMAN <akalongman@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Longman\TelegramBot\Entities\Payments;
use Longman\TelegramBot\Entities\Entity;
/**
* Class SuccessfulPayment
*
* This object contains basic information about a successful payment.
*
* @link https://core.telegram.org/bots/api#successfulpayment
*
- * @method string getCurrency() Three-letter ISO 4217 currency code
- * @method int getTotalAmount() Total price in the smallest units of the currency (integer, not float/double).
- * @method string getInvoicePayload() Bot specified invoice payload
- * @method string getShippingOptionId() Optional. Identifier of the shipping option chosen by the user
- * @method OrderInfo getOrderInfo() Optional. Order info provided by the user
- * @method string getTelegramPaymentChargeId() Telegram payment identifier
- * @method string getProviderPaymentChargeId() Provider payment identifier
+ * @method string getCurrency() Three-letter ISO 4217 currency code
+ * @method int getTotalAmount() Total price in the smallest units of the currency (integer, not float/double).
+ * @method string getInvoicePayload() Bot specified invoice payload
+ * @method int getSubscriptionPeriod() Optional. The duration of the paid subscription
+ * @method int getSubscriptionExpirationDate() Optional. Expiration date of the paid subscription in Unix time
+ * @method bool getIsRecurring() Optional. True, if the payment is a recurring payment
+ * @method bool getIsFirstRecurring() Optional. True, if the payment is the first recurring payment
+ * @method string getShippingOptionId() Optional. Identifier of the shipping option chosen by the user
+ * @method OrderInfo getOrderInfo() Optional. Order info provided by the user
+ * @method string getTelegramPaymentChargeId() Telegram payment identifier
+ * @method string getProviderPaymentChargeId() Provider payment identifier
**/
class SuccessfulPayment extends Entity
{
/**
* {@inheritdoc}
*/
protected function subEntities(): array
{
return [
'order_info' => OrderInfo::class,
];
}
}
diff --git a/src/Entities/Poll.php b/src/Entities/Poll.php
index 35313bc..a7ac562 100644
--- a/src/Entities/Poll.php
+++ b/src/Entities/Poll.php
@@ -1,47 +1,59 @@
<?php
/**
* This file is part of the TelegramBot package.
*
* (c) Avtandil Kikabidze aka LONGMAN <akalongman@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Longman\TelegramBot\Entities;
/**
* Class Poll
*
* This entity contains information about a poll.
*
* @link https://core.telegram.org/bots/api#poll
*
* @method string getId() Unique poll identifier
- * @method string getQuestion() Poll question, 1-255 characters
+ * @method string getQuestion() Poll question, 1-300 characters
* @method PollOption[] getOptions() List of poll options
* @method int getTotalVoterCount() Total number of users that voted in the poll
* @method bool getIsClosed() True, if the poll is closed
* @method bool getIsAnonymous() True, if the poll is anonymous
* @method string getType() Poll type, currently can be “regular” or “quiz”
* @method bool getAllowsMultipleAnswers() True, if the poll allows multiple answers
- * @method int getCorrectOptionId() Optional. 0-based identifier of the correct answer option. Available only for polls in the quiz mode, which are closed, or was sent (not forwarded) by the bot or to the private chat with the bot.
+ * @method int[] getCorrectOptionIds() Optional. 0-based identifiers of correct answer options. Available only for polls in the quiz mode, which are closed, or was sent (not forwarded) by the bot or to the private chat with the bot.
+ * @method bool getAllowsRevoting() Optional. True, if the poll allows voters to change their vote
+ * @method string getDescription() Optional. Poll description, 0-200 characters
+ * @method MessageEntity[] getDescriptionEntities() Optional. Special entities that appear in the description
* @method string getExplanation() Optional. Text that is shown when a user chooses an incorrect answer or taps on the lamp icon in a quiz-style poll, 0-200 characters
* @method MessageEntity[] getExplanationEntities() Optional. Special entities like usernames, URLs, bot commands, etc. that appear in the explanation
* @method int getOpenPeriod() Optional. Amount of time in seconds the poll will be active after creation
* @method int getCloseDate() Optional. Point in time (Unix timestamp) when the poll will be automatically closed
+ * @method MessageEntity[] getQuestionEntities() Optional. Special entities that appear in the question. Currently, only custom emoji entities are allowed in poll questions
+ * @method PollMedia getMedia() Optional. Media associated with the poll
+ * @method PollMedia getExplanationMedia() Optional. Media associated with the explanation
+ * @method bool getMembersOnly() Optional. True, if the poll can only be answered by chat members
+ * @method array getCountryCodes() Optional. List of country codes of countries whose residents can vote in the poll
*/
class Poll extends Entity
{
/**
* {@inheritdoc}
*/
protected function subEntities(): array
{
return [
'options' => [PollOption::class],
+ 'description_entities' => [MessageEntity::class],
'explanation_entities' => [MessageEntity::class],
+ 'question_entities' => [MessageEntity::class],
+ 'media' => PollMedia::class,
+ 'explanation_media' => PollMedia::class,
];
}
}
diff --git a/src/Entities/PollAnswer.php b/src/Entities/PollAnswer.php
index f55fe91..3d91499 100644
--- a/src/Entities/PollAnswer.php
+++ b/src/Entities/PollAnswer.php
@@ -1,38 +1,39 @@
<?php
/**
* This file is part of the TelegramBot package.
*
* (c) Avtandil Kikabidze aka LONGMAN <akalongman@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Longman\TelegramBot\Entities;
/**
* Class PollAnswer
*
* This entity represents an answer of a user in a non-anonymous poll.
*
* @link https://core.telegram.org/bots/api#pollanswer
*
* @method string getPollId() Unique poll identifier
* @method Chat getVoterChat() Optional. The chat that changed the answer to the poll, if the voter is anonymous
* @method User getUser() Optional. The user, who changed the answer to the poll
* @method array getOptionIds() 0-based identifiers of answer options, chosen by the user. May be empty if the user retracted their vote.
+ * @method array getOptionPersistentIds() Optional. Unique identifiers of answer options, chosen by the user
*/
class PollAnswer extends Entity
{
/**
* {@inheritdoc}
*/
protected function subEntities(): array
{
return [
'voter_chat' => Chat::class,
'user' => User::class,
];
}
}
diff --git a/src/Entities/PollOption.php b/src/Entities/PollOption.php
index 8af5f97..0bb135e 100644
--- a/src/Entities/PollOption.php
+++ b/src/Entities/PollOption.php
@@ -1,27 +1,44 @@
<?php
/**
* This file is part of the TelegramBot package.
*
* (c) Avtandil Kikabidze aka LONGMAN <akalongman@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Longman\TelegramBot\Entities;
/**
* Class PollOption
*
* This entity contains information about one answer option in a poll.
*
* @link https://core.telegram.org/bots/api#polloption
*
- * @method string getText() Option text, 1-100 characters
- * @method int getVoterCount() Number of users that voted for this option
+ * @method string getText() Option text, 1-100 characters
+ * @method int getVoterCount() Number of users that voted for this option
+ * @method MessageEntity[] getTextEntities() Optional. Special entities that appear in the option text. Currently, only custom emoji entities are allowed in poll option texts
+ * @method string getPersistentId() Optional. Unique identifier of the poll option
+ * @method User getAddedByUser() Optional. User that added the option
+ * @method Chat getAddedByChat() Optional. Chat that added the option
+ * @method int getAdditionDate() Optional. Date when the option was added in Unix time
+ * @method PollMedia getMedia() Optional. Media associated with the option
*/
class PollOption extends Entity
{
-
+ /**
+ * {@inheritdoc}
+ */
+ protected function subEntities(): array
+ {
+ return [
+ 'text_entities' => [MessageEntity::class],
+ 'added_by_user' => User::class,
+ 'added_by_chat' => Chat::class,
+ 'media' => PollMedia::class,
+ ];
+ }
}
diff --git a/src/Entities/ReactionType/Factory.php b/src/Entities/ReactionType/Factory.php
index f61cf36..bdcc7d4 100644
--- a/src/Entities/ReactionType/Factory.php
+++ b/src/Entities/ReactionType/Factory.php
@@ -1,23 +1,24 @@
<?php
namespace Longman\TelegramBot\Entities\ReactionType;
use Longman\TelegramBot\Entities\Entity;
class Factory extends \Longman\TelegramBot\Entities\Factory
{
public static function make(array $data, string $bot_username): Entity
{
$type = [
'emoji' => ReactionTypeEmoji::class,
'custom_emoji' => ReactionTypeCustomEmoji::class,
+ 'paid' => ReactionTypePaid::class,
];
if (!isset($type[$data['type'] ?? ''])) {
return new ReactionTypeNotImplemented($data, $bot_username);
}
$class = $type[$data['type']];
return new $class($data, $bot_username);
}
}
diff --git a/src/Entities/ReplyParameters.php b/src/Entities/ReplyParameters.php
index 176650d..02d279c 100644
--- a/src/Entities/ReplyParameters.php
+++ b/src/Entities/ReplyParameters.php
@@ -1,38 +1,40 @@
<?php
/**
* This file is part of the TelegramBot package.
*
* (c) Avtandil Kikabidze aka LONGMAN <akalongman@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Longman\TelegramBot\Entities;
/**
* Describes reply parameters for the message that is being sent.
*
* @link https://core.telegram.org/bots/api#replyparameters
*
* @method int getMessageId() Identifier of the message that will be replied to in the current chat, or in the chat chat_id if it is specified
* @method int|string getChatId() Optional. If the message to be replied to is from a different chat, unique identifier for the chat or username of the channel (in the format @channelusername)
* @method bool getAllowSendingWithoutReply() Optional. Pass True if the message should be sent even if the specified message to be replied to is not found; can be used only for replies in the same chat and forum topic.
* @method string getQuote() Optional. Quoted part of the message to be replied to; 0-1024 characters after entities parsing. The quote must be an exact substring of the message to be replied to, including bold, italic, underline, strikethrough, spoiler, and custom_emoji entities. The message will fail to send if the quote isn't found in the original message.
* @method string getQuoteParseMode() Optional. Mode for parsing entities in the quote. See formatting options for more details.
* @method MessageEntity[] getQuoteEntities() Optional. A JSON-serialized list of special entities that appear in the quote. It can be specified instead of quote_parse_mode.
* @method int getQuotePosition() Optional. Position of the quote in the original message in UTF-16 code units
+ * @method int getChecklistTaskId() Optional. Identifier of the specific checklist task to be replied to
+ * @method string getPollOptionId() Optional. Identifier of the specific poll option to be replied to
*/
class ReplyParameters extends Entity
{
/**
* {@inheritdoc}
*/
protected function subEntities(): array
{
return [
'quote_entities' => [MessageEntity::class],
];
}
}
diff --git a/src/Entities/ServerResponse.php b/src/Entities/ServerResponse.php
index fb18b2f..241016b 100644
--- a/src/Entities/ServerResponse.php
+++ b/src/Entities/ServerResponse.php
@@ -1,164 +1,183 @@
<?php
/**
* This file is part of the TelegramBot package.
* (c) Avtandil Kikabidze aka LONGMAN <akalongman@gmail.com>
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Longman\TelegramBot\Entities;
use Longman\TelegramBot\Entities\ChatMember\ChatMember;
use Longman\TelegramBot\Entities\ChatMember\Factory as ChatMemberFactory;
use Longman\TelegramBot\Entities\Games\GameHighScore;
use Longman\TelegramBot\Entities\MenuButton\Factory as MenuButtonFactory;
use Longman\TelegramBot\Request;
/**
* Class ServerResponse
*
* @link https://core.telegram.org/bots/api#making-requests
*
* @method bool getOk() If the request was successful
* @method mixed getResult() The result of the query
* @method int getErrorCode() Error code of the unsuccessful request
* @method string getDescription() Human-readable description of the result / unsuccessful request
*
* @todo method ResponseParameters getParameters() Field which can help to automatically handle the error
*/
class ServerResponse extends Entity
{
/**
* ServerResponse constructor.
*
* @param array $data
* @param string $bot_username
*/
public function __construct(array $data, string $bot_username = '')
{
$is_ok = (bool) ($data['ok'] ?? false);
$result = $data['result'] ?? null;
if ($is_ok && is_array($result)) {
if ($this->isAssoc($result)) {
$data['result'] = $this->createResultObject($result, $bot_username);
} else {
$data['result'] = $this->createResultObjects($result, $bot_username);
}
}
parent::__construct($data, $bot_username);
}
/**
* Check if array is associative
*
* @link https://stackoverflow.com/a/4254008
*
* @param array $array
*
* @return bool
*/
protected function isAssoc(array $array): bool
{
return count(array_filter(array_keys($array), 'is_string')) > 0;
}
/**
* If response is ok
*
* @return bool
*/
public function isOk(): bool
{
return (bool) $this->getOk();
}
/**
* Print error
*
* @see https://secure.php.net/manual/en/function.print-r.php
*
* @param bool $return
*
* @return bool|string
*/
public function printError($return = false)
{
$error = sprintf('Error N: %s, Description: %s', $this->getErrorCode(), $this->getDescription());
if ($return) {
return $error;
}
echo $error;
return true;
}
/**
* Create and return the object of the received result
*
* @param array $result
* @param string $bot_username
*
* @return BotDescription|BotName|BotShortDescription|Chat|ChatAdministratorRights|ChatMember|File|Message|MenuButton|Poll|SentWebAppMessage|StickerSet|User|UserProfilePhotos|WebhookInfo
*/
private function createResultObject(array $result, string $bot_username): Entity
{
$result_object_types = [
'getWebhookInfo' => WebhookInfo::class,
'getMe' => User::class,
'getUserProfilePhotos' => UserProfilePhotos::class,
'getFile' => File::class,
- 'getChat' => Chat::class,
+ 'getChat' => ChatFullInfo::class,
'getChatMember' => ChatMemberFactory::class,
'getMyName' => BotName::class,
'getMyDescription' => BotDescription::class,
'getMyShortDescription' => BotShortDescription::class,
'getChatMenuButton' => MenuButtonFactory::class,
'getMyDefaultAdministratorRights' => ChatAdministratorRights::class,
'getStickerSet' => StickerSet::class,
'stopPoll' => Poll::class,
'answerWebAppQuery' => SentWebAppMessage::class,
+ 'createChatInviteLink' => ChatInviteLink::class,
+ 'editChatInviteLink' => ChatInviteLink::class,
+ 'revokeChatInviteLink' => ChatInviteLink::class,
+ 'createChatSubscriptionInviteLink' => ChatInviteLink::class,
+ 'editChatSubscriptionInviteLink' => ChatInviteLink::class,
+ 'uploadStickerFile' => File::class,
+ 'getMyStarBalance' => StarAmount::class,
+ 'getBusinessAccountStarBalance' => StarAmount::class,
+ 'getUserProfileAudios' => UserProfileAudios::class,
+ 'getStarTransactions' => StarTransactions::class,
+ 'getUserGifts' => OwnedGifts::class,
+ 'getChatGifts' => OwnedGifts::class,
+ 'getBusinessAccountGifts' => OwnedGifts::class,
+ 'getAvailableGifts' => Gifts::class,
+ 'createForumTopic' => ForumTopic::class,
+ 'savePreparedInlineMessage' => PreparedInlineMessage::class,
+ 'postStory' => Story::class,
+ 'editStory' => Story::class,
+ 'repostStory' => Story::class,
];
$action = Request::getCurrentAction();
$object_class = $result_object_types[$action] ?? Message::class;
return Factory::resolveEntityClass($object_class, $result, $bot_username);
}
/**
* Create and return the objects array of the received result
*
* @param array $results
* @param string $bot_username
*
* @return BotCommand[]|ChatMember[]|GameHighScore[]|Message[]|Sticker[]|Update[]
*/
private function createResultObjects(array $results, string $bot_username): array
{
$result_object_types = [
'getUpdates' => Update::class,
'getChatAdministrators' => ChatMemberFactory::class,
'getForumTopicIconStickers' => Sticker::class,
'getMyCommands' => BotCommand::class,
'getCustomEmojiStickers' => Sticker::class,
'getGameHighScores' => GameHighScore::class,
'sendMediaGroup' => Message::class,
];
$action = Request::getCurrentAction();
$object_class = $result_object_types[$action] ?? Update::class;
$objects = [];
foreach ($results as $result) {
$objects[] = Factory::resolveEntityClass($object_class, $result, $bot_username);
}
return $objects;
}
}
diff --git a/src/Entities/StickerSet.php b/src/Entities/StickerSet.php
index 8bb35ec..477e4bc 100644
--- a/src/Entities/StickerSet.php
+++ b/src/Entities/StickerSet.php
@@ -1,39 +1,37 @@
<?php
/**
* This file is part of the TelegramBot package.
*
* (c) Avtandil Kikabidze aka LONGMAN <akalongman@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Longman\TelegramBot\Entities;
/**
* Class StickerSet
*
* @link https://core.telegram.org/bots/api#stickerset
*
* @method string getName() Sticker set name
* @method string getTitle() Sticker set title
* @method string getStickerType() Type of stickers in the set, currently one of “regular”, “mask”, “custom_emoji”
- * @method bool getIsAnimated() True, if the sticker set contains animated stickers
- * @method bool getIsVideo() True, if the sticker set contains video stickers
* @method Sticker[] getStickers() List of all set stickers
* @method PhotoSize getThumbnail() Optional. Sticker set thumbnail in the .WEBP or .TGS format
*/
class StickerSet extends Entity
{
/**
* {@inheritdoc}
*/
protected function subEntities(): array
{
return [
'stickers' => [Sticker::class],
'thumbnail' => PhotoSize::class,
];
}
}
diff --git a/src/Entities/Topics/ForumTopicCreated.php b/src/Entities/Topics/ForumTopicCreated.php
index cf43262..a532a7b 100644
--- a/src/Entities/Topics/ForumTopicCreated.php
+++ b/src/Entities/Topics/ForumTopicCreated.php
@@ -1,21 +1,22 @@
<?php
namespace Longman\TelegramBot\Entities\Topics;
use Longman\TelegramBot\Entities\Entity;
/**
* Class ForumTopicCreated
*
* This object represents a service message about a new forum topic created in the chat.
*
* @link https://core.telegram.org/bots/api#forumtopiccreated
*
* @method string getName() Name of the topic
* @method int getIconColor() Color of the topic icon in RGB format
* @method string getIconCustomEmojiId() Optional. Unique identifier of the custom emoji shown as the topic icon
+ * @method bool getIsNameImplicit() Optional. True, if the name of the topic wasn't specified explicitly by its creator and likely needs to be changed by the bot
*/
class ForumTopicCreated extends Entity
{
}
diff --git a/src/Entities/Update.php b/src/Entities/Update.php
index 716b183..e70a04a 100644
--- a/src/Entities/Update.php
+++ b/src/Entities/Update.php
@@ -1,132 +1,155 @@
<?php
/**
* This file is part of the TelegramBot package.
*
* (c) Avtandil Kikabidze aka LONGMAN <akalongman@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Longman\TelegramBot\Entities;
use Longman\TelegramBot\Entities\Payments\PreCheckoutQuery;
use Longman\TelegramBot\Entities\Payments\ShippingQuery;
/**
* Class Update
*
* @link https://core.telegram.org/bots/api#update
*
* @method int getUpdateId() The update's unique identifier. Update identifiers start from a certain positive number and increase sequentially. This ID becomes especially handy if you’re using Webhooks, since it allows you to ignore repeated updates or to restore the correct update sequence, should they get out of order.
* @method Message getMessage() Optional. New incoming message of any kind — text, photo, sticker, etc.
* @method Message getEditedMessage() Optional. New version of a message that is known to the bot and was edited
* @method Message getChannelPost() Optional. New post in the channel, can be any kind — text, photo, sticker, etc.
* @method Message getEditedChannelPost() Optional. New version of a post in the channel that is known to the bot and was edited
* @method MessageReactionUpdated getMessageReaction() Optional. A reaction to a message was changed by a user. The bot must be an administrator in the chat and must explicitly specify "message_reaction" in the list of allowed_updates to receive these updates. The update isn't received for reactions set by bots.
* @method MessageReactionCountUpdated getMessageReactionCount() Optional. Reactions to a message with anonymous reactions were changed. The bot must be an administrator in the chat and must explicitly specify "message_reaction_count" in the list of allowed_updates to receive these updates. The updates are grouped and can be sent with delay up to a few minutes.
* @method InlineQuery getInlineQuery() Optional. New incoming inline query
* @method ChosenInlineResult getChosenInlineResult() Optional. The result of an inline query that was chosen by a user and sent to their chat partner.
* @method CallbackQuery getCallbackQuery() Optional. New incoming callback query
* @method ShippingQuery getShippingQuery() Optional. New incoming shipping query. Only for invoices with flexible price
* @method PreCheckoutQuery getPreCheckoutQuery() Optional. New incoming pre-checkout query. Contains full information about checkout
* @method Poll getPoll() Optional. New poll state. Bots receive only updates about polls, which are sent or stopped by the bot
* @method PollAnswer getPollAnswer() Optional. A user changed their answer in a non-anonymous poll. Bots receive new votes only in polls that were sent by the bot itself.
* @method ChatMemberUpdated getMyChatMember() Optional. The bot's chat member status was updated in a chat. For private chats, this update is received only when the bot is blocked or unblocked by the user.
* @method ChatMemberUpdated getChatMember() Optional. A chat member's status was updated in a chat. The bot must be an administrator in the chat and must explicitly specify “chat_member” in the list of allowed_updates to receive these updates.
* @method ChatJoinRequest getChatJoinRequest() Optional. A request to join the chat has been sent. The bot must have the can_invite_users administrator right in the chat to receive these updates.
* @method ChatBoostUpdated getChatBoost() Optional. A chat boost was added or changed. The bot must be an administrator in the chat to receive these updates.
* @method ChatBoostRemoved getRemovedChatBoost() Optional. A boost was removed from a chat. The bot must be an administrator in the chat to receive these updates.
+ * @method BusinessConnection getBusinessConnection() Optional. The bot was connected to or disconnected from a business account, or a user edited an existing connection with the bot
+ * @method Message getBusinessMessage() Optional. New message from a connected business account
+ * @method Message getEditedBusinessMessage() Optional. New version of a message from a connected business account
+ * @method BusinessMessagesDeleted getDeletedBusinessMessages() Optional. Messages were deleted from a connected business account
+ * @method StarTransaction getTransaction() Optional. New incoming transaction; for bots only
+ * @method PaidMediaPurchased getPurchasedPaidMedia() Optional. A user purchased paid media with a payload for the bot
+ * @method Message getGuestMessage() Optional. A message in guest mode was sent
*/
class Update extends Entity
{
- public const TYPE_MESSAGE = 'message';
- public const TYPE_EDITED_MESSAGE = 'edited_message';
- public const TYPE_CHANNEL_POST = 'channel_post';
- public const TYPE_EDITED_CHANNEL_POST = 'edited_channel_post';
- public const TYPE_MESSAGE_REACTION = 'message_reaction';
- public const TYPE_MESSAGE_REACTION_COUNT = 'message_reaction_count';
- public const TYPE_INLINE_QUERY = 'inline_query';
- public const TYPE_CHOSEN_INLINE_RESULT = 'chosen_inline_result';
- public const TYPE_CALLBACK_QUERY = 'callback_query';
- public const TYPE_SHIPPING_QUERY = 'shipping_query';
- public const TYPE_PRE_CHECKOUT_QUERY = 'pre_checkout_query';
- public const TYPE_POLL = 'poll';
- public const TYPE_POLL_ANSWER = 'poll_answer';
- public const TYPE_MY_CHAT_MEMBER = 'my_chat_member';
- public const TYPE_CHAT_MEMBER = 'chat_member';
- public const TYPE_CHAT_JOIN_REQUEST = 'chat_join_request';
- public const TYPE_CHAT_BOOST = 'chat_boost';
- public const TYPE_REMOVED_CHAT_BOOST = 'removed_chat_boost';
+ public const TYPE_MESSAGE = 'message';
+ public const TYPE_EDITED_MESSAGE = 'edited_message';
+ public const TYPE_CHANNEL_POST = 'channel_post';
+ public const TYPE_EDITED_CHANNEL_POST = 'edited_channel_post';
+ public const TYPE_MESSAGE_REACTION = 'message_reaction';
+ public const TYPE_MESSAGE_REACTION_COUNT = 'message_reaction_count';
+ public const TYPE_INLINE_QUERY = 'inline_query';
+ public const TYPE_CHOSEN_INLINE_RESULT = 'chosen_inline_result';
+ public const TYPE_CALLBACK_QUERY = 'callback_query';
+ public const TYPE_SHIPPING_QUERY = 'shipping_query';
+ public const TYPE_PRE_CHECKOUT_QUERY = 'pre_checkout_query';
+ public const TYPE_POLL = 'poll';
+ public const TYPE_POLL_ANSWER = 'poll_answer';
+ public const TYPE_MY_CHAT_MEMBER = 'my_chat_member';
+ public const TYPE_CHAT_MEMBER = 'chat_member';
+ public const TYPE_CHAT_JOIN_REQUEST = 'chat_join_request';
+ public const TYPE_CHAT_BOOST = 'chat_boost';
+ public const TYPE_REMOVED_CHAT_BOOST = 'removed_chat_boost';
+ public const TYPE_BUSINESS_CONNECTION = 'business_connection';
+ public const TYPE_BUSINESS_MESSAGE = 'business_message';
+ public const TYPE_EDITED_BUSINESS_MESSAGE = 'edited_business_message';
+ public const TYPE_DELETED_BUSINESS_MESSAGES = 'deleted_business_messages';
+ public const TYPE_TRANSACTION = 'transaction';
+ public const TYPE_PURCHASED_PAID_MEDIA = 'purchased_paid_media';
+ public const TYPE_GUEST_MESSAGE = 'guest_message';
+ public const TYPE_MANAGED_BOT = 'managed_bot';
/**
* {@inheritdoc}
*/
protected function subEntities(): array
{
return [
- self::TYPE_MESSAGE => Message::class,
- self::TYPE_EDITED_MESSAGE => EditedMessage::class,
- self::TYPE_CHANNEL_POST => ChannelPost::class,
- self::TYPE_EDITED_CHANNEL_POST => EditedChannelPost::class,
- self::TYPE_MESSAGE_REACTION => MessageReactionUpdated::class,
- self::TYPE_MESSAGE_REACTION_COUNT => MessageReactionCountUpdated::class,
- self::TYPE_INLINE_QUERY => InlineQuery::class,
- self::TYPE_CHOSEN_INLINE_RESULT => ChosenInlineResult::class,
- self::TYPE_CALLBACK_QUERY => CallbackQuery::class,
- self::TYPE_SHIPPING_QUERY => ShippingQuery::class,
- self::TYPE_PRE_CHECKOUT_QUERY => PreCheckoutQuery::class,
- self::TYPE_POLL => Poll::class,
- self::TYPE_POLL_ANSWER => PollAnswer::class,
- self::TYPE_MY_CHAT_MEMBER => ChatMemberUpdated::class,
- self::TYPE_CHAT_MEMBER => ChatMemberUpdated::class,
- self::TYPE_CHAT_JOIN_REQUEST => ChatJoinRequest::class,
- self::TYPE_CHAT_BOOST => ChatBoostUpdated::class,
- self::TYPE_REMOVED_CHAT_BOOST => ChatBoostRemoved::class,
+ self::TYPE_MESSAGE => Message::class,
+ self::TYPE_EDITED_MESSAGE => EditedMessage::class,
+ self::TYPE_CHANNEL_POST => ChannelPost::class,
+ self::TYPE_EDITED_CHANNEL_POST => EditedChannelPost::class,
+ self::TYPE_MESSAGE_REACTION => MessageReactionUpdated::class,
+ self::TYPE_MESSAGE_REACTION_COUNT => MessageReactionCountUpdated::class,
+ self::TYPE_INLINE_QUERY => InlineQuery::class,
+ self::TYPE_CHOSEN_INLINE_RESULT => ChosenInlineResult::class,
+ self::TYPE_CALLBACK_QUERY => CallbackQuery::class,
+ self::TYPE_SHIPPING_QUERY => ShippingQuery::class,
+ self::TYPE_PRE_CHECKOUT_QUERY => PreCheckoutQuery::class,
+ self::TYPE_POLL => Poll::class,
+ self::TYPE_POLL_ANSWER => PollAnswer::class,
+ self::TYPE_MY_CHAT_MEMBER => ChatMemberUpdated::class,
+ self::TYPE_CHAT_MEMBER => ChatMemberUpdated::class,
+ self::TYPE_CHAT_JOIN_REQUEST => ChatJoinRequest::class,
+ self::TYPE_CHAT_BOOST => ChatBoostUpdated::class,
+ self::TYPE_REMOVED_CHAT_BOOST => ChatBoostRemoved::class,
+ self::TYPE_BUSINESS_CONNECTION => BusinessConnection::class,
+ self::TYPE_BUSINESS_MESSAGE => Message::class,
+ self::TYPE_EDITED_BUSINESS_MESSAGE => Message::class,
+ self::TYPE_DELETED_BUSINESS_MESSAGES => BusinessMessagesDeleted::class,
+ self::TYPE_TRANSACTION => StarTransaction::class,
+ self::TYPE_PURCHASED_PAID_MEDIA => PaidMediaPurchased::class,
+ self::TYPE_GUEST_MESSAGE => Message::class,
+ self::TYPE_MANAGED_BOT => ManagedBotUpdated::class,
];
}
/**
* Get the list of all available update types
*
* @return string[]
*/
public static function getUpdateTypes(): array
{
return array_keys((new self([]))->subEntities());
}
/**
* Get the update type based on the set properties
*
* @return string|null
*/
public function getUpdateType(): ?string
{
foreach (self::getUpdateTypes() as $type) {
if ($this->getProperty($type)) {
return $type;
}
}
return null;
}
/**
* Get update content
*
- * @return Message|EditedMessage|ChannelPost|EditedChannelPost|MessageReactionUpdated|MessageReactionCountUpdated|InlineQuery|ChosenInlineResult|CallbackQuery|ShippingQuery|PreCheckoutQuery|Poll|PollAnswer|ChatMemberUpdated|ChatJoinRequest|ChatBoostUpdated|ChatBoostRemoved
+ * @return Message|EditedMessage|ChannelPost|EditedChannelPost|MessageReactionUpdated|MessageReactionCountUpdated|InlineQuery|ChosenInlineResult|CallbackQuery|ShippingQuery|PreCheckoutQuery|Poll|PollAnswer|ChatMemberUpdated|ChatJoinRequest|ChatBoostUpdated|ChatBoostRemoved|BusinessConnection|BusinessMessagesDeleted|StarTransaction|PaidMediaPurchased
*/
public function getUpdateContent()
{
if ($update_type = $this->getUpdateType()) {
// Instead of just getting the property as an array,
// use the __call method to get the correct Entity object.
$method = 'get' . str_replace('_', '', ucwords($update_type, '_'));
return $this->$method();
}
return null;
}
}
diff --git a/src/Entities/User.php b/src/Entities/User.php
index bc412b0..b199c69 100644
--- a/src/Entities/User.php
+++ b/src/Entities/User.php
@@ -1,34 +1,41 @@
<?php
/**
* This file is part of the TelegramBot package.
*
* (c) Avtandil Kikabidze aka LONGMAN <akalongman@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Longman\TelegramBot\Entities;
/**
* Class User
*
* @link https://core.telegram.org/bots/api#user
*
- * @method int getId() Unique identifier for this user or bot
- * @method bool getIsBot() True, if this user is a bot
- * @method string getFirstName() User's or bot’s first name
- * @method string getLastName() Optional. User's or bot’s last name
- * @method string getUsername() Optional. User's or bot’s username
- * @method string getLanguageCode() Optional. IETF language tag of the user's language
- * @method bool getIsPremium() Optional. True, if this user is a Telegram Premium user
- * @method bool getAddedToAttachmentMenu() Optional. True, if this user added the bot to the attachment menu
- * @method bool getCanJoinGroups() Optional. True, if the bot can be invited to groups. Returned only in getMe.
- * @method bool getCanReadAllGroupMessages() Optional. True, if privacy mode is disabled for the bot. Returned only in getMe.
- * @method bool getSupportsInlineQueries() Optional. True, if the bot supports inline queries. Returned only in getMe.
+ * @method int getId() Unique identifier for this user or bot
+ * @method bool getIsBot() True, if this user is a bot
+ * @method string getFirstName() User's or bot’s first name
+ * @method string getLastName() Optional. User's or bot’s last name
+ * @method string getUsername() Optional. User's or bot’s username
+ * @method string getLanguageCode() Optional. IETF language tag of the user's language
+ * @method bool getIsPremium() Optional. True, if this user is a Telegram Premium user
+ * @method bool getAddedToAttachmentMenu() Optional. True, if this user added the bot to the attachment menu
+ * @method bool getCanJoinGroups() Optional. True, if the bot can be invited to groups. Returned only in getMe.
+ * @method bool getCanReadAllGroupMessages() Optional. True, if privacy mode is disabled for the bot. Returned only in getMe.
+ * @method bool getSupportsInlineQueries() Optional. True, if the bot supports inline queries. Returned only in getMe.
+ * @method bool getCanConnectToBusiness() Optional. True, if the bot can be connected to a Telegram Business account to receive its messages. Returned only in getMe.
+ * @method bool getHasMainWebApp() Optional. True, if the bot has a main Web App. Returned only in getMe.
+ * @method bool getHasTopicsEnabled() Optional. True, if the bot has forum topic mode enabled in private chats. Returned only in getMe.
+ * @method bool getSupportsJoinRequestQueries() Optional. True, if the bot supports join request queries. Returned only in getMe.
+ * @method bool getSupportsGuestQueries() Optional. True, if the bot supports guest queries. Returned only in getMe.
+ * @method bool getCanManageBots() Optional. True, if the user is allowed to create, edit, or delete managed bots. Returned only in getMe.
+ * @method bool getAllowsUsersToCreateTopics() Optional. True, if the bot allows users to create forum topics in private chats. Returned only in getMe.
*/
class User extends Entity
{
}
diff --git a/src/Entities/Video.php b/src/Entities/Video.php
index 972f04d..1a0c83d 100644
--- a/src/Entities/Video.php
+++ b/src/Entities/Video.php
@@ -1,40 +1,45 @@
<?php
/**
* This file is part of the TelegramBot package.
*
* (c) Avtandil Kikabidze aka LONGMAN <akalongman@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Longman\TelegramBot\Entities;
/**
* Class Video
*
* @link https://core.telegram.org/bots/api#video
*
- * @method string getFileId() Identifier for this file, which can be used to download or reuse the file
- * @method string getFileUniqueId() Unique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file.
- * @method int getWidth() Video width as defined by sender
- * @method int getHeight() Video height as defined by sender
- * @method int getDuration() Duration of the video in seconds as defined by sender
- * @method PhotoSize getThumbnail() Optional. Video thumbnail
- * @method string getFileName() Optional. Original filename as defined by sender
- * @method string getMimeType() Optional. Mime type of a file as defined by sender
- * @method int getFileSize() Optional. File size
+ * @method string getFileId() Identifier for this file, which can be used to download or reuse the file
+ * @method string getFileUniqueId() Unique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file.
+ * @method int getWidth() Video width as defined by sender
+ * @method int getHeight() Video height as defined by sender
+ * @method int getDuration() Duration of the video in seconds as defined by sender
+ * @method PhotoSize[] getCover() Optional. Available sizes of the cover of the video in the message
+ * @method int getStartTimestamp() Optional. Timestamp in seconds from which the video will play in the message
+ * @method PhotoSize getThumbnail() Optional. Video thumbnail
+ * @method string getFileName() Optional. Original filename as defined by sender
+ * @method string getMimeType() Optional. Mime type of a file as defined by sender
+ * @method int getFileSize() Optional. File size
+ * @method VideoQuality[] getQualities() Optional. Available qualities of the video
*/
class Video extends Entity
{
/**
* {@inheritdoc}
*/
protected function subEntities(): array
{
return [
+ 'cover' => [PhotoSize::class],
'thumbnail' => PhotoSize::class,
+ 'qualities' => [VideoQuality::class],
];
}
}
diff --git a/src/Entities/WebAppInfo.php b/src/Entities/WebAppInfo.php
index 9227743..b577c93 100644
--- a/src/Entities/WebAppInfo.php
+++ b/src/Entities/WebAppInfo.php
@@ -1,19 +1,22 @@
<?php
namespace Longman\TelegramBot\Entities;
/**
* Class WebAppInfo
*
* @link https://core.telegram.org/bots/api#webappinfo
*
* @property string $url An HTTPS URL of a Web App to be opened with additional data as specified in Initializing Web Apps
*
* @method string getUrl() An HTTPS URL of a Web App to be opened with additional data as specified in Initializing Web Apps
*
* @method $this setUrl(string $url) An HTTPS URL of a Web App to be opened with additional data as specified in Initializing Web Apps
+ *
+ * @method bool getAllowWritingToPm() Optional. If true, a Web App can be opened from a link pressed in a bot's message always in full size, even if the Web App is not designed to support full size layout. Ignored for inline keyboard buttons.
+ * @method $this setAllowWritingToPm(bool $allowWritingToPm) Optional. If true, a Web App can be opened from a link pressed in a bot's message always in full size, even if the Web App is not designed to support full size layout. Ignored for inline keyboard buttons.
*/
class WebAppInfo extends Entity
{
}

File Metadata

Mime Type
text/x-diff
Expires
Sun, Nov 15, 4:18 AM (1 d, 1 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
147064
Default Alt Text
(182 KB)

Event Timeline