1 | <?php |
||
9 | class SlashCommandResponse extends Response |
||
10 | { |
||
11 | /** @var SlashCommandRequest */ |
||
12 | protected $request; |
||
13 | |||
14 | /** @var string */ |
||
15 | protected $text; |
||
16 | |||
17 | /** @var string */ |
||
18 | protected $responseType = 'ephemeral'; |
||
19 | |||
20 | /** @var string */ |
||
21 | protected $attachments = ''; |
||
22 | |||
23 | /** @var \GuzzleHttp\Client */ |
||
24 | protected $client; |
||
25 | |||
26 | public static function createForRequest(Request $request) |
||
32 | |||
33 | public function __construct(Client $client) |
||
37 | |||
38 | /** |
||
39 | * @param \Illuminate\Http\Request $request |
||
40 | * @return $this |
||
41 | */ |
||
42 | public function setRequest(Request $request) |
||
48 | |||
49 | public function getResponseUrl() |
||
53 | |||
54 | /** |
||
55 | * @param string $text |
||
56 | * @return $this |
||
57 | */ |
||
58 | public function setText(string $text) |
||
64 | |||
65 | /** |
||
66 | * @return $this |
||
67 | */ |
||
68 | public function displayResponseOnlyToUserWhoTypedCommand() |
||
74 | |||
75 | /** |
||
76 | * @return $this |
||
77 | */ |
||
78 | public function displayResponseToEveryoneOnChannel() |
||
84 | |||
85 | /** |
||
86 | * Send the response to Slack |
||
87 | */ |
||
88 | public function send() |
||
92 | |||
93 | /** |
||
94 | * @return $this |
||
95 | */ |
||
96 | public function finalize() |
||
104 | |||
105 | protected function getPayload(): array |
||
117 | } |
||
118 |