Maknz\Slack\Message::getAttachments PHP Method

getAttachments() public method

Get the attachments for the message.
public getAttachments ( ) : array
return array
    public function getAttachments()
    {
        return $this->attachments;
    }

Usage Example

Beispiel #1
0
 /**
  * Get the attachments in array form.
  *
  * @param \Maknz\Slack\Message $message
  * @return array
  */
 protected function getAttachmentsAsArrays(Message $message)
 {
     $attachments = [];
     foreach ($message->getAttachments() as $attachment) {
         $attachments[] = $attachment->toArray();
     }
     return $attachments;
 }