Skip to content

Commit

Permalink
Bot API 6.9
Browse files Browse the repository at this point in the history
  • Loading branch information
punyflash committed Oct 6, 2023
1 parent 43eb069 commit 62a228f
Show file tree
Hide file tree
Showing 8 changed files with 56 additions and 2 deletions.
5 changes: 4 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -129,4 +129,7 @@ All notable changes to `telebot` will be documented in this file
- Laravel support migrated to separate package

## 3.1.0 - 2023-09-07
- Updated [Bot API](https://core.telegram.org/bots/api) to version 6.8
- Updated [Bot API](https://core.telegram.org/bots/api) to version 6.8

## 3.1.1 - 2023-10-06
- Updated [Bot API](https://core.telegram.org/bots/api) to version 6.9
5 changes: 4 additions & 1 deletion docs/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -129,4 +129,7 @@ All notable changes to `telebot` will be documented here
- Laravel support migrated to separate package

## 3.1.0 - 2023-09-07
- Updated [Bot API](https://core.telegram.org/bots/api) to version 6.8
- Updated [Bot API](https://core.telegram.org/bots/api) to version 6.8

## 3.1.1 - 2023-10-06
- Updated [Bot API](https://core.telegram.org/bots/api) to version 6.9
6 changes: 6 additions & 0 deletions src/Methods/PromoteChatMemberMethod.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@
* @property bool $can_change_info __Required: Optional__. Pass True, if the administrator can change chat title, photo and other settings
* @property bool $can_invite_users __Required: Optional__. Pass True, if the administrator can invite new users to the chat
* @property bool $can_pin_messages __Required: Optional__. Pass True, if the administrator can pin messages, supergroups only
* @property bool $can_post_stories __Required: Optional__. Pass True if the administrator can post stories in the channel; channels only
* @property bool $can_edit_stories __Required: Optional__. Pass True if the administrator can edit stories posted by other users; channels only
* @property bool $can_delete_stories __Required: Optional__. Pass True if the administrator can delete stories posted by other users; channels only
* @property bool $can_manage_topics __Required: Optional__. Pass True if the user is allowed to create, rename, close, and reopen forum topics, supergroups only
*/
class PromoteChatMemberMethod extends TelegramMethod
Expand All @@ -42,6 +45,9 @@ class PromoteChatMemberMethod extends TelegramMethod
'can_change_info' => 'boolean',
'can_invite_users' => 'boolean',
'can_pin_messages' => 'boolean',
'can_post_stories' => 'boolean',
'can_edit_stories' => 'boolean',
'can_delete_stories' => 'boolean',
'can_manage_topics' => 'boolean',
];

Expand Down
6 changes: 6 additions & 0 deletions src/Objects/ChatAdministratorRights.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@
* @property bool $can_post_messages Optional. True, if the administrator can post in the channel; channels only
* @property bool $can_edit_messages Optional. True, if the administrator can edit messages of other users and can pin messages; channels only
* @property bool $can_pin_messages Optional. True, if the user is allowed to pin messages; groups and supergroups only
* @property bool $can_post_stories Optional. True, if the administrator can post stories in the channel; channels only
* @property bool $can_edit_stories Optional. True, if the administrator can edit stories posted by other users; channels only
* @property bool $can_delete_stories Optional. True, if the administrator can delete stories posted by other users; channels only
* @property bool $can_manage_topics Optional. True, if the user is allowed to create, rename, close, and reopen forum topics; supergroups only
*/
class ChatAdministratorRights extends TelegramObject
Expand All @@ -34,6 +37,9 @@ class ChatAdministratorRights extends TelegramObject
'can_post_messages' => 'boolean',
'can_edit_messages' => 'boolean',
'can_pin_messages' => 'boolean',
'can_post_stories' => 'boolean',
'can_edit_stories' => 'boolean',
'can_delete_stories' => 'boolean',
'can_manage_topics' => 'boolean',
];
}
6 changes: 6 additions & 0 deletions src/Objects/ChatMemberAdministrator.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@
* @property bool $can_post_messages Optional. True, if the administrator can post in the channel; channels only
* @property bool $can_edit_messages Optional. True, if the administrator can edit messages of other users and can pin messages; channels only
* @property bool $can_pin_messages Optional. True, if the user is allowed to pin messages; groups and supergroups only
* @property bool $can_post_stories Optional. True, if the administrator can post stories in the channel; channels only
* @property bool $can_edit_stories Optional. True, if the administrator can edit stories posted by other users; channels only
* @property bool $can_delete_stories Optional. True, if the administrator can delete stories posted by other users; channels only
* @property bool $can_manage_topics Optional. True, if the user is allowed to create, rename, close, and reopen forum topics; supergroups only
* @property string $custom_title Optional. Custom title for this user
*/
Expand All @@ -39,6 +42,9 @@ class ChatMemberAdministrator extends ChatMember
'can_post_messages' => 'boolean',
'can_edit_messages' => 'boolean',
'can_pin_messages' => 'boolean',
'can_post_stories' => 'boolean',
'can_edit_stories' => 'boolean',
'can_delete_stories' => 'boolean',
'can_manage_topics' => 'boolean',
'custom_title' => 'string',
];
Expand Down
4 changes: 4 additions & 0 deletions src/Objects/WriteAccessAllowed.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,15 @@
/**
* This object represents a service message about a user allowing a bot to write messages after adding the bot to the attachment menu or launching a Web App from a link.
*
* @property boolean $from_request Optional. True, if the access was granted after the user accepted an explicit request from a Web App sent by the method `requestWriteAccess`
* @property string $web_app_name Optional. Name of the Web App which was launched from a link
* @property boolean $from_attachment_menu Optional. True, if the access was granted when the bot was added to the attachment or side menu
*/
class WriteAccessAllowed extends TelegramObject
{
protected $attributes = [
'from_request' => 'boolean',
'web_app_name' => 'string',
'from_attachment_menu' => 'boolean',
];
}
23 changes: 23 additions & 0 deletions src/Testing/Server.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?php

namespace WeStacks\TeleBot\Testing;

use GuzzleHttp\Handler\MockHandler;
use GuzzleHttp\Promise\PromiseInterface;
use Psr\Http\Message\RequestInterface;

class Server
{
protected int $updateId = 1;
protected int $messageId = 1;
protected int $callbackQueryId = 1;

public function __construct(
protected string $baseUrl
) {}

public function __invoke(RequestInterface $request, array $options): PromiseInterface
{
$request->getUri();
}
}
3 changes: 3 additions & 0 deletions src/Traits/HasTelegramMethods.php
Original file line number Diff line number Diff line change
Expand Up @@ -427,6 +427,9 @@
* - _bool_ `$can_change_info` __Required: Optional__. Pass True, if the administrator can change chat title, photo and other settings
* - _bool_ `$can_invite_users` __Required: Optional__. Pass True, if the administrator can invite new users to the chat
* - _bool_ `$can_pin_messages` __Required: Optional__. Pass True, if the administrator can pin messages, supergroups only
* - _bool_ `$can_post_stories` __Required: Optional__. Pass True if the administrator can post stories in the channel; channels only
* - _bool_ `$can_edit_stories` __Required: Optional__. Pass True if the administrator can edit stories posted by other users; channels only
* - _bool_ `$can_delete_stories` __Required: Optional__. Pass True if the administrator can delete stories posted by other users; channels only
* - _bool_ `$can_manage_topics` __Required: Optional__. Pass True if the user is allowed to create, rename, close, and reopen forum topics, supergroups only
* @method bool|PromiseInterface restrictChatMember(array $parameters = []) Use this method to restrict a user in a supergroup. The bot must be an administrator in the supergroup for this to work and must have the appropriate administrator rights. Pass True for all permissions to lift restrictions from a user. Returns True on success.
*
Expand Down

0 comments on commit 62a228f

Please sign in to comment.