Copied!
CloneableInstantiable
Constants
public Maknz\Slack\Message::ICON_TYPE_EMOJI = 'icon_emoji'
 
  • var string
public Maknz\Slack\Message::ICON_TYPE_URL = 'icon_url'
 
  • var string
Methods
public attach( $attachment)
 

Add an attachment to the message.

  • param mixed $attachment
  • return $this
  • throws \InvalidArgumentException
public clearAttachments()
 

Remove all attachments for the message.

  • return $this
public clearBlocks()
 

Remove all blocks for the message.

  • return $this
public disableMarkdown()
 

Disable Markdown formatting for the message.

  • return $this
public enableMarkdown()
 

Enable Markdown formatting for the message.

  • return $this
public from( $username)
 

Change the name of the user the post will be made as.

  • param string $username
  • return $this
public getAllowMarkdown()
 

Get whether message text should be formatted with Slack's Markdown-like language.

  • return bool
public getAttachments()
 

Get the attachments for the message.

  • return \Attachment[]
public getBlocks()
 

Get the blocks for the message.

  • return \Block[]
public getBlocksAsArrays()
 

Get the blocks for the message in array format.

  • return array
public getChannel()
 

Get the channel we will post to.

  • return string
public getIcon()
 

Get the icon (either URL or emoji) we will post as.

  • return string
public getIconType()
 

Get the icon type being used, if an icon is set.

  • return string
public getMarkdownInAttachments()
 

Get the attachment fields which should be formatted in Slack's Markdown-like language.

  • return array
public getText()
 

Get the message text.

  • return string
public getUsername()
 

Get the username we will post as.

  • return string
public setAllowMarkdown( $value)
 

Set whether message text should be formatted with Slack's Markdown-like language.

  • param bool $value
  • return $this
public setAttachments(array $attachments)
 

Set the attachments for the message.

  • param array $attachments
  • return $this
  • throws \InvalidArgumentException
public setBlocks(array $blocks)
 

Set the blocks for the message.

  • param array $blocks
  • return $this
  • throws \InvalidArgumentException
public setChannel( $channel)
 

Set the channel we will post to.

  • param string $channel
  • return $this
public setIcon( $icon)
 

Set the icon (either URL or emoji) we will post as.

  • param string $icon
  • return $this
public setMarkdownInAttachments(array $fields)
 

Set the attachment fields which should be formatted in Slack's Markdown-like language.

  • param array $fields
  • return $this
public setText( $text)
 

Set the message text.

  • param string $text
  • return $this
public setUsername( $username)
 

Set the username we will post as.

  • param string $username
  • return $this
public to( $channel)
 

Change the channel the post will be made to.

  • param string $channel
  • return $this
public withBlock( $block)
 

Add a block to the message.

  • param mixed $block
  • return $this
  • throws \InvalidArgumentException
public withIcon( $icon)
 

Chainable method for setting the icon.

  • param string $icon
  • return $this
Properties
protected $allow_markdown = true
 

Whether the message text should be interpreted in Slack's Markdown-like language.

  • var bool
protected $attachments = []
 

An array of attachments to send.

  • var \Attachment[]
protected $blocks = []
 

An array of blocks to send.

  • var \Block[]
protected $channel = NULL
 

The channel the message should be sent to.

  • var string
protected $icon = NULL
 

The URL to the icon to use.

  • var string
protected $iconType = NULL
 

The type of icon we are using.

  • var string (one of self::ICON_* constants)
protected $markdown_in_attachments = []
 

The attachment fields which should be formatted with Slack's Markdown-like language.

  • var array
protected $text = NULL
 

The text to send with the message.

  • var string
protected $username = NULL
 

The username the message should be sent as.

  • var string
© 2024 Bruce Wells
Search Namespaces \ Classes
Configuration