We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 404acc4 commit 0e527ceCopy full SHA for 0e527ce
src/Webhook.php
@@ -11,6 +11,7 @@ class Webhook
11
{
12
private string $url;
13
private ?string $proxy;
14
+ private ?int $timeout;
15
16
public function __construct(string $url)
17
@@ -24,6 +25,13 @@ public function setProxy(?string $proxy): self
24
25
return $this;
26
}
27
28
+ public function setTimeout(?int $timeout): self
29
+ {
30
+ $this->timeout = $timeout;
31
+
32
+ return $this;
33
+ }
34
35
/**
36
* @throws DiscordInvalidResponseException
37
* @throws DiscordSerializeException
@@ -40,6 +48,10 @@ public function send(Message $message): int
40
48
$options[CURLOPT_PROXY] = $this->proxy;
41
49
42
50
51
+ if (!empty($this->timeout)) {
52
+ $options[CURLOPT_TIMEOUT] = $this->timeout;
53
54
43
55
try {
44
56
if (isset($data['file'])) {
45
57
$file = $data['file'];
0 commit comments