-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
DeleteWebhookMethod.php
40 lines (34 loc) · 1 KB
/
DeleteWebhookMethod.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<?php
namespace Kolirt\Telegram\Core\Methods\Updates;
use GuzzleHttp\Exception\GuzzleException;
use Illuminate\Http\Client\ConnectionException;
use Illuminate\Http\Client\PendingRequest;
/**
* @see https://core.telegram.org/bots/api#deletewebhook
*/
trait DeleteWebhookMethod
{
/**
* Use this method to remove webhook integration if you decide to switch
* back to getUpdates. Returns True on success.
*
* @param bool|null $drop_pending_updates
*
* @return DeleteWebhookResponse
*
* @throws ConnectionException
* @throws GuzzleException
*/
public function deleteWebhook(
bool|null $drop_pending_updates = null
): DeleteWebhookResponse
{
/**
* @var PendingRequest $this ->client
*/
$response = $this->client->post('deleteWebhook', request_params([
'drop_pending_updates' => $drop_pending_updates
]))->getBody();
return new DeleteWebhookResponse(json_decode($response, true));
}
}