quitoque / slack-bundle
此包提供与 Slack API 库的集成,允许您在 Symfony 项目中与 Slack API 交互
此包的规范存储库似乎已不存在,因此该包已被冻结
0.21.1
2018-08-08 15:42 UTC
Requires
- php: >=5.5
- quitoque/slack: ^0.21.0
- symfony/framework-bundle: ^2.3|^3.0
Requires (Dev)
- dev-master
- 0.21.1
- 0.21.0
- 0.20.1
- 0.18.1
- 0.15.4
- 0.15.3
- 0.15.2
- 0.15.1
- 0.14.2
- 0.14.1
- 0.13.2
- 0.13.1
- 0.12.1
- 0.11.1
- 0.10.4
- 0.10.3
- 0.10.2
- 0.10.1
- 0.10.0
- 0.9.6.1
- 0.9.5
- 0.9.4
- 0.9.3
- 0.9.2
- 0.9.1
- 0.8.2
- 0.8.1
- 0.8
- 0.7
- 0.6
- 0.5
- 0.4
- 0.3
- 0.2
- 0.1
- dev-catching-up
- dev-refactored-due-to-factory-removal
- dev-preparing-for-0.12
This package is not auto-updated.
Last update: 2024-01-16 00:33:17 UTC
README
此 Symfony 扩展通过提供易于使用的服务和配置,将 Slack API 客户端 Slack API client 集成到项目中。
如果您想从命令行访问 Slack Web API,请考虑安装 slack-cli 包。
快速示例
以下是如何访问 API 的 chat.postMessage 方法并发送消息到您的 Slack 频道的示例
<?php // Acme\DemoBundle\Controller\MySlackController public function sendAction() { $payload = new ChatPostMessagePayload(); $payload->setChannel('#general'); // Channel names must begin with a hash-sign '#' $payload->setText('Hello world!'); // also supports Slack formatting $payload->setUsername('acme'); // can be anything you want $payload->setIconEmoji('birthday'); // check out emoji.list-payload for a list of available emojis $response = $this->get('cl_slack.api_client')->send($payload); // display the Slack channel ID on which the message was posted echo $response->getChannel(); // would return something like 'C01234567' // display the Slack timestamp on which the message was posted (note: NON-unix timestamp!) echo $response->getTimestamp(); // would return something like '1407190762.000000' }
在 Slack 中,您应该在 #general 频道中看到类似以下内容: 
更多示例可以在 使用说明 文档中找到。
文档
关于如何访问每个 API 方法的详细文档可以在该包集成的包的文档中找到: Slack API 库
感谢
贡献
如果您想为此包做出贡献,请查看贡献文档 这里。