How in json can cooldown be made? For example, I have a VKontakte bot, and the "bonus" command, I need to make sure that when the second "bonus" command is sent, the user is sent the message "Wait 4 hours"! How can you make such a delay?
elseif($body[0] == 'бонус' || $body[0] == 'Бонус'){ $from_id = $this->conf->data->object->from_id; $UserData = json_decode(file_get_contents('users.json'), true); if(!isset($UserData[$from_id]['bonus'])){ $UserData[$from_id]['balance'] += 3500; $UserData[$from_id]['bonus'] = 'used'; file_put_contents('users.json', json_encode($UserData)); $self = "👤$nick".", \n\n✅Вы получили бонус 3500$! Баланс: {$UserData[$from_id]['balance']}$"; }else{ $self = "👤$nick".", \n\n❎Вы уже использовали бонус!"; } }