PHP Класс Maknz\Slack\Message

Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$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 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.

Открытые методы

Метод Описание
__construct ( Client $client ) : void 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.

Описание методов

__construct() публичный Метод

Instantiate a new Message.
public __construct ( Client $client ) : void
$client Client
Результат void

attach() публичный Метод

Add an attachment to the message.
public attach ( mixed $attachment )
$attachment mixed

clearAttachments() публичный Метод

Remove all attachments for the message.
public clearAttachments ( )

disableMarkdown() публичный Метод

Disable Markdown formatting for the message.
public disableMarkdown ( ) : void
Результат void

enableMarkdown() публичный Метод

Enable Markdown formatting for the message.
public enableMarkdown ( ) : void
Результат void

from() публичный Метод

Change the name of the user the post will be made as.
public from ( string $username )
$username string

getAllowMarkdown() публичный Метод

Get whether message text should be formatted with Slack's Markdown-like language.
public getAllowMarkdown ( ) : boolean
Результат boolean

getAttachments() публичный Метод

Get the attachments for the message.
public getAttachments ( ) : array
Результат array

getChannel() публичный Метод

Get the channel we will post to.
public getChannel ( ) : string
Результат string

getIcon() публичный Метод

Get the icon (either URL or emoji) we will post as.
public getIcon ( ) : string
Результат string

getIconType() публичный Метод

Get the icon type being used, if an icon is set.
public getIconType ( ) : string
Результат string

getMarkdownInAttachments() публичный Метод

Get the attachment fields which should be formatted in Slack's Markdown-like language.
public getMarkdownInAttachments ( ) : array
Результат array

getText() публичный Метод

Get the message text.
public getText ( ) : string
Результат string

getUsername() публичный Метод

Get the username we will post as.
public getUsername ( ) : string
Результат string

send() публичный Метод

Send the message.
public send ( string $text = null ) : void
$text string The text to send
Результат void

setAllowMarkdown() публичный Метод

Set whether message text should be formatted with Slack's Markdown-like language.
public setAllowMarkdown ( boolean $value ) : void
$value boolean
Результат void

setAttachments() публичный Метод

Set the attachments for the message.
public setAttachments ( array $attachments )
$attachments array

setChannel() публичный Метод

Set the channel we will post to.
public setChannel ( string $channel )
$channel string

setIcon() публичный Метод

Set the icon (either URL or emoji) we will post as.
public setIcon ( string $icon )
$icon string

setMarkdownInAttachments() публичный Метод

Set the attachment fields which should be formatted in Slack's Markdown-like language.
public setMarkdownInAttachments ( array $fields ) : void
$fields array
Результат void

setText() публичный Метод

Set the message text.
public setText ( string $text )
$text string

setUsername() публичный Метод

Set the username we will post as.
public setUsername ( string $username )
$username string

to() публичный Метод

Change the channel the post will be made to.
public to ( string $channel )
$channel string

withIcon() публичный Метод

Chainable method for setting the icon.
public withIcon ( string $icon )
$icon string

Описание свойств

$allow_markdown защищенное свойство

Whether the message text should be interpreted in Slack's Markdown-like language.
protected bool $allow_markdown
Результат boolean

$attachments защищенное свойство

An array of attachments to send.
protected array $attachments
Результат array

$channel защищенное свойство

The channel the message should be sent to.
protected string $channel
Результат string

$client защищенное свойство

Reference to the Slack client responsible for sending the message.
protected Client,Maknz\Slack $client
Результат Client

$icon защищенное свойство

The URL to the icon to use.
protected string $icon
Результат string

$iconType защищенное свойство

The type of icon we are using.
protected enum $iconType
Результат enum

$markdown_in_attachments защищенное свойство

The attachment fields which should be formatted with Slack's Markdown-like language.
protected array $markdown_in_attachments
Результат array

$text защищенное свойство

The text to send with the message.
protected string $text
Результат string

$username защищенное свойство

The username the message should be sent as.
protected string $username
Результат string