Skip to content

Commit 7ecda69

Browse files
committed
Version 0.70.0
1 parent 2841a5d commit 7ecda69

File tree

5 files changed

+38
-25
lines changed

5 files changed

+38
-25
lines changed

CHANGELOG.md

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,24 @@ Exclamation symbols (:exclamation:) note something of importance e.g. breaking c
77
### Notes
88
- [:ledger: View file changes][Unreleased]
99
### Added
10-
- Bot API 5.0 (Big update!).
1110
### Changed
12-
- Upgrade code to PHP 7.3. (#1136, )
13-
- Speed up clean query (@dva-re) (#1139)
14-
- Various code prettifications (@akalongman) (#1140, #1141, #1142, #1143)
1511
### Deprecated
1612
### Removed
1713
### Fixed
1814
### Security
19-
- Minimum PHP 7.3. (#1136, )
15+
16+
## [0.70.0] - 2020-12-21
17+
### Notes
18+
- [:ledger: View file changes][0.70.0][:page_with_curl: DB migration script][0.70.0-sql-migration]
19+
- [:exclamation:][0.70.0-bc-minimum-php-73] PHP 7.3+ required, so make sure your code is up to date with correct types!
20+
### Added
21+
- Bot API 5.0 (Big update!). (#1147)
22+
### Changed
23+
- Upgrade code to PHP 7.3. (#1136, #1158)
24+
- Speed up `/clean` query. (@dva-re) (#1139)
25+
- Various code prettifications. (@akalongman) (#1140, #1141, #1142, #1143)
26+
### Security
27+
- Minimum PHP 7.3, allow PHP 8.0. (#1136, #1158)
2028

2129
## [0.64.0] - 2020-10-04
2230
### Notes
@@ -341,7 +349,7 @@ Exclamation symbols (:exclamation:) note something of importance e.g. breaking c
341349
- [:ledger: View file changes][0.45.0][:page_with_curl: DB migration script][0.45.0-sql-migration]
342350
### Added
343351
- Documents can be sent by providing its contents via Psr7 stream (as opposed to passing a file path).
344-
- Allow setting a custom Guzzle HTTP Client for requests (#511).
352+
- Allow setting a custom Guzzle HTTP Client for requests (#511, #536).
345353
- First implementations towards Bots API 3.0.
346354
### Changed
347355
- [:exclamation:][0.45.0-bc-chats-params-array] `Request::sendToActiveChats` and `DB::selectChats` now accept parameters as an options array and allow selecting of channels.
@@ -471,6 +479,8 @@ Exclamation symbols (:exclamation:) note something of importance e.g. breaking c
471479
### Deprecated
472480
- Move `hideKeyboard` to `removeKeyboard`.
473481

482+
[0.70.0-sql-migration]: https://github.com/php-telegram-bot/core/tree/master/utils/db-schema-update/0.64.0-0.70.0.sql
483+
[0.70.0-bc-minimum-php-73]: https://github.com/php-telegram-bot/core/wiki/Breaking-backwards-compatibility#minimum-php-73
474484
[0.63.0-sql-migration]: https://github.com/php-telegram-bot/core/tree/master/utils/db-schema-update/0.62.0-0.63.0.sql
475485
[0.63.0-bc-static-method-entityescapemarkdown]: https://github.com/php-telegram-bot/core/wiki/Breaking-backwards-compatibility#static-method-entityescapemarkdown
476486
[0.62.0-sql-migration]: https://github.com/php-telegram-bot/core/tree/master/utils/db-schema-update/0.61.1-0.62.0.sql
@@ -501,6 +511,7 @@ Exclamation symbols (:exclamation:) note something of importance e.g. breaking c
501511
[Tidelift]: https://tidelift.com/subscription/pkg/packagist-longman-telegram-bot?utm_source=packagist-longman-telegram-bot&utm_medium=referral&utm_campaign=changelog
502512

503513
[Unreleased]: https://github.com/php-telegram-bot/core/compare/master...develop
514+
[0.70.0]: https://github.com/php-telegram-bot/core/compare/0.64.0...0.70.0
504515
[0.64.0]: https://github.com/php-telegram-bot/core/compare/0.63.1...0.64.0
505516
[0.63.1]: https://github.com/php-telegram-bot/core/compare/0.63.0...0.63.1
506517
[0.63.0]: https://github.com/php-telegram-bot/core/compare/0.62.0...0.63.0

README.md

Lines changed: 20 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ Create *composer.json* file
175175
"name": "yourproject/yourproject",
176176
"type": "project",
177177
"require": {
178-
"php": ">=5.5",
178+
"php": ">=7.3",
179179
"longman/telegram-bot": "*"
180180
}
181181
}
@@ -207,7 +207,7 @@ Note: For a more detailed explanation, head over to the [example-bot repository]
207207
In order to set a [Webhook][api-setwebhook] you need a server with HTTPS and composer support.
208208
(For a [self signed certificate](#self-signed-certificate) you need to add some extra code)
209209

210-
Create [*set.php*][set.php] with the following contents:
210+
Create *[set.php]* with the following contents:
211211
```php
212212
<?php
213213
// Load composer
@@ -235,7 +235,7 @@ try {
235235
Open your *set.php* via the browser to register the webhook with Telegram.
236236
You should see `Webhook was set`.
237237

238-
Now, create [*hook.php*][hook.php] with the following contents:
238+
Now, create *[hook.php]* with the following contents:
239239
```php
240240
<?php
241241
// Load composer
@@ -259,20 +259,20 @@ try {
259259

260260
### Self Signed Certificate
261261

262-
To upload the certificate, add the certificate path as a parameter in *set.php*:
262+
Upload the certificate and add the path as a parameter in *set.php*:
263263
```php
264264
$result = $telegram->setWebhook($hook_url, ['certificate' => '/path/to/certificate']);
265265
```
266266

267267
### Unset Webhook
268268

269-
Edit [*unset.php*][unset.php] with your bot credentials and execute it.
269+
Edit *[unset.php]* with your bot credentials and execute it.
270270

271271
## getUpdates installation
272272

273273
For best performance, the MySQL database should be enabled for the `getUpdates` method!
274274

275-
Create [*getUpdatesCLI.php*][getUpdatesCLI.php] with the following contents:
275+
Create *[getUpdatesCLI.php]* with the following contents:
276276
```php
277277
#!/usr/bin/env php
278278
<?php
@@ -325,15 +325,15 @@ $telegram->useGetUpdatesWithoutDatabase();
325325

326326
### Types
327327

328-
All types are implemented according to Telegram API (20 January 2016).
328+
All types are implemented according to Telegram API 5.0 (November 2020).
329329

330330
### Inline Query
331331

332-
Full support for inline query according to Telegram API (20 January 2016).
332+
Full support for inline query according to Telegram API 5.0 (November 2020).
333333

334334
### Methods
335335

336-
All methods are implemented according to Telegram API (20 January 2016).
336+
All methods are implemented according to Telegram API 5.0 (November 2020).
337337

338338
#### Send Message
339339

@@ -376,7 +376,7 @@ $result = Request::sendPhoto([
376376
```
377377

378378
*sendAudio*, *sendDocument*, *sendAnimation*, *sendSticker*, *sendVideo*, *sendVoice* and *sendVideoNote* all work in the same way, just check the [API documentation](https://core.telegram.org/bots/api#sendphoto) for the exact usage.
379-
See the [*ImageCommand.php*][ImageCommand.php] for a full example.
379+
See the *[ImageCommand.php]* for a full example.
380380

381381
#### Send Chat Action
382382

@@ -389,11 +389,11 @@ Request::sendChatAction([
389389

390390
#### getUserProfilePhoto
391391

392-
Retrieve the user photo, see [*WhoamiCommand.php*][WhoamiCommand.php] for a full example.
392+
Retrieve the user photo. (see *[WhoamiCommand.php]* for a full example)
393393

394394
#### getFile and downloadFile
395395

396-
Get the file path and download it, see [*WhoamiCommand.php*][WhoamiCommand.php] for a full example.
396+
Get the file path and download it. (see *[WhoamiCommand.php]* for a full example)
397397

398398
#### Send message to all active chats
399399

@@ -418,6 +418,7 @@ You can also broadcast a message to users, from the private chat with your bot.
418418
#### Filter Update
419419

420420
Update processing can be allowed or denied by defining a custom update filter.
421+
421422
Let's say we only want to allow messages from a user with ID 428, we can do the following before handling the request:
422423

423424
```php
@@ -438,7 +439,7 @@ The reason for denying an update can be defined with the `$reason` parameter. Th
438439

439440
### MySQL storage (Recommended)
440441

441-
If you want to save messages/users/chats for further usage in commands, create a new database (`utf8mb4_unicode_520_ci`), import *structure.sql* and enable MySQL support after object creation and BEFORE `handle()` method:
442+
If you want to save messages/users/chats for further usage in commands, create a new database (`utf8mb4_unicode_520_ci`), import *[structure.sql]* and enable MySQL support BEFORE `handle()` method:
442443

443444
```php
444445
$mysql_credentials = [
@@ -466,7 +467,7 @@ It is possible to provide the library with an external MySQL PDO connection.
466467
Here's how to configure it:
467468

468469
```php
469-
$telegram->enableExternalMySql($external_pdo_connection)
470+
$telegram->enableExternalMySql($external_pdo_connection);
470471
//$telegram->enableExternalMySql($external_pdo_connection, $table_prefix)
471472
```
472473
### Channels Support
@@ -535,7 +536,7 @@ Enabling this feature, the bot admin can perform some super user commands like:
535536
- Post any content to your channels */sendtochannel*
536537
- Inspect a user or a chat with */whois*
537538

538-
Take a look at all default admin commands stored in the [*src/Commands/AdminCommands/*][AdminCommands-folder] folder.
539+
Take a look at all default admin commands stored in the *[src/Commands/AdminCommands/][AdminCommands-folder]* folder.
539540

540541
#### Set Admins
541542

@@ -551,14 +552,14 @@ $telegram->enableAdmins([
551552
other_telegram_user_id,
552553
]);
553554
```
554-
Telegram user id can be retrieved with the [*/whoami*][WhoamiCommand.php] command.
555+
Telegram user id can be retrieved with the *[/whoami][WhoamiCommand.php]* command.
555556

556557
#### Channel Administration
557558

558559
To enable this feature follow these steps:
559560
- Add your bot as channel administrator, this can be done with any Telegram client.
560561
- Enable admin interface for your user as explained in the admin section above.
561-
- Enter your channel name as a parameter for the [*/sendtochannel*][SendtochannelCommand.php] command:
562+
- Enter your channel name as a parameter for the *[/sendtochannel][SendtochannelCommand.php]* command:
562563
```php
563564
$telegram->setCommandConfig('sendtochannel', [
564565
'your_channel' => [
@@ -668,7 +669,8 @@ Credit list in [CREDITS](CREDITS)
668669
[WhoamiCommand.php]: https://github.com/php-telegram-bot/example-bot/blob/master/Commands/WhoamiCommand.php "example /whoami command"
669670
[HelpCommand.php]: https://github.com/php-telegram-bot/example-bot/blob/master/Commands/HelpCommand.php "example /help command"
670671
[SendtochannelCommand.php]: https://github.com/php-telegram-bot/core/blob/master/src/Commands/AdminCommands/SendtochannelCommand.php "/sendtochannel admin command"
671-
[DB::selectChats]: https://github.com/php-telegram-bot/core/blob/0.46.0/src/DB.php#L1000 "DB::selectChats() parameters"
672+
[DB::selectChats]: https://github.com/php-telegram-bot/core/blob/0.70.0/src/DB.php#L1148 "DB::selectChats() parameters"
673+
[structure.sql]: https://github.com/php-telegram-bot/core/blob/master/structure.sql "DB structure for importing"
672674
[Uncyclo]: https://github.com/php-telegram-bot/core/wiki "PHP Telegram Bot Uncyclo"
673675
[wiki-create-your-own-commands]: https://github.com/php-telegram-bot/core/wiki/Create-your-own-commands "Create your own commands"
674676
[issues]: https://github.com/php-telegram-bot/core/issues "PHP Telegram Bot Issues"

logo.png

9.91 KB
Loading

src/Telegram.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ class Telegram
3434
*
3535
* @var string
3636
*/
37-
protected $version = '0.64.0';
37+
protected $version = '0.70.0';
3838

3939
/**
4040
* Telegram API key

0 commit comments

Comments
 (0)