1 | <?php |
||
8 | class Response |
||
9 | { |
||
10 | /** @var \Spatie\SlashCommand\Request */ |
||
11 | protected $request; |
||
12 | |||
13 | /** @var string */ |
||
14 | protected $text; |
||
15 | |||
16 | /** @var string */ |
||
17 | protected $responseType; |
||
18 | |||
19 | /** @var string */ |
||
20 | protected $channel; |
||
21 | |||
22 | /** @var string */ |
||
23 | protected $attachments = ''; |
||
24 | |||
25 | /** @var \GuzzleHttp\Client */ |
||
26 | protected $client; |
||
27 | |||
28 | public static function create(Request $request): Response |
||
34 | |||
35 | public function __construct(Client $client, Request $request) |
||
45 | |||
46 | /** |
||
47 | * @param string $text |
||
48 | * |
||
49 | * @return $this |
||
50 | */ |
||
51 | public function withText(string $text) |
||
57 | |||
58 | public function onChannel(string $channelName) |
||
64 | |||
65 | /** |
||
66 | * @return $this |
||
67 | */ |
||
68 | public function displayResponseToUserWhoTypedCommand() |
||
74 | |||
75 | /** |
||
76 | * @param string $channelName |
||
77 | * |
||
78 | * @return $this |
||
79 | */ |
||
80 | public function displayResponseToEveryoneOnChannel(string $channelName = '') |
||
90 | |||
91 | /** |
||
92 | * Send the response to Slack. |
||
93 | */ |
||
94 | public function send() |
||
98 | |||
99 | public function getIlluminateResponse(): IlluminateResponse |
||
103 | |||
104 | protected function getPayload(): array |
||
117 | } |
||
118 |