If the response match a Slack API error, a Nexy\Slack\Exception\SlackApiException
will be thrown.
It can be BC break if you are alredy mannaging API exception with HTTPPlug.
We got entirely rid of HTTP management thanks to PSR-17 and PSR-18.
You do not need to rely on HTTPlug anymore, but to any client matching the conventions.
The Nexy\Slack\Client
constructor parameters are changed:
Before:
$client = new \Nexy\Slack\Client('https://hooks.slack.com/...', [
'username' => 'Cyril',
'channel' => '#accounting',
'link_names' => true,
]);
After (Using HTTPlug discovery component):
$client = new \Nexy\Slack\Client(
\Http\Discovery\Psr18ClientDiscovery::find(),
\Http\Discovery\Psr17FactoryDiscovery::findRequestFactory(),
\Http\Discovery\Psr17FactoryDiscovery::findStreamFactory(),
'https://hooks.slack.com/...',
[
'username' => 'Cyril', // Default messages are sent from 'Cyril'
'channel' => '#accounting', // Default messages are sent to '#accounting'
'link_names' => true
]
);