Skip to content

Commit 7c22f26

Browse files
committed
Added the class ChatAdministratorRights and the methods setMyDefaultAdministratorRights and getMyDefaultAdministratorRights for managing the bot's default administrator rights.
1 parent 44ab572 commit 7c22f26

File tree

2 files changed

+41
-0
lines changed

2 files changed

+41
-0
lines changed
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
<?php
2+
3+
namespace Longman\TelegramBot\Entities;
4+
5+
/**
6+
* Represents the rights of an administrator in a chat.
7+
*
8+
* @method bool getIsAnonymous() True, if the user's presence in the chat is hidden
9+
* @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
10+
* @method bool getCanDeleteMessages() True, if the administrator can delete messages of other users
11+
* @method bool getCanManageVideoChats() True, if the administrator can manage video chats
12+
* @method bool getCanRestrictMembers() True, if the administrator can restrict, ban or unban chat members
13+
* @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)
14+
* @method bool getCanChangeInfo() True, if the user is allowed to change the chat title, photo and other settings
15+
* @method bool getCanInviteUsers() True, if the user is allowed to invite new users to the chat
16+
* @method bool getCanPostMessages() Optional. True, if the administrator can post in the channel; channels only
17+
* @method bool getCanEditMessages() Optional. True, if the administrator can edit messages of other users and can pin messages; channels only
18+
* @method bool getCanPinMessages() Optional. True, if the user is allowed to pin messages; groups and supergroups only
19+
*
20+
* @method $this setIsAnonymous(bool $is_anonymous) True, if the user's presence in the chat is hidden
21+
* @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
22+
* @method $this setCanDeleteMessages(bool $can_delete_messages) True, if the administrator can delete messages of other users
23+
* @method $this setCanManageVideoChats(bool $can_manage_video_chats) True, if the administrator can manage video chats
24+
* @method $this setCanRestrictMembers(bool $can_restrict_members) True, if the administrator can restrict, ban or unban chat members
25+
* @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)
26+
* @method $this setCanChangeInfo(bool $can_change_info) True, if the user is allowed to change the chat title, photo and other settings
27+
* @method $this setCanInviteUsers(bool $can_invite_users) True, if the user is allowed to invite new users to the chat
28+
* @method $this setCanPostMessages(bool $can_post_messages) Optional. True, if the administrator can post in the channel; channels only
29+
* @method $this setCanEditMessages(bool $can_edit_messages) Optional. True, if the administrator can edit messages of other users and can pin messages; channels only
30+
* @method $this setCanPinMessages(bool $can_pin_messages) Optional. True, if the user is allowed to pin messages; groups and supergroups only
31+
*/
32+
class ChatAdministratorRights extends Entity
33+
{
34+
35+
}

src/Request.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,8 @@
8989
* @method static ServerResponse getMyCommands(array $data) Use this method to get the current list of the bot's commands. Requires no parameters. Returns Array of BotCommand on success.
9090
* @method static ServerResponse setChatMenuButton(array $data) Use this method to change the bot's menu button in a private chat, or the default menu button. Returns True on success.
9191
* @method static ServerResponse getChatMenuButton(array $data) Use this method to get the current value of the bot's menu button in a private chat, or the default menu button. Returns MenuButton on success.
92+
* @method static ServerResponse setMyDefaultAdministratorRights(array $data) Use this method to change the default administrator rights requested by the bot when it's added as an administrator to groups or channels. These rights will be suggested to users, but they are are free to modify the list before adding the bot. Returns True on success.
93+
* @method static ServerResponse getMyDefaultAdministratorRights(array $data) Use this method to get the current default administrator rights of the bot. Returns ChatAdministratorRights on success.
9294
* @method static ServerResponse editMessageText(array $data) Use this method to edit text and game messages sent by the bot or via the bot (for inline bots). On success, if edited message is sent by the bot, the edited Message is returned, otherwise True is returned.
9395
* @method static ServerResponse editMessageCaption(array $data) Use this method to edit captions of messages sent by the bot or via the bot (for inline bots). On success, if edited message is sent by the bot, the edited Message is returned, otherwise True is returned.
9496
* @method static ServerResponse editMessageMedia(array $data) Use this method to edit audio, document, photo, or video messages. On success, if the edited message was sent by the bot, the edited Message is returned, otherwise True is returned.
@@ -236,6 +238,8 @@ class Request
236238
'getMyCommands',
237239
'setChatMenuButton',
238240
'getChatMenuButton',
241+
'setMyDefaultAdministratorRights',
242+
'getMyDefaultAdministratorRights',
239243
'editMessageText',
240244
'editMessageCaption',
241245
'editMessageMedia',
@@ -276,6 +280,8 @@ class Request
276280
'getMyCommands',
277281
'setChatMenuButton',
278282
'getChatMenuButton',
283+
'setMyDefaultAdministratorRights',
284+
'getMyDefaultAdministratorRights',
279285
];
280286

281287
/**

0 commit comments

Comments
 (0)