Skip to content

Commit 6f53e7f

Browse files
committed
Rollback DriverInterface change
1 parent 722cdc6 commit 6f53e7f

File tree

3 files changed

+9
-10
lines changed

3 files changed

+9
-10
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,6 @@ composer.lock
44
.php_cs.cache
55
/vendor/
66
update.bat
7+
test.bat
78
.phpunit.result.cache
89
todo.txt

src/BotMan.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -618,7 +618,14 @@ public function types()
618618
*/
619619
public function typesAndWaits(float $seconds)
620620
{
621-
$this->getDriver()->typesAndWaits($this->message, $seconds);
621+
$driver = $this->getDriver();
622+
623+
if (method_exists($driver, 'typesAndWaits')) {
624+
$this->getDriver()->typesAndWaits($this->message, $seconds);
625+
} else {
626+
$this->types();
627+
usleep($seconds * 1000000);
628+
}
622629

623630
return $this;
624631
}

src/Interfaces/DriverInterface.php

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -74,15 +74,6 @@ public function hasMatchingEvent();
7474
*/
7575
public function types(IncomingMessage $matchingMessage);
7676

77-
/**
78-
* Send a typing indicator and wait for the given amount of seconds.
79-
* @param IncomingMessage $matchingMessage
80-
* @param int $seconds
81-
* @param float $seconds
82-
* @return mixed
83-
*/
84-
public function typesAndWaits(IncomingMessage $matchingMessage, float $seconds);
85-
8677
/**
8778
* Tells if the stored conversation callbacks are serialized.
8879
*

0 commit comments

Comments
 (0)