<?php

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

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

