File tree 4 files changed +9
-10
lines changed
4 files changed +9
-10
lines changed Original file line number Diff line number Diff line change 4
4
5
5
use Illuminate \Support \Str ;
6
6
use Telegram \Bot \Bot ;
7
- use Telegram \Bot \Helpers \Util ;
8
- use Telegram \Bot \Laravel \Facades \Telegram ;
9
7
use Telegram \Bot \Exceptions \TelegramSDKException ;
8
+ use Telegram \Bot \Helpers \Util ;
10
9
use Telegram \Bot \Laravel \Console \ConsoleBaseCommand ;
11
10
use Throwable ;
12
11
@@ -59,7 +58,7 @@ protected function setupWebhook(Bot $bot): void
59
58
->merge ($ config )
60
59
->put ('url ' , $ this ->webhookUrl ($ bot ));
61
60
62
- if (filled ($ secretToken )) {
61
+ if (filled ($ secretToken )) {
63
62
$ params ->put ('secret_token ' , Util::secretToken ($ secretToken ));
64
63
}
65
64
Original file line number Diff line number Diff line change 4
4
5
5
use Closure ;
6
6
use Illuminate \Http \Request ;
7
- use Telegram \Bot \Helpers \Util ;
8
7
use Telegram \Bot \Exceptions \TelegramSDKException ;
8
+ use Telegram \Bot \Helpers \Util ;
9
9
use Telegram \Bot \Laravel \Facades \Telegram ;
10
10
11
11
class ValidateWebhook
Original file line number Diff line number Diff line change 2
2
3
3
namespace Telegram \Bot \Laravel ;
4
4
5
+ use Illuminate \Contracts \Support \DeferrableProvider ;
5
6
use Illuminate \Support \Facades \Route ;
6
7
use Illuminate \Support \ServiceProvider ;
7
8
use Telegram \Bot \Api ;
8
9
use Telegram \Bot \Bot ;
9
10
use Telegram \Bot \BotManager ;
10
- use Illuminate \Contracts \Support \DeferrableProvider ;
11
11
use Telegram \Bot \Laravel \Console \Command \CommandListCommand ;
12
12
use Telegram \Bot \Laravel \Console \Command \CommandMakeCommand ;
13
13
use Telegram \Bot \Laravel \Console \Command \CommandRegisterCommand ;
Original file line number Diff line number Diff line change 1
1
<?php
2
2
3
- use Telegram \Bot \Objects \ResponseObject ;
4
3
use Telegram \Bot \Laravel \Facades \Telegram ;
4
+ use Telegram \Bot \Objects \ResponseObject ;
5
5
6
6
test ('fake returns the given response ' , function () {
7
7
Telegram::fake ([
8
8
ResponseObject::make ([
9
- 'id ' => 123456789 ,
9
+ 'id ' => 123456789 ,
10
10
'first_name ' => 'Test ' ,
11
- 'username ' => 'testbot ' ,
12
- ])
11
+ 'username ' => 'testbot ' ,
12
+ ]),
13
13
]);
14
14
15
15
$ response = Telegram::sendMessage ([
16
16
'chat_id ' => 987654321 ,
17
- 'text ' => 'Hello World ' ,
17
+ 'text ' => 'Hello World ' ,
18
18
]);
19
19
20
20
expect ($ response ['id ' ])->toBe (123456789 );
You can’t perform that action at this time.
0 commit comments