Skip to content

Commit 1d9286f

Browse files
committed
Other Changes pt. 1
1 parent 72578a2 commit 1d9286f

File tree

7 files changed

+124
-6
lines changed

7 files changed

+124
-6
lines changed

src/Entities/Chat.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,13 @@
2828
* @method string getFirstName() Optional. First name of the other party in a private chat
2929
* @method string getLastName() Optional. Last name of the other party in a private chat
3030
* @method bool getIsForum() Optional. True, if the supergroup chat is a forum (has topics enabled)
31+
* @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.
3132
* @method ChatPhoto getPhoto() Optional. Chat photo. Returned only in getChat.
3233
* @method string[] getActiveUsernames() Optional. If non-empty, the list of all active chat usernames; for private chats, supergroups and channels. Returned only in getChat.
3334
* @method ReactionType[] getAvailableReactions() Optional. List of available reactions allowed in the chat. If omitted, then all emoji reactions are allowed. Returned only in getChat.
35+
* @method string getBackgroundCustomEmojiId() Optional. Custom emoji identifier of the emoji chosen by the chat for the reply header and link preview background
36+
* @method int getProfileAccentColorId() Optional. Identifier of the accent color for the chat's profile background. See profile accent colors for more details.
37+
* @method string getProfileBackgroundCustomEmojiId() Optional. Custom emoji identifier of the emoji chosen by the chat for its profile background
3438
* @method string getEmojiStatusCustomEmojiId() Optional. Custom emoji identifier of emoji status of the other party in a private chat. Returned only in getChat.
3539
* @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.
3640
* @method string getBio() Optional. Bio of the other party in a private chat. Returned only in getChat.
@@ -47,6 +51,7 @@
4751
* @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.
4852
* @method bool getHasHiddenMembers() Optional. True, if non-administrators can only get the list of bots and administrators in the chat. Returned only in getChat.
4953
* @method bool getHasProtectedContent() Optional. True, if messages from the chat can't be forwarded to other chats. Returned only in getChat.
54+
* @method bool getHasVisibleHistory() Optional. True, if new chat members will have access to old messages; available only to chat administrators
5055
* @method string getStickerSetName() Optional. For supergroups, name of group sticker set. Returned only in getChat.
5156
* @method bool getCanSetStickerSet() Optional. True, if the bot can change the group sticker set. Returned only in getChat.
5257
* @method int getLinkedChatId() Optional. Unique identifier for the linked chat. Returned only in getChat.

src/Entities/Message.php

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
namespace Longman\TelegramBot\Entities;
1313

1414
use Longman\TelegramBot\Entities\Games\Game;
15+
use Longman\TelegramBot\Entities\MessageOrigin\MessageOrigin;
1516
use Longman\TelegramBot\Entities\Payments\Invoice;
1617
use Longman\TelegramBot\Entities\Payments\SuccessfulPayment;
1718
use Longman\TelegramBot\Entities\TelegramPassport\PassportData;
@@ -35,12 +36,7 @@
3536
* @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
3637
* @method int getDate() Date the message was sent in Unix time
3738
* @method Chat getChat() Conversation the message belongs to
38-
* @method User getForwardFrom() Optional. For forwarded messages, sender of the original message
39-
* @method Chat getForwardFromChat() Optional. For messages forwarded from a channel, information about the original channel
40-
* @method int getForwardFromMessageId() Optional. For forwarded channel posts, identifier of the original message in the channel
41-
* @method string getForwardSignature() Optional. For messages forwarded from channels, signature of the post author if present
42-
* @method string getForwardSenderName() Optional. Sender's name for messages forwarded from users who disallow adding a link to their account in forwarded messages
43-
* @method int getForwardDate() Optional. For forwarded messages, date the original message was sent in Unix time
39+
* @method MessageOrigin getForwardOrigin() Optional. Information about the original message for forwarded messages
4440
* @method bool getIsTopicMessage() Optional. True, if the message is sent to a forum topic
4541
* @method bool getIsAutomaticForward() Optional. True, if the message is a channel post that was automatically forwarded to the connected discussion group
4642
* @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.
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<?php
2+
3+
namespace Longman\TelegramBot\Entities\MessageOrigin;
4+
5+
use Longman\TelegramBot\Entities\Entity;
6+
7+
/**
8+
* This object describes the origin of a message.
9+
*
10+
* @method string getType() Type of the message origin
11+
* @method int getDate() Date the message was sent originally in Unix time
12+
*/
13+
interface MessageOrigin
14+
{
15+
//
16+
}
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<?php
2+
3+
namespace Longman\TelegramBot\Entities\MessageOrigin;
4+
5+
use Longman\TelegramBot\Entities\Chat;
6+
use Longman\TelegramBot\Entities\Entity;
7+
8+
/**
9+
* The message was originally sent to a channel chat.
10+
*
11+
* @link https://core.telegram.org/bots/api#messageoriginchannel
12+
*
13+
* @method string getType() Type of the message origin, always “channel”
14+
* @method int getDate() Date the message was sent originally in Unix time
15+
* @method Chat getChat() Channel chat to which the message was originally sent
16+
* @method int getMessageId() Unique message identifier inside the chat
17+
* @method string getAuthorSignature() Optional. Signature of the original post author
18+
*/
19+
class MessageOriginChannel extends Entity implements MessageOrigin
20+
{
21+
protected function subEntities(): array
22+
{
23+
return [
24+
'chat' => Chat::class,
25+
];
26+
}
27+
28+
}
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<?php
2+
3+
namespace Longman\TelegramBot\Entities\MessageOrigin;
4+
5+
use Longman\TelegramBot\Entities\Chat;
6+
use Longman\TelegramBot\Entities\Entity;
7+
8+
/**
9+
* The message was originally sent on behalf of a chat to a group chat.
10+
*
11+
* @link https://core.telegram.org/bots/api#messageoriginchat
12+
*
13+
* @method string getType() Type of the message origin, always “chat”
14+
* @method int getDate() Date the message was sent originally in Unix time
15+
* @method Chat getChat() Chat that sent the message originally
16+
* @method string getAuthorSignature() Optional. For messages originally sent by an anonymous chat administrator, original message author signature
17+
*/
18+
class MessageOriginChat extends Entity implements MessageOrigin
19+
{
20+
protected function subEntities(): array
21+
{
22+
return [
23+
'sender_chat' => Chat::class,
24+
];
25+
}
26+
27+
}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<?php
2+
3+
namespace Longman\TelegramBot\Entities\MessageOrigin;
4+
5+
use Longman\TelegramBot\Entities\Entity;
6+
use Longman\TelegramBot\Entities\MessageOrigin\MessageOrigin;
7+
8+
/**
9+
* The message was originally sent by an unknown user.
10+
*
11+
* @link https://core.telegram.org/bots/api#messageoriginhiddenuser
12+
*
13+
* @method string getType() Type of the message origin, always “hidden_user”
14+
* @method int getDate() Date the message was sent originally in Unix time
15+
* @method string getSenderUserName() Name of the user that sent the message originally
16+
*/
17+
class MessageOriginHiddenUser extends Entity implements MessageOrigin
18+
{
19+
//
20+
}
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<?php
2+
3+
namespace Longman\TelegramBot\Entities\MessageOrigin;
4+
5+
use Longman\TelegramBot\Entities\Entity;
6+
use Longman\TelegramBot\Entities\User;
7+
8+
/**
9+
* The message was originally sent by a known user.
10+
*
11+
* @link https://core.telegram.org/bots/api#messageoriginuser
12+
*
13+
* @method string getType() Type of the message origin, always “user”
14+
* @method int getDate() Date the message was sent originally in Unix time
15+
* @method User getSenderUser() User that sent the message originally
16+
*/
17+
class MessageOriginUser extends Entity implements MessageOrigin
18+
{
19+
protected function subEntities(): array
20+
{
21+
return [
22+
'sender_user' => User::class,
23+
];
24+
}
25+
26+
}

0 commit comments

Comments
 (0)