nwilging / laravel-slack-bot

A Slack bot integration for Laravel projects
MIT License
17 stars 2 forks source link

Add unfurl options to payload #29

Closed lucidlogic closed 1 year ago

lucidlogic commented 1 year ago

Get unfurl links and unfurl media to work

nwilging commented 1 year ago

looks good! Could you add a couple test cases here: https://github.com/nwilging/laravel-slack-bot/blob/develop/tests/Unit/Services/SlackApiServiceTest.php#L357 to ensure the options array is built properly

nwilging commented 1 year ago

actually, this should already be possible: https://github.com/nwilging/laravel-slack-bot/blob/develop/src/Services/SlackApiService.php#L142

Try:

$options = [
   'unfurl' => [
      'links' => ...,
      'media' => ...,
   ],
];
lucidlogic commented 1 year ago

actually, this should already be possible: https://github.com/nwilging/laravel-slack-bot/blob/develop/src/Services/SlackApiService.php#L142

Try:

$options = [
   'unfurl' => [
      'links' => ...,
      'media' => ...,
   ],
];

yes, however the $options['unfurl'] don't get save to the $payload array that gets returned https://github.com/nwilging/laravel-slack-bot/blob/develop/src/Services/SlackApiService.php#L160