@@ -28,18 +28,12 @@ return [
28
28
# config/packages/telegram_bot.yaml
29
29
30
30
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)
43
37
```
44
38
45
39
### Optional. Configure webhook route
@@ -65,7 +59,7 @@ $ bin/console telegram:webhook:set --url=https://domain.xyz/telagram-webhook
65
59
Use it in a development environment or if you can't provide public access to the webhook url.
66
60
Run the polling daemon with the command:
67
61
``` bash
68
- $ bin/console telegram:polling
62
+ $ bin/console telegram:polling:start
69
63
```
70
64
71
65
## Example of usage
@@ -78,7 +72,7 @@ use Luzrain\TelegramBotBundle\TelegramBot\TelegramCommand;
78
72
79
73
final class StartCommandController extends TelegramCommand
80
74
{
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
82
76
#[OnCommand('/start')]
83
77
public function __invoke(Type\Message $message, string $arg1 = '', string $arg2 = ''): Method
84
78
{
@@ -94,7 +88,7 @@ use Luzrain\TelegramBotApi\Method;
94
88
use Luzrain\TelegramBotApi\Type;
95
89
use Luzrain\TelegramBotBundle\Attribute\OnEvent;
96
90
97
- // It's not necessary to extend TelegramCommand
91
+ // It's not necessary to extend TelegramCommand at all
98
92
final class OnMessageController
99
93
{
100
94
#[OnEvent(Event\Message::class)]
0 commit comments