Property | Type | Description | |
---|---|---|---|
$allow_markdown | boolean | Whether the message text should be interpreted in Slack's Markdown-like language. | |
$attachments | array | An array of attachments to send. | |
$channel | string | The channel the message should be sent to. | |
$client | Reference to the Slack client responsible for sending the message. | ||
$icon | string | The URL to the icon to use. | |
$iconType | enum | The type of icon we are using. | |
$markdown_in_attachments | array | The attachment fields which should be formatted with Slack's Markdown-like language. | |
$text | string | The text to send with the message. | |
$username | string | The username the message should be sent as. |
Method | Description | |
---|---|---|
__construct ( |
Instantiate a new Message. | |
attach ( mixed $attachment ) | Add an attachment to the message. | |
clearAttachments ( ) | Remove all attachments for the message. | |
disableMarkdown ( ) : void | Disable Markdown formatting for the message. | |
enableMarkdown ( ) : void | Enable Markdown formatting for the message. | |
from ( string $username ) | Change the name of the user the post will be made as. | |
getAllowMarkdown ( ) : boolean | Get whether message text should be formatted with Slack's Markdown-like language. | |
getAttachments ( ) : array | Get the attachments for the message. | |
getChannel ( ) : string | Get the channel we will post to. | |
getIcon ( ) : string | Get the icon (either URL or emoji) we will post as. | |
getIconType ( ) : string | Get the icon type being used, if an icon is set. | |
getMarkdownInAttachments ( ) : array | Get the attachment fields which should be formatted in Slack's Markdown-like language. | |
getText ( ) : string | Get the message text. | |
getUsername ( ) : string | Get the username we will post as. | |
send ( string $text = null ) : void | Send the message. | |
setAllowMarkdown ( boolean $value ) : void | Set whether message text should be formatted with Slack's Markdown-like language. | |
setAttachments ( array $attachments ) | Set the attachments for the message. | |
setChannel ( string $channel ) | Set the channel we will post to. | |
setIcon ( string $icon ) | Set the icon (either URL or emoji) we will post as. | |
setMarkdownInAttachments ( array $fields ) : void | Set the attachment fields which should be formatted in Slack's Markdown-like language. | |
setText ( string $text ) | Set the message text. | |
setUsername ( string $username ) | Set the username we will post as. | |
to ( string $channel ) | Change the channel the post will be made to. | |
withIcon ( string $icon ) | Chainable method for setting the icon. |
public __construct ( |
||
$client | ||
return | void |
public clearAttachments ( ) |
public disableMarkdown ( ) : void | ||
return | void |
public enableMarkdown ( ) : void | ||
return | void |
public getAllowMarkdown ( ) : boolean | ||
return | boolean |
public getAttachments ( ) : array | ||
return | array |
public getChannel ( ) : string | ||
return | string |
public getIconType ( ) : string | ||
return | string |
public getMarkdownInAttachments ( ) : array | ||
return | array |
public getUsername ( ) : string | ||
return | string |
public setAllowMarkdown ( boolean $value ) : void | ||
$value | boolean | |
return | void |
public setAttachments ( array $attachments ) | ||
$attachments | array |
public setChannel ( string $channel ) | ||
$channel | string |
public setMarkdownInAttachments ( array $fields ) : void | ||
$fields | array | |
return | void |
public setUsername ( string $username ) | ||
$username | string |
protected bool $allow_markdown | ||
return | boolean |
protected array $attachments | ||
return | array |
protected string $channel | ||
return | string |
protected Client,Maknz\Slack $client | ||
return |
protected array $markdown_in_attachments | ||
return | array |
protected string $username | ||
return | string |