Added metadata definition for chat.postMessage and history#156
Merged
damienalexandre merged 6 commits intojolicode:mainfrom Nov 10, 2023
Merged
Added metadata definition for chat.postMessage and history#156damienalexandre merged 6 commits intojolicode:mainfrom
damienalexandre merged 6 commits intojolicode:mainfrom
Conversation
|
The temporary solution is create a custom endpoint class, and use this class to call api method: <?php
use JoliCode\Slack\Api\Endpoint\ChatPostMessage;
final class FixedChatPostMessageEndpoint extends ChatPostMessage
{
protected function getFormOptionsResolver(): \Symfony\Component\OptionsResolver\OptionsResolver
{
$optionsResolver = parent::getFormOptionsResolver();
$optionsResolver->setDefined(['metadata']);
$optionsResolver->setAllowedTypes('metadata', ['string']);
return $optionsResolver;
}
}
$slack->executeEndpoint(new FixedChatPostMessageEndpoint([
'channel' => $channel,
'text' => $text,
'metadata' => $metadata,
])); |
damienalexandre
requested changes
Oct 31, 2023
Member
damienalexandre
left a comment
There was a problem hiding this comment.
Hello, sorry for the very long delay on the review.
I fear the ".patch" file is wrong, it includes A LOT of changes that have nothing to do with the metadata definition 🤔 Maybe it's just because Slack updated their definition, but we should then split this in two PR.
Thank you for your understanding 🙏
Contributor
Author
|
Hello, |
Member
|
Thanks for working on this! Tests on
And push? |
Member
|
Awesome, thank you so much! |
Member
|
Version v4.6.0 is published! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The Slack documentation says that we can include metadata in
chat.postMessagearguments. See : https://api.slack.com/metadataOpenApi spec for this argument doesn't seem to be up to date.
So I added it to the patched version for message definition and
chat.postMessagemethod. I also added theinclude_all_metadataargument for theconversations.historymethod