Overview
  • Namespace
  • Class

Namespaces

  • Slack
    • Message

Classes

  • Attachment
  • AttachmentBuilder
  • AttachmentField
  • Message
  • MessageBuilder

Class Attachment

A message attachment containing rich text data.

Slack\DataObject implements JsonSerializable
Extended by Slack\Message\Attachment
Namespace: Slack\Message
See: https://api.slack.com/docs/attachments
Located at Message/Attachment.php

Methods summary

public
# __construct( string $title, string $text, string $fallback = null, $color = null, $pretext = null, array $fields = [] )

Creates a new message attachment.

Creates a new message attachment.

Parameters

$title
The attachment title.
$text
The attachment body text.
$fallback
A plain-text summary of the attachment.
$color
$pretext
$fields
public string
# getFallbackText( )

Gets a plain-text summary of the attachment.

Gets a plain-text summary of the attachment.

Returns

string
A plain-text summary of the attachment.
public string
# getColor( )

Gets the attachment border color.

Gets the attachment border color.

Returns

string
The attachment border color. Can be "good", "warning", "danger", or a hex color code.
public string
# getPretext( )

Gets the attachment pretext.

Gets the attachment pretext.

Returns

string
Optional text that appears above the message attachment block.
public string
# getAuthorName( )

Gets the author name.

Gets the author name.

Returns

string
The attachment author's name.
public string
# getAuthorLink( )

Gets the author link.

Gets the author link.

Returns

string
A link URL for the author.
public string
# getAuthorIcon( )

Gets the author icon.

Gets the author icon.

Returns

string
An icon URL to show next to the author name.
public string
# getTitle( )

Gets the title.

Gets the title.

Returns

string
The attachment title.
public string
# getTitleLink( )

Gets the title link.

Gets the title link.

Returns

string
A link URL the title should link to.
public string
# getText( )

Gets the attachment body text.

Gets the attachment body text.

Returns

string
The attachment body text.
public string
# getImageUrl( )

Gets the image URL.

Gets the image URL.

Returns

string
A URL to an image to display in the attachment body.
public string
# getThumbUrl( )

Gets the thumbnail URL.

Gets the thumbnail URL.

Returns

string
A URL to an image to display as a thumbnail.
public string
# getFooterText( )

Gets the footer text.

Gets the footer text.

Returns

string
The footer text.
public string
# getFooterIcon( )

Gets a URL to an image to show to the left of the footer text.

Gets a URL to an image to show to the left of the footer text.

Returns

string
The footer icon URL.
public DateTime
# getTimestamp( )

Gets an extra timestamp value in the footer.

Gets an extra timestamp value in the footer.

Returns

DateTime
The time of the timestamp.
public boolean
# hasFields( )

Checks if the attachment has fields.

Checks if the attachment has fields.

Returns

boolean
public Slack\Message\AttachmentField[]
# getFields( )

Gets all the attachment's fields.

Gets all the attachment's fields.

Returns

Slack\Message\AttachmentField[]
public
# jsonUnserialize( array $data )

Re-initializes the object when unserialized or created from a data array.

Re-initializes the object when unserialized or created from a data array.

Parameters

$data
The object data.

Overrides

Slack\DataObject::jsonUnserialize

Methods inherited from Slack\DataObject

fromData(), jsonSerialize()

Properties summary

Properties inherited from Slack\DataObject

$data

API documentation generated by ApiGen