PHP Class Slack\RealTimeClient

Inheritance: extends ApiClient, use trait Evenement\EventEmitterTrait
Afficher le fichier Open project: coderstephen/slack-client Class Usage Examples

Protected Properties

Свойство 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.

Méthodes publiques

Méthode 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

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

Method Details

connect() public méthode

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

disconnect() public méthode

Disconnects the client.
public disconnect ( )

getBotById() public méthode

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

getBots() public méthode

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

getChannelById() public méthode

{@inheritDoc}
public getChannelById ( $id )

getChannels() public méthode

{@inheritDoc}
public getChannels ( )

getDMById() public méthode

{@inheritDoc}
public getDMById ( $id )

getDMs() public méthode

{@inheritDoc}
public getDMs ( )

getGroupById() public méthode

{@inheritDoc}
public getGroupById ( $id )

getGroups() public méthode

{@inheritDoc}
public getGroups ( )

getTeam() public méthode

{@inheritDoc}
public getTeam ( )

getUserById() public méthode

{@inheritDoc}
public getUserById ( $id )

getUsers() public méthode

{@inheritDoc}
public getUsers ( )

isConnected() public méthode

Returns whether the client is connected.
public isConnected ( ) : boolean
Résultat boolean

postMessage() public méthode

{@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