lefuturiste/discord-webhooks

一个简单的Discord webhook客户端库。

0.2.3 2017-10-25 21:14 UTC

This package is auto-updated.

Last update: 2024-09-20 08:07:02 UTC


README

Discord webhooks是一个简单的Discord webhook API客户端。

动机

虽然这可能是Discord webhook系统的“又一”库,但我还是想自己实现。Discord不支持BitBucket的webhook系统,而且与Slack兼容的端点不发送消息。

入门

您可以直接将PHP文件复制到项目中,或者更推荐使用composer。

Composer require命令

composer require nopjmp/discord-webhooks

用法

使用起来相当简单。我将提供一个示例。

use \DiscordWebhooks\Client;
use \DiscordWebhooks\Embed;

$webhook = new Client('DISCORD_WEBHOOK_URL');
$embed = new Embed();

$embed->description('This is an embed');

$webhook->username('Bot')->message('Hello, Human!')->embed($embed)->send();

许可证

该项目采用MIT许可证。要阅读完整的许可证,请打开LICENSE.md

贡献

拉取请求和问题都是开放的!