@@ 105-115 (lines=11) @@ | ||
102 | return $subHandlers; |
|
103 | } |
|
104 | ||
105 | protected function getCommandListAttachment(Collection $handlers): Attachment |
|
106 | { |
|
107 | $attachmentFields = $handlers->map(function (SignatureHandler $handler) { |
|
108 | return AttachmentField::create($handler->getFullCommand(), $handler->getDescription()); |
|
109 | }) |
|
110 | ->all(); |
|
111 | ||
112 | return Attachment::create() |
|
113 | ->setTitle('Did you mean:') |
|
114 | ->setFields($attachmentFields); |
|
115 | } |
|
116 | } |
|
117 |
@@ 92-104 (lines=13) @@ | ||
89 | * @param Collection|SignatureHandler[] $handlers |
|
90 | * @return Response |
|
91 | */ |
|
92 | protected function displayHelpList(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()->setFields($attachmentFields) |
|
103 | ); |
|
104 | } |
|
105 | } |
|
106 |