<?php
error_reporting(E_ALL);
ini_set('display_errors', '1');
$content = file_get_contents("php://input");




include('class/bot.php');
include('class/db.php');
include('class/general.php');

$bot = new bot("5876311548:AAFf6DPBH9TyEmBJIO-73hs9JbW-2dzYf1s", $content);
$db = new db();
$expired = $db->getExpired();





foreach ($expired as $singleGetter) {

    $bot->sendmessage(urlencode("اشتراک شما به اتمام رسید"), $singleGetter['chatid'], '');
    $bot->banMember($singleGetter['chatid'], '-1001912756306');
    $sql = "update users set status=\"deactive\"  where chatid='" . $singleGetter['chatid'] . "' ";
    $db->conn->exec($sql);


}

?>