Skip to content

Commit 586998f

Browse files
committed
Remove deprecated methods, update changelog
1 parent 98d7e86 commit 586998f

File tree

10 files changed

+13
-160
lines changed

10 files changed

+13
-160
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,14 @@ Exclamation symbols (:exclamation:) note something of importance e.g. breaking c
77
### Notes
88
- [:ledger: View file changes][Unreleased]
99
### Added
10+
- Bot API 6.2 (@OxMohsen) (#1350)
1011
### Changed
1112
### Deprecated
1213
### Removed
14+
- `VoiceChatX` entities, use `VideoChatX` entities instead.
15+
- `all_members_are_administrators` property from `Message` entity. Database column still exists, but may be removed in the future.
16+
- `Request::getChatMembersCount()`, use `Request::getChatMemberCount()` instead.
17+
- `Request::kickChatMember()`, use `Request::banChatMember()` instead.
1318
### Fixed
1419
### Security
1520

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@
77

88
A Telegram Bot based on the official [Telegram Bot API]
99

10-
[![API Version](https://img.shields.io/badge/Bot%20API-6.1%20%28June%202022%29-32a2da.svg)](https://core.telegram.org/bots/api#june-20-2022)
10+
[![API Version](https://img.shields.io/badge/Bot%20API-6.2%20%28August%202022%29-32a2da.svg)](https://core.telegram.org/bots/api#june-20-2022)
1111
[![Join the bot support group on Telegram](https://img.shields.io/badge/telegram-@PHP__Telegram__Bot__Support-64659d.svg)](https://telegram.me/PHP_Telegram_Bot_Support)
1212
[![Donate](https://img.shields.io/badge/%F0%9F%92%99-Donate%20%2F%20Support%20Us-blue.svg)](#donate)
1313

14-
[![Build Status](https://travis-ci.com/php-telegram-bot/core.svg?branch=master)](https://travis-ci.com/github/php-telegram-bot/core)
14+
[![Tests](https://github.com/php-telegram-bot/core/actions/workflows/tests.yaml/badge.svg)](https://github.com/php-telegram-bot/core/actions/workflows/tests.yaml)
1515
[![Code Coverage](https://img.shields.io/scrutinizer/coverage/g/php-telegram-bot/core/master.svg?style=flat)](https://scrutinizer-ci.com/g/php-telegram-bot/core/?b=master)
1616
[![Code Quality](https://img.shields.io/scrutinizer/g/php-telegram-bot/core/master.svg?style=flat)](https://scrutinizer-ci.com/g/php-telegram-bot/core/?b=master)
1717
[![Latest Stable Version](https://img.shields.io/packagist/v/longman/telegram-bot.svg)](https://packagist.org/packages/longman/telegram-bot)
@@ -78,7 +78,7 @@ This Bot aims to provide a platform where one can simply write a bot and have in
7878

7979
The Bot can:
8080
- Retrieve updates with [webhook](#webhook-installation) and [getUpdates](#getupdates-installation) methods.
81-
- Supports all types and methods according to Telegram Bot API 6.1 (June 2022).
81+
- Supports all types and methods according to Telegram Bot API 6.2 (August 2022).
8282
- Supports supergroups.
8383
- Handle commands in chat with other bots.
8484
- Manage Channel from the bot admin interface.
@@ -389,15 +389,15 @@ The reason for denying an update can be defined with the `$reason` parameter. Th
389389

390390
### Types
391391

392-
All types are implemented according to Telegram API 6.1 (June 2022).
392+
All types are implemented according to Telegram API 6.2 (August 2022).
393393

394394
### Inline Query
395395

396-
Full support for inline query according to Telegram API 6.1 (June 2022).
396+
Full support for inline query according to Telegram API 6.2 (August 2022).
397397

398398
### Methods
399399

400-
All methods are implemented according to Telegram API 6.1 (June 2022).
400+
All methods are implemented according to Telegram API 6.2 (August 2022).
401401

402402
#### Send Message
403403

src/DB.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -493,16 +493,15 @@ public static function insertChat(Chat $chat, ?string $date = null, ?int $migrat
493493
try {
494494
$sth = self::$pdo->prepare('
495495
INSERT IGNORE INTO `' . TB_CHAT . '`
496-
(`id`, `type`, `title`, `username`, `first_name`, `last_name`, `all_members_are_administrators`, `created_at` ,`updated_at`, `old_id`)
496+
(`id`, `type`, `title`, `username`, `first_name`, `last_name`, `created_at` ,`updated_at`, `old_id`)
497497
VALUES
498-
(:id, :type, :title, :username, :first_name, :last_name, :all_members_are_administrators, :created_at, :updated_at, :old_id)
498+
(:id, :type, :title, :username, :first_name, :last_name, :created_at, :updated_at, :old_id)
499499
ON DUPLICATE KEY UPDATE
500500
`type` = VALUES(`type`),
501501
`title` = VALUES(`title`),
502502
`username` = VALUES(`username`),
503503
`first_name` = VALUES(`first_name`),
504504
`last_name` = VALUES(`last_name`),
505-
`all_members_are_administrators` = VALUES(`all_members_are_administrators`),
506505
`updated_at` = VALUES(`updated_at`)
507506
');
508507

@@ -524,7 +523,6 @@ public static function insertChat(Chat $chat, ?string $date = null, ?int $migrat
524523
$sth->bindValue(':username', $chat->getUsername());
525524
$sth->bindValue(':first_name', $chat->getFirstName());
526525
$sth->bindValue(':last_name', $chat->getLastName());
527-
$sth->bindValue(':all_members_are_administrators', $chat->getAllMembersAreAdministrators(), PDO::PARAM_INT);
528526
$date = $date ?: self::getTimestamp();
529527
$sth->bindValue(':created_at', $date);
530528
$sth->bindValue(':updated_at', $date);

src/Entities/Chat.php

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -124,17 +124,4 @@ public function isChannel(): bool
124124
{
125125
return $this->getType() === 'channel';
126126
}
127-
128-
/**
129-
* Optional. True if a group has 'All Members Are Admins' enabled.
130-
*
131-
* @deprecated
132-
* @see Chat::getPermissions()
133-
*
134-
* @return bool|null
135-
*/
136-
public function getAllMembersAreAdministrators(): ?bool
137-
{
138-
return $this->getProperty('all_members_are_administrators');
139-
}
140127
}

src/Entities/Message.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -122,10 +122,6 @@ protected function subEntities(): array
122122
'successful_payment' => SuccessfulPayment::class,
123123
'passport_data' => PassportData::class,
124124
'proximity_alert_triggered' => ProximityAlertTriggered::class,
125-
'voice_chat_scheduled' => VoiceChatScheduled::class, // deprecated
126-
'voice_chat_started' => VoiceChatStarted::class, // deprecated
127-
'voice_chat_ended' => VoiceChatEnded::class, // deprecated
128-
'voice_chat_participants_invited' => VoiceChatParticipantsInvited::class, // deprecated
129125
'video_chat_scheduled' => VideoChatScheduled::class,
130126
'video_chat_started' => VideoChatStarted::class,
131127
'video_chat_ended' => VideoChatEnded::class,

src/Entities/VoiceChatEnded.php

Lines changed: 0 additions & 28 deletions
This file was deleted.

src/Entities/VoiceChatParticipantsInvited.php

Lines changed: 0 additions & 36 deletions
This file was deleted.

src/Entities/VoiceChatScheduled.php

Lines changed: 0 additions & 28 deletions
This file was deleted.

src/Entities/VoiceChatStarted.php

Lines changed: 0 additions & 26 deletions
This file was deleted.

src/Request.php

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -959,19 +959,4 @@ public static function kickChatMember(array $data = []): ServerResponse
959959
{
960960
return static::banChatMember($data);
961961
}
962-
963-
/**
964-
* Use this method to get the number of members in a chat. Returns Int on success.
965-
*
966-
* @deprecated
967-
* @see Request::getChatMemberCount()
968-
*
969-
* @param array $data
970-
*
971-
* @return ServerResponse
972-
*/
973-
public static function getChatMembersCount(array $data = []): ServerResponse
974-
{
975-
return static::getChatMemberCount($data);
976-
}
977962
}

0 commit comments

Comments
 (0)