-
Notifications
You must be signed in to change notification settings - Fork 58
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added metadata definition for chat.postMessage and history #156
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,
])); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 🙏
Hello, |
Thanks for working on this! Tests on
And push? |
Awesome, thank you so much! |
Version v4.6.0 is published! |
The Slack documentation says that we can include metadata in
chat.postMessage
arguments. 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.postMessage
method. I also added theinclude_all_metadata
argument for theconversations.history
method