SlackAttachment
in package
Uses
InteractsWithTime
Table of Contents
- $authorIcon : string
- The attachment author's icon.
- $authorLink : string
- The attachment author's link.
- $authorName : string
- The attachment author's name.
- $color : string
- The attachment's color.
- $content : string
- The attachment's text content.
- $fallback : string
- A plain-text summary of the attachment.
- $fields : array<string|int, mixed>
- The attachment's fields.
- $footer : string
- The attachment's footer.
- $footerIcon : string
- The attachment's footer icon.
- $imageUrl : string
- The attachment's image url.
- $markdown : array<string|int, mixed>
- The fields containing markdown.
- $thumbUrl : string
- The attachment's thumb url.
- $timestamp : int
- The attachment's timestamp.
- $title : string
- The attachment's title.
- $url : string
- The attachment's URL.
- author() : $this
- Set the author of the attachment.
- color() : $this
- Set the color of the attachment.
- content() : $this
- Set the content (text) of the attachment.
- fallback() : $this
- A plain-text summary of the attachment.
- field() : $this
- Add a field to the attachment.
- fields() : $this
- Set the fields of the attachment.
- footer() : $this
- Set the footer content.
- footerIcon() : $this
- Set the footer icon.
- image() : $this
- Set the image URL.
- markdown() : $this
- Set the fields containing markdown.
- thumb() : $this
- Set the URL to the attachment thumbnail.
- timestamp() : $this
- Set the timestamp.
- title() : $this
- Set the title of the attachment.
- availableAt() : int
- Get the "available at" UNIX timestamp.
- currentTime() : int
- Get the current system time as a UNIX timestamp.
- parseDateInterval() : DateTimeInterface|int
- If the given value is an interval, convert it to a DateTime instance.
- secondsUntil() : int
- Get the number of seconds until the given DateTime.
Properties
$authorIcon
The attachment author's icon.
public
string
$authorIcon
$authorLink
The attachment author's link.
public
string
$authorLink
$authorName
The attachment author's name.
public
string
$authorName
$color
The attachment's color.
public
string
$color
$content
The attachment's text content.
public
string
$content
$fallback
A plain-text summary of the attachment.
public
string
$fallback
$fields
The attachment's fields.
public
array<string|int, mixed>
$fields
$footer
The attachment's footer.
public
string
$footer
$footerIcon
The attachment's footer icon.
public
string
$footerIcon
$imageUrl
The attachment's image url.
public
string
$imageUrl
$markdown
The fields containing markdown.
public
array<string|int, mixed>
$markdown
$thumbUrl
The attachment's thumb url.
public
string
$thumbUrl
$timestamp
The attachment's timestamp.
public
int
$timestamp
$title
The attachment's title.
public
string
$title
$url
The attachment's URL.
public
string
$url
Methods
author()
Set the author of the attachment.
public
author(string $name[, string|null $link = null ][, string|null $icon = null ]) : $this
Parameters
- $name : string
- $link : string|null = null
- $icon : string|null = null
Return values
$this —color()
Set the color of the attachment.
public
color(string $color) : $this
Parameters
- $color : string
Return values
$this —content()
Set the content (text) of the attachment.
public
content(string $content) : $this
Parameters
- $content : string
Return values
$this —fallback()
A plain-text summary of the attachment.
public
fallback(string $fallback) : $this
Parameters
- $fallback : string
Return values
$this —field()
Add a field to the attachment.
public
field(Closure|string $title[, string $content = '' ]) : $this
Parameters
- $title : Closure|string
- $content : string = ''
Return values
$this —fields()
Set the fields of the attachment.
public
fields(array<string|int, mixed> $fields) : $this
Parameters
- $fields : array<string|int, mixed>
Return values
$this —footer()
Set the footer content.
public
footer(string $footer) : $this
Parameters
- $footer : string
Return values
$this —footerIcon()
Set the footer icon.
public
footerIcon(string $icon) : $this
Parameters
- $icon : string
Return values
$this —image()
Set the image URL.
public
image(string $url) : $this
Parameters
- $url : string
Return values
$this —markdown()
Set the fields containing markdown.
public
markdown(array<string|int, mixed> $fields) : $this
Parameters
- $fields : array<string|int, mixed>
Return values
$this —thumb()
Set the URL to the attachment thumbnail.
public
thumb(string $url) : $this
Parameters
- $url : string
Return values
$this —timestamp()
Set the timestamp.
public
timestamp(DateTimeInterface|DateInterval|int $timestamp) : $this
Parameters
- $timestamp : DateTimeInterface|DateInterval|int
Return values
$this —title()
Set the title of the attachment.
public
title(string $title[, string|null $url = null ]) : $this
Parameters
- $title : string
- $url : string|null = null
Return values
$this —availableAt()
Get the "available at" UNIX timestamp.
protected
availableAt(DateTimeInterface|DateInterval|int $delay) : int
Parameters
- $delay : DateTimeInterface|DateInterval|int
Return values
int —currentTime()
Get the current system time as a UNIX timestamp.
protected
currentTime() : int
Return values
int —parseDateInterval()
If the given value is an interval, convert it to a DateTime instance.
protected
parseDateInterval(DateTimeInterface|DateInterval|int $delay) : DateTimeInterface|int
Parameters
- $delay : DateTimeInterface|DateInterval|int
Return values
DateTimeInterface|int —secondsUntil()
Get the number of seconds until the given DateTime.
protected
secondsUntil(DateTimeInterface|DateInterval|int $delay) : int
Parameters
- $delay : DateTimeInterface|DateInterval|int