@@ 96-108 (lines=13) @@ | ||
93 | return $subHandlers; |
|
94 | } |
|
95 | ||
96 | protected function getCommandListAttachment(Collection $handlers): Attachment |
|
97 | { |
|
98 | $attachmentFields = $handlers |
|
99 | ->map(function (SignatureHandler $handler) { |
|
100 | return AttachmentField::create($handler->getFullCommand(), $handler->getDescription()); |
|
101 | }) |
|
102 | ->all(); |
|
103 | ||
104 | return Attachment::create() |
|
105 | ->setColor('warning') |
|
106 | ->setTitle('Did you mean:') |
|
107 | ->setFields($attachmentFields); |
|
108 | } |
|
109 | ||
110 | protected function containsHelpHandler(Collection $alternativeHandlers): bool |
|
111 | { |
@@ 92-106 (lines=15) @@ | ||
89 | * @param Collection|SignatureHandler[] $handlers |
|
90 | * @return Response |
|
91 | */ |
|
92 | protected function displayListOfAllCommands(Collection $handlers): Response |
|
93 | { |
|
94 | $attachmentFields = $handlers |
|
95 | ->map(function (SignatureHandler $handler) { |
|
96 | return AttachmentField::create($handler->getFullCommand(), $handler->getDescription()); |
|
97 | }) |
|
98 | ->all(); |
|
99 | ||
100 | return $this->respondToSlack('Available commands:') |
|
101 | ->withAttachment( |
|
102 | Attachment::create() |
|
103 | ->setColor('good') |
|
104 | ->setFields($attachmentFields) |
|
105 | ); |
|
106 | } |
|
107 | } |
|
108 |