feature #40992 [Notifier] Add SlackOptions::threadTs() to send message as reply (WaylandAce)

This PR was merged into the 5.3-dev branch.

Discussion
----------

[Notifier] Add SlackOptions::threadTs() to send message as reply

| Q             | A
| ------------- | ---
| Branch?       | 5.x
| Bug fix?      | no
| New feature?  | yes
| Deprecations? | no
| Tickets       | no
| License       | MIT
| Doc PR        | no

Allow specify argument [thread_ts](https://api.slack.com/methods/chat.postMessage#arg_thread_ts) to send reply message.

Commits
-------

d3807a79b8 [Notifier] Add SlackOptions::threadTs() to send message as reply
This commit is contained in:
Nicolas Grekas 2021-05-06 21:01:04 +02:00
commit ef2da6c887
3 changed files with 13 additions and 0 deletions

View File

@ -8,6 +8,7 @@ CHANGELOG
* Check for maximum number of buttons in Slack action block
* Add HeaderBlock
* Slack access tokens needs to start with "xox" (see https://api.slack.com/authentication/token-types)
* Add `SlackOptions::threadTs()` to send message as reply
5.2.0
-----

View File

@ -181,4 +181,14 @@ final class SlackOptions implements MessageOptionsInterface
return $this;
}
/**
* @return $this
*/
public function threadTs(string $threadTs): self
{
$this->options['thread_ts'] = $threadTs;
return $this;
}
}

View File

@ -70,6 +70,7 @@ final class SlackOptionsTest extends TestCase
yield [['unfurl_links' => true]];
yield [['unfurl_media' => true]];
yield [['username' => 'baz']];
yield [['thread_ts' => '1503435956.000247']];
}
/**
@ -111,6 +112,7 @@ final class SlackOptionsTest extends TestCase
yield ['unfurlLinks', 'unfurl_links', true];
yield ['unfurlMedia', 'unfurl_media', true];
yield ['username', 'username', 'baz'];
yield ['threadTs', 'thread_ts', '1503435956.000247'];
}
public function testSetBlock()