本文整理汇总了PHP中CL\Slack\Payload\PayloadInterface::getChannel方法的典型用法代码示例。如果您正苦于以下问题:PHP PayloadInterface::getChannel方法的具体用法?PHP PayloadInterface::getChannel怎么用?PHP PayloadInterface::getChannel使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CL\Slack\Payload\PayloadInterface
的用法示例。
在下文中一共展示了PayloadInterface::getChannel方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getExpectedPayloadData
/**
* {@inheritdoc}
*
* @param ChatPostMessagePayload $payload
*/
protected function getExpectedPayloadData(PayloadInterface $payload)
{
/** @var Attachment $attachment */
$attachment = $payload->getAttachments()->first();
/** @var AttachmentField $attachmentField */
$attachmentField = $attachment->getFields()->first();
return ['channel' => $payload->getChannel(), 'text' => $payload->getText(), 'username' => $payload->getUsername(), 'icon_emoji' => $payload->getIconEmoji(), 'icon_url' => $payload->getIconUrl(), 'unfurl_media' => $payload->getUnfurlMedia(), 'unfurl_links' => $payload->getUnfurlLinks(), 'link_names' => $payload->getLinkNames(), 'parse' => $payload->getParse(), 'attachments' => json_encode([['title' => $attachment->getTitle(), 'title_link' => $attachment->getTitleLink(), 'image_url' => $attachment->getImageUrl(), 'author_name' => $attachment->getAuthorName(), 'author_link' => $attachment->getAuthorLink(), 'author_icon' => $attachment->getAuthorIcon(), 'pre_text' => $attachment->getPreText(), 'text' => $attachment->getText(), 'color' => $attachment->getColor(), 'fallback' => $attachment->getFallback(), 'fields' => [['title' => $attachmentField->getTitle(), 'value' => $attachmentField->getValue(), 'short' => $attachmentField->isShort()]]]])];
}
示例2: getExpectedPayloadData
/**
* {@inheritdoc}
*
* @param ChannelsJoinPayload $payload
*/
protected function getExpectedPayloadData(PayloadInterface $payload)
{
return ['name' => $payload->getChannel()];
}