Overview
  • Namespace
  • Class

Namespaces

  • Slack
    • Message

Classes

  • Attachment
  • AttachmentBuilder
  • AttachmentField
  • Message
  • MessageBuilder

Class MessageBuilder

A builder object for creating new message objects.

Namespace: Slack\Message
Located at Message/MessageBuilder.php

Methods summary

public
# __construct( Slack\ApiClient $client )

Creates a new message builder.

Creates a new message builder.

Parameters

$client
The API client the builder is working for.
public Slack\Message\Message
# create( )

Creates and returns a new message object specified by the builder.

Creates and returns a new message object specified by the builder.

Returns

Slack\Message\Message
A new message object.
public
# setText( string $text, boolean $markdown = true )

Sets the message text.

Sets the message text.

Parameters

$text
The message body text.
$markdown
Enable or disable Markdown parsing of the text.

Returns


$this
public
# setChannel( Slack\ChannelInterface $channel )

Sets the channel the message should be posted to.

Sets the channel the message should be posted to.

Parameters

$channel
A channel to post to.

Returns


$this
public
# setUser( Slack\User $user )

Sets the user the message is sent from.

Sets the user the message is sent from.

Parameters

$user
A user.

Returns


$this
public
# addAttachment( Slack\Message\Attachment $attachment )

Adds an attachment to the message.

Adds an attachment to the message.

Parameters

$attachment
The attachment to add.

Returns


$this

Properties summary

protected array $data

An array of data to pass to the built message.

An array of data to pass to the built message.

# []
API documentation generated by ApiGen