Skip to content

Commit ae84c26

Browse files
committed
Allow passing data to Telegram::deleteWebhook() and Request::deleteWebhook() methods
Fixes #1206
1 parent 2282f7e commit ae84c26

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

src/Request.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
*
2929
* @method static ServerResponse getUpdates(array $data) Use this method to receive incoming updates using long polling (wiki). An Array of Update objects is returned.
3030
* @method static ServerResponse setWebhook(array $data) Use this method to specify a url and receive incoming updates via an outgoing webhook. Whenever there is an update for the bot, we will send an HTTPS POST request to the specified url, containing a JSON-serialized Update. In case of an unsuccessful request, we will give up after a reasonable amount of attempts. Returns true.
31-
* @method static ServerResponse deleteWebhook() Use this method to remove webhook integration if you decide to switch back to getUpdates. Returns True on success. Requires no parameters.
31+
* @method static ServerResponse deleteWebhook(array $data) Use this method to remove webhook integration if you decide to switch back to getUpdates. Returns True on success.
3232
* @method static ServerResponse getWebhookInfo() Use this method to get current webhook status. Requires no parameters. On success, returns a WebhookInfo object. If the bot is using getUpdates, will return an object with the url field empty.
3333
* @method static ServerResponse getMe() A simple method for testing your bot's auth token. Requires no parameters. Returns basic information about the bot in form of a User object.
3434
* @method static ServerResponse logOut() Use this method to log out from the cloud Bot API server before launching the bot locally. Requires no parameters. Returns True on success.

src/Telegram.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -926,12 +926,14 @@ public function setWebhook(string $url, array $data = []): ServerResponse
926926
/**
927927
* Delete any assigned webhook
928928
*
929-
* @return mixed
929+
* @param array $data
930+
*
931+
* @return ServerResponse
930932
* @throws TelegramException
931933
*/
932-
public function deleteWebhook()
934+
public function deleteWebhook(array $data = []): ServerResponse
933935
{
934-
$result = Request::deleteWebhook();
936+
$result = Request::deleteWebhook($data);
935937

936938
if (!$result->isOk()) {
937939
throw new TelegramException(

0 commit comments

Comments
 (0)