Skip to content

Commit 14ec8d3

Browse files
committed
Add support to set HTTP Client.
1 parent 8617bc9 commit 14ec8d3

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

src/Telegram.php

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,20 @@ protected function httpClient(): HttpClient
9393
return $this->http;
9494
}
9595

96+
/**
97+
* Set HTTP Client.
98+
*
99+
* @param HttpClient $http
100+
*
101+
* @return $this
102+
*/
103+
public function setHttpClient(HttpClient $http): self
104+
{
105+
$this->http = $http;
106+
107+
return $this;
108+
}
109+
96110
/**
97111
* Send text message.
98112
*
@@ -134,7 +148,7 @@ public function sendMessage(array $params): ?ResponseInterface
134148
*/
135149
public function sendFile(array $params, string $type, bool $multipart = false): ?ResponseInterface
136150
{
137-
return $this->sendRequest('send'.Str::studly($type), $params, $multipart);
151+
return $this->sendRequest('send' . Str::studly($type), $params, $multipart);
138152
}
139153

140154
/**

0 commit comments

Comments
 (0)