PHP Classes

File: longpolling.php

Recommend this page to a friend!
  Classes of Mateo   PHP Telegram Bot to Purge Messages   longpolling.php   Download  
File: longpolling.php
Role: Example script
Content type: text/plain
Description: Example script
Class: PHP Telegram Bot to Purge Messages
Bot to delete messages in telegram
Author: By
Last change:
Date: 1 month ago
Size: 401 bytes
 

Contents

Class file image Download
<?php

use Mateodioev\TgHandler\Db\Memory;

require
__DIR__ . '/vendor/autoload.php';
/** @var \Mateodioev\TgHandler\Bot $bot */
$bot = require __DIR__ . '/bot.php';

$bot->setDb(new Memory()); // Use default memory database on long polling

$bot->getApi()->deleteWebhook(dropUpdates: true); // Drop webhook updates

$bot->longPolling(
   
timeout: 60,
   
ignoreOldUpdates: true,
   
async: true,
);