<?php

use inc\fileStorage;
use Database\{Users,Settings};

if ($text == patternAdmin('setCountInvite')) {
    Users::updateCommand($chatid, 'setCountInvite');
    $get = Settings::getSettings('countinvite');
    $Telegram->SendMessage($chatid, str_replace('#count', $get, msg('countInviteSet')), 'html', false, $button_backhome);
} elseif ($command == 'setCountInvite' && $text != patternAdmin('back')) {
    Users::updateCommand($chatid, null);
    if (preg_match('/^[0-9]*$/', $text)) {
        Settings::updateSettings('countinvite', $text);
        fileStorage::removeFile('bot');
    }
    $Telegram->SendMessage($chatid, msg('done'), 'html', false, $button_settings);
}

