public
|
#
__construct( React\EventLoop\LoopInterface $loop, GuzzleHttp\ClientInterface $httpClient = null )
Creates a new API client instance.
Creates a new API client instance.
Parameters
- $loop
$httpClient A Guzzle client instance to
send requests with.
- $httpClient
|
public
|
#
setToken( string $token )
Sets the Slack API token to be used during method calls.
Sets the Slack API token to be used during method calls.
Parameters
- $token
- The API token string.
|
public
Slack\Message\MessageBuilder
|
#
getMessageBuilder( )
Gets a message builder for creating a new message object.
Gets a message builder for creating a new message object.
Returns
|
public
React\Promise\PromiseInterface
|
#
getAuthedUser( )
Gets the currently authenticated user.
Gets the currently authenticated user.
Returns
React\Promise\PromiseInterface A promise for the currently authenticated user.
|
public
React\Promise\PromiseInterface
|
#
getTeam( )
Gets information about the current Slack team logged in to.
Gets information about the current Slack team logged in to.
Returns
React\Promise\PromiseInterface A promise for the current Slack team.
|
public
React\Promise\PromiseInterface
|
#
getChannelGroupOrDMByID( string $id )
Gets a channel, group, or DM channel by ID.
Gets a channel, group, or DM channel by ID.
Parameters
Returns
React\Promise\PromiseInterface A promise for a channel interface.
|
public
React\Promise\PromiseInterface
|
#
getChannels( )
Gets all channels in the team.
Gets all channels in the team.
Returns
React\Promise\PromiseInterface
|
public
React\Promise\PromiseInterface
|
#
getChannelById( string $id )
Gets a channel by its ID.
Gets a channel by its ID.
Parameters
Returns
React\Promise\PromiseInterface A promise for a channel object.
|
public
React\Promise\PromiseInterface
|
#
getChannelByName( string $name )
Gets a channel by its name.
Gets a channel by its name.
Parameters
- $name
- The name of the channel.
Returns
React\Promise\PromiseInterface
|
public
React\Promise\PromiseInterface
|
#
getGroups( )
Gets all groups the authenticated user is a member of.
Gets all groups the authenticated user is a member of.
Returns
React\Promise\PromiseInterface
|
public
React\Promise\PromiseInterface
|
#
getGroupById( string $id )
Gets a group by its ID.
Parameters
Returns
React\Promise\PromiseInterface A promise for a group object.
|
public
React\Promise\PromiseInterface
|
#
getGroupByName( string $name )
Gets a group by its name.
Gets a group by its name.
Parameters
- $name
- The name of the group.
Returns
React\Promise\PromiseInterface
|
public
React\Promise\PromiseInterface
|
#
getDMs( )
Gets all DMs the authenticated user has.
Gets all DMs the authenticated user has.
Returns
React\Promise\PromiseInterface
|
public
React\Promise\PromiseInterface
|
#
getDMById( string $id )
Gets a direct message channel by its ID.
Gets a direct message channel by its ID.
Parameters
Returns
React\Promise\PromiseInterface A promise for a DM object.
|
public
React\Promise\PromiseInterface
|
#
getDMByUser( Slack\User $user )
Gets a direct message channel for a given user.
Gets a direct message channel for a given user.
Parameters
- $user
- The user to get a DM for.
Returns
React\Promise\PromiseInterface A promise for a DM object.
|
public
React\Promise\PromiseInterface
|
#
getDMByUserId( string $id )
Gets a direct message channel by user's ID.
Gets a direct message channel by user's ID.
Parameters
Returns
React\Promise\PromiseInterface A promise for a DM object.
|
public
React\Promise\PromiseInterface
|
#
getUsers( )
Gets all users in the Slack team.
Gets all users in the Slack team.
Returns
React\Promise\PromiseInterface A promise for an array of users.
|
public
React\Promise\PromiseInterface
|
#
getUserById( string $id )
Gets a user by its ID.
Parameters
Returns
React\Promise\PromiseInterface A promise for a user object.
|
public
React\Promise\PromiseInterface
|
#
getUserByName( $username )
Gets a user by username.
If the user could not be found, the returned promise is rejected with a
UserNotFoundException exception.
Returns
React\Promise\PromiseInterface A promise for a user object.
|
public
React\Promise\PromiseInterface
|
#
send( string $text, Slack\ChannelInterface $channel )
Sends a regular text message to a given channel.
Sends a regular text message to a given channel.
Parameters
- $text
- The message text.
- $channel
- The channel to send the message to.
Returns
React\Promise\PromiseInterface
|
public
React\Promise\PromiseInterface
|
|
public
React\Promise\PromiseInterface
|
#
apiCall( string $method, array $args = [] )
Sends an API request.
Parameters
- $method
- The API method to call.
- $args
An associative array of arguments to pass to the
method call.
Returns
React\Promise\PromiseInterface A promise for an API response.
|