PHP Class Slack\RealTimeClient

Inheritance: extends ApiClient, use trait Evenement\EventEmitterTrait
ファイルを表示 Open project: coderstephen/slack-client Class Usage Examples

Protected Properties

Property Type Description
$bots A map of bots.
$channels A map of channels.
$connected Indicates if the client is connected.
$dms A map of direct message channels.
$groups A map of groups.
$lastMessageId The ID of the last payload sent to Slack.
$pendingMessages An array of pending messages waiting for successful confirmation from Slack.
$team The team logged in to.
$users A map of users.
$websocket A websocket connection to the Slack API.

Public Methods

Method Description
connect ( ) : React\Promise\PromiseInterface Connects to the real-time messaging server.
disconnect ( ) Disconnects the client.
getBotById ( string $id ) : React\Promise\PromiseInterface Gets a bot by its ID.
getBots ( ) : React\Promise\PromiseInterface Gets all bots in the Slack team.
getChannelById ( $id ) {@inheritDoc}
getChannels ( ) {@inheritDoc}
getDMById ( $id ) {@inheritDoc}
getDMs ( ) {@inheritDoc}
getGroupById ( $id ) {@inheritDoc}
getGroups ( ) {@inheritDoc}
getTeam ( ) {@inheritDoc}
getUserById ( $id ) {@inheritDoc}
getUsers ( ) {@inheritDoc}
isConnected ( ) : boolean Returns whether the client is connected.
postMessage ( Message $message ) {@inheritDoc}

Private Methods

Method Description
onMessage ( Devristo\Phpws\Messaging\WebSocketMessageInterface $message ) Handles incoming websocket messages, parses them, and emits them as remote events.

Method Details

connect() public method

Connects to the real-time messaging server.
public connect ( ) : React\Promise\PromiseInterface
return React\Promise\PromiseInterface

disconnect() public method

Disconnects the client.
public disconnect ( )

getBotById() public method

Gets a bot by its ID.
public getBotById ( string $id ) : React\Promise\PromiseInterface
$id string A bot ID.
return React\Promise\PromiseInterface A promise for a bot object.

getBots() public method

Gets all bots in the Slack team.
public getBots ( ) : React\Promise\PromiseInterface
return React\Promise\PromiseInterface A promise for an array of bots.

getChannelById() public method

{@inheritDoc}
public getChannelById ( $id )

getChannels() public method

{@inheritDoc}
public getChannels ( )

getDMById() public method

{@inheritDoc}
public getDMById ( $id )

getDMs() public method

{@inheritDoc}
public getDMs ( )

getGroupById() public method

{@inheritDoc}
public getGroupById ( $id )

getGroups() public method

{@inheritDoc}
public getGroups ( )

getTeam() public method

{@inheritDoc}
public getTeam ( )

getUserById() public method

{@inheritDoc}
public getUserById ( $id )

getUsers() public method

{@inheritDoc}
public getUsers ( )

isConnected() public method

Returns whether the client is connected.
public isConnected ( ) : boolean
return boolean

postMessage() public method

{@inheritDoc}
public postMessage ( Message $message )
$message Slack\Message\Message

Property Details

$bots protected_oe property

A map of bots.
protected $bots

$channels protected_oe property

A map of channels.
protected $channels

$connected protected_oe property

Indicates if the client is connected.
protected $connected

$dms protected_oe property

A map of direct message channels.
protected $dms

$groups protected_oe property

A map of groups.
protected $groups

$lastMessageId protected_oe property

The ID of the last payload sent to Slack.
protected $lastMessageId

$pendingMessages protected_oe property

An array of pending messages waiting for successful confirmation from Slack.
protected $pendingMessages

$team protected_oe property

The team logged in to.
protected $team

$users protected_oe property

A map of users.
protected $users

$websocket protected_oe property

A websocket connection to the Slack API.
protected $websocket