Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upGitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
Allow for typesAndWaits with milliseconds #1113
Comments
|
Hi @roelofr , |
|
Hi @feralheart, |


Description:
I noticed the
typesAndWaitsuses thesleepmethod, but this only allows you to sleep whole seconds.Wouldn't it be better to use
usleep, so we can sleep for 2.5 seconds, or 0.5 seconds?I noticed the code moved from the BotMan class to the drivers, but the change woud likely be comparable to this:
class BotMan { // … /** - * @param int $seconds Number of seconds to wait + * @param float $seconds Number of seconds to wait * @return $this */ public function typesAndWaits($seconds) { $this->getDriver()->types($this->message); - sleep($seconds); + usleep($seconds * 1000000); return $this; } // … }Just a suggestion, let me know what you think.