PHP 클래스 Maknz\Slack\Message

파일 보기 프로젝트 열기: maknz/slack 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$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