Skip to content

Commit ce632c6

Browse files
committed
Now a warning is emitted when using getUpdates if a webhook url is set
1 parent beaf616 commit ce632c6

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/NovaGram/Bot.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,11 @@ public function idle(){
276276
$this->started = true;
277277
if($this->settings->mode === self::CLI){
278278
$this->logger->debug('Idling...');
279-
$this->deleteWebhook();
279+
$webhook_info = $this->getWebhookInfo();
280+
if($webhook_info->url !== ""){ // there is a webhook set
281+
$this->deleteWebhook();
282+
$this->logger->warning("There was a set webhook. It has been deleted. (URL: {$webhook_info->url})");
283+
}
280284
$this->running = true;
281285
self::showLicense();
282286
while ($this->running) {

0 commit comments

Comments
 (0)