|
@@ 40-48 (lines=9) @@
|
| 37 |
|
* @param Attachment $attachment |
| 38 |
|
* @param int $delay |
| 39 |
|
*/ |
| 40 |
|
protected function sendAttachment(Attachment $attachment, int $delay = 0): void |
| 41 |
|
{ |
| 42 |
|
/** @var Dispatcher $dispatcher */ |
| 43 |
|
$dispatcher = Container::getInstance()->make(Dispatcher::class); |
| 44 |
|
|
| 45 |
|
$dispatcher->dispatch( |
| 46 |
|
(new SendAttachment(session()->getChat(), session()->getUser(), $attachment))->delay($delay) |
| 47 |
|
); |
| 48 |
|
} |
| 49 |
|
|
| 50 |
|
/** |
| 51 |
|
* Send request to the messaging service. |
|
@@ 57-65 (lines=9) @@
|
| 54 |
|
* @param array $parameters |
| 55 |
|
* @param int $delay |
| 56 |
|
*/ |
| 57 |
|
protected function sendRequest(string $endpoint, array $parameters = [], int $delay = 0): void |
| 58 |
|
{ |
| 59 |
|
/** @var Dispatcher $dispatcher */ |
| 60 |
|
$dispatcher = Container::getInstance()->make(Dispatcher::class); |
| 61 |
|
|
| 62 |
|
$dispatcher->dispatch( |
| 63 |
|
(new SendRequest(session()->getChat(), session()->getUser(), $endpoint, $parameters))->delay($delay) |
| 64 |
|
); |
| 65 |
|
} |
| 66 |
|
} |
| 67 |
|
|