Skip to content

Commit e90554a

Browse files
committed
Update readme, polling command name, required version telegram-bot-api and remove deprecated cs fixer rules.
1 parent e68b314 commit e90554a

File tree

4 files changed

+11
-23
lines changed

4 files changed

+11
-23
lines changed

.php-cs-fixer.dist.php

-6
Original file line numberDiff line numberDiff line change
@@ -71,12 +71,6 @@
7171
// Removes @param, @return and @var tags that don’t provide any useful information.
7272
'no_superfluous_phpdoc_tags' => true,
7373

74-
// Allow single line anonymous class and closure.
75-
'braces' => [
76-
'allow_single_line_anonymous_class_with_empty_body' => true,
77-
'allow_single_line_closure' => true,
78-
],
79-
8074
// Multi-line arrays, arguments list, parameters list and match expressions must have a trailing comma.
8175
'trailing_comma_in_multiline' => [
8276
'after_heredoc' => true,

README.md

+9-15
Original file line numberDiff line numberDiff line change
@@ -28,18 +28,12 @@ return [
2828
# config/packages/telegram_bot.yaml
2929

3030
telegram_bot:
31-
# Psr\Http\Client\ClientInterface implementation
32-
http_client: GuzzleHttp\ClientInterface
33-
# Psr\Http\Message\RequestFactoryInterface implementation
34-
request_factory: httpFactory
35-
# Psr\Http\Message\StreamFactoryInterface implementation
36-
stream_factory: httpFactory
37-
# Bot api token
38-
api_token: API_TOKEN
39-
# Optional. Secret token to protect webhook endpoint from unauthenticated requests
40-
#secret_token: CHANGE_ME
41-
# Optional. List of the update types you want your bot to receive.
42-
#allowed_updates: ['message','callback_query']
31+
http_client: GuzzleHttp\ClientInterface # Psr\Http\Client\ClientInterface implementation
32+
request_factory: GuzzleHttp\Psr7\HttpFactory # Psr\Http\Message\RequestFactoryInterface implementation
33+
stream_factory: GuzzleHttp\Psr7\HttpFactory # Psr\Http\Message\StreamFactoryInterface implementation
34+
api_token: API_TOKEN # Bot api token
35+
#secret_token: CHANGE_ME # Optional. Secret token to protect webhook endpoint from unauthenticated requests (update webhook url after change)
36+
#allowed_updates: ['message'] # Optional. List of the update types you want your bot to receive (update webhook url after change)
4337
```
4438

4539
### Optional. Configure webhook route
@@ -65,7 +59,7 @@ $ bin/console telegram:webhook:set --url=https://domain.xyz/telagram-webhook
6559
Use it in a development environment or if you can't provide public access to the webhook url.
6660
Run the polling daemon with the command:
6761
``` bash
68-
$ bin/console telegram:polling
62+
$ bin/console telegram:polling:start
6963
```
7064

7165
## Example of usage
@@ -78,7 +72,7 @@ use Luzrain\TelegramBotBundle\TelegramBot\TelegramCommand;
7872

7973
final class StartCommandController extends TelegramCommand
8074
{
81-
// Be aware to set default values for arguments as they won't necessarily will be passed
75+
// Be aware to set default values for command arguments as they won't necessarily will be passed
8276
#[OnCommand('/start')]
8377
public function __invoke(Type\Message $message, string $arg1 = '', string $arg2 = ''): Method
8478
{
@@ -94,7 +88,7 @@ use Luzrain\TelegramBotApi\Method;
9488
use Luzrain\TelegramBotApi\Type;
9589
use Luzrain\TelegramBotBundle\Attribute\OnEvent;
9690

97-
// It's not necessary to extend TelegramCommand
91+
// It's not necessary to extend TelegramCommand at all
9892
final class OnMessageController
9993
{
10094
#[OnEvent(Event\Message::class)]

composer.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
"php" : "^8.2",
2121
"symfony/console": "^6.3",
2222
"symfony/framework-bundle": "^6.3",
23-
"luzrain/telegram-bot-api": "^2.0"
23+
"luzrain/telegram-bot-api": "^2.1"
2424
},
2525
"require-dev": {
2626
"friendsofphp/php-cs-fixer": "^3.20",

src/TelegramBot/Command/PolllingCommand.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public function __construct(
2626

2727
public static function getDefaultName(): string
2828
{
29-
return 'telegram:polling';
29+
return 'telegram:polling:start';
3030
}
3131

3232
public static function getDefaultDescription(): string

0 commit comments

Comments
 (0)