Skip to content

Commit

Permalink
Remove deprecated methods, update changelog
Browse files Browse the repository at this point in the history
  • Loading branch information
noplanman committed Aug 18, 2022
1 parent 98d7e86 commit 586998f
Show file tree
Hide file tree
Showing 10 changed files with 13 additions and 160 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,14 @@ Exclamation symbols (:exclamation:) note something of importance e.g. breaking c
### Notes
- [:ledger: View file changes][Unreleased]
### Added
- Bot API 6.2 (@OxMohsen) (#1350)
### Changed
### Deprecated
### Removed
- `VoiceChatX` entities, use `VideoChatX` entities instead.
- `all_members_are_administrators` property from `Message` entity. Database column still exists, but may be removed in the future.
- `Request::getChatMembersCount()`, use `Request::getChatMemberCount()` instead.
- `Request::kickChatMember()`, use `Request::banChatMember()` instead.
### Fixed
### Security

Expand Down
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@

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

[![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)
[![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)
[![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)
[![Donate](https://img.shields.io/badge/%F0%9F%92%99-Donate%20%2F%20Support%20Us-blue.svg)](#donate)

[![Build Status](https://travis-ci.com/php-telegram-bot/core.svg?branch=master)](https://travis-ci.com/github/php-telegram-bot/core)
[![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)
[![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)
[![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)
[![Latest Stable Version](https://img.shields.io/packagist/v/longman/telegram-bot.svg)](https://packagist.org/packages/longman/telegram-bot)
Expand Down Expand Up @@ -78,7 +78,7 @@ This Bot aims to provide a platform where one can simply write a bot and have in

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

### Types

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

### Inline Query

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

### Methods

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

#### Send Message

Expand Down
6 changes: 2 additions & 4 deletions src/DB.php
Original file line number Diff line number Diff line change
Expand Up @@ -493,16 +493,15 @@ public static function insertChat(Chat $chat, ?string $date = null, ?int $migrat
try {
$sth = self::$pdo->prepare('
INSERT IGNORE INTO `' . TB_CHAT . '`
(`id`, `type`, `title`, `username`, `first_name`, `last_name`, `all_members_are_administrators`, `created_at` ,`updated_at`, `old_id`)
(`id`, `type`, `title`, `username`, `first_name`, `last_name`, `created_at` ,`updated_at`, `old_id`)
VALUES
(:id, :type, :title, :username, :first_name, :last_name, :all_members_are_administrators, :created_at, :updated_at, :old_id)
(:id, :type, :title, :username, :first_name, :last_name, :created_at, :updated_at, :old_id)
ON DUPLICATE KEY UPDATE
`type` = VALUES(`type`),
`title` = VALUES(`title`),
`username` = VALUES(`username`),
`first_name` = VALUES(`first_name`),
`last_name` = VALUES(`last_name`),
`all_members_are_administrators` = VALUES(`all_members_are_administrators`),
`updated_at` = VALUES(`updated_at`)
');

Expand All @@ -524,7 +523,6 @@ public static function insertChat(Chat $chat, ?string $date = null, ?int $migrat
$sth->bindValue(':username', $chat->getUsername());
$sth->bindValue(':first_name', $chat->getFirstName());
$sth->bindValue(':last_name', $chat->getLastName());
$sth->bindValue(':all_members_are_administrators', $chat->getAllMembersAreAdministrators(), PDO::PARAM_INT);
$date = $date ?: self::getTimestamp();
$sth->bindValue(':created_at', $date);
$sth->bindValue(':updated_at', $date);
Expand Down
13 changes: 0 additions & 13 deletions src/Entities/Chat.php
Original file line number Diff line number Diff line change
Expand Up @@ -124,17 +124,4 @@ public function isChannel(): bool
{
return $this->getType() === 'channel';
}

/**
* Optional. True if a group has 'All Members Are Admins' enabled.
*
* @deprecated
* @see Chat::getPermissions()
*
* @return bool|null
*/
public function getAllMembersAreAdministrators(): ?bool
{
return $this->getProperty('all_members_are_administrators');
}
}
4 changes: 0 additions & 4 deletions src/Entities/Message.php
Original file line number Diff line number Diff line change
Expand Up @@ -122,10 +122,6 @@ protected function subEntities(): array
'successful_payment' => SuccessfulPayment::class,
'passport_data' => PassportData::class,
'proximity_alert_triggered' => ProximityAlertTriggered::class,
'voice_chat_scheduled' => VoiceChatScheduled::class, // deprecated
'voice_chat_started' => VoiceChatStarted::class, // deprecated
'voice_chat_ended' => VoiceChatEnded::class, // deprecated
'voice_chat_participants_invited' => VoiceChatParticipantsInvited::class, // deprecated
'video_chat_scheduled' => VideoChatScheduled::class,
'video_chat_started' => VideoChatStarted::class,
'video_chat_ended' => VideoChatEnded::class,
Expand Down
28 changes: 0 additions & 28 deletions src/Entities/VoiceChatEnded.php

This file was deleted.

36 changes: 0 additions & 36 deletions src/Entities/VoiceChatParticipantsInvited.php

This file was deleted.

28 changes: 0 additions & 28 deletions src/Entities/VoiceChatScheduled.php

This file was deleted.

26 changes: 0 additions & 26 deletions src/Entities/VoiceChatStarted.php

This file was deleted.

15 changes: 0 additions & 15 deletions src/Request.php
Original file line number Diff line number Diff line change
Expand Up @@ -959,19 +959,4 @@ public static function kickChatMember(array $data = []): ServerResponse
{
return static::banChatMember($data);
}

/**
* Use this method to get the number of members in a chat. Returns Int on success.
*
* @deprecated
* @see Request::getChatMemberCount()
*
* @param array $data
*
* @return ServerResponse
*/
public static function getChatMembersCount(array $data = []): ServerResponse
{
return static::getChatMemberCount($data);
}
}

0 comments on commit 586998f

Please sign in to comment.