such a problem, I want the bot to send a message every 2 seconds when using this code:
$discord = new \Discord\Discord([
'token' => 'MzUyNDMaMTg1MDkssd4nlQ.Dz0_gyZadadnmReXb9cvVpRLol-zpI',
]);
$discord->on('ready', function ($discord) {
for($i=0;$i<5;$i++) {
$channel = $discord->factory(\Discord\Parts\Channel\Channel::class, ['id' => '312626313200664578']);
$channel->sendMessage(time());
sleep(2);
}
});
$discord->run();
all messages are sent after a 10 second delay. How to fix this?