Min menu

Pages

News Sports

You may also like

 

addCommandsPaths($commands_paths); // User data for demonstration purposes $userData = [ 'taps' => 0, 'shares' => 0 ]; // Define a tap command class TapCommand extends \Longman\TelegramBot\Commands\UserCommand { protected $name = 'tap'; protected $description = 'Tap to earn'; protected $usage = '/tap'; protected $version = '1.0.0'; public function execute() { global $userData; $userData['taps'] += 1; $userData['shares'] += 1; $text = "You tapped! Total taps: {$userData['taps']}, Shares: {$userData['shares']}"; $data = [ 'chat_id' => $this->getMessage()->getChat()->getId(), 'text' => $text, ]; return Request::sendMessage($data); } } // Define a rewards command class RewardsCommand extends \Longman\TelegramBot\Commands\UserCommand { protected $name = 'rewards'; protected $description = 'Check your rewards'; protected $usage = '/rewards'; protected $version = '1.0.0'; public function execute() { global $userData; // Call your Solana smart contract endpoint $client = new Client(); $response = $client->post('SOLANA_SMART_CONTRACT_ENDPOINT', [ 'json' => [ 'userAccount' => 'USER_PUBLIC_KEY' ] ]); if ($response->getStatusCode() == 200) { $text = "Tokens have been rewarded based on your taps."; } else { $text = "Failed to reward tokens."; } $data = [ 'chat_id' => $this->getMessage()->getChat()->getId(), 'text' => $text, ]; return Request::sendMessage($data); } } $telegram->handle();

Comments

    "+html+"
"; document.querySelector("#tocDiv").innerHTML = Xhtml; document.querySelectorAll(".ScrolingToTarget").forEach(function(asd){ asd.addEventListener("click", function(e){ e.preventDefault(); document.querySelector(asd.getAttribute('href')).scrollIntoView({ behavior: 'smooth' }); });}) if (document.querySelectorAll('.amp-contnt h1,.amp-contnt h2, .amp-contnt h3, .amp-contnt h4').length == 0){ document.querySelector('ul#tocList').innerHTML = "
No titles
"; } document.querySelector('.closetoc').addEventListener('click', function(x){ document.querySelector('.topcs7v').classList.toggle('closed') }); }