Package for creating discord webhooks
- PHP 8.1=<
- Composer 2
- Basic PHP OOP Knowledge
- Basic Knowledge on discord webhooks
$webhook = new Webhook("https://discord.com/api/webhooks/xxxxxx/xxxxxx");
$webhook->setContent("Hello world!")->send();
$webhook
->addEmbeds(Embed::new()
->setTitle("Basic Embed")
->setDescription("A basic embedded message")
->setColor("#8800FF")
->addFields(
Field::new()
->setName("Field 1")
->setValue("Field 2"),
Field::new()
->setName("Field 2")
->setValue("Field 2"),
Field::new()
->setName("Field 3")
->setValue("Field 3")
)
)
->send()
;
$webhook
->addFile("/path/to/file")
->send()
;
$webhook
->addQueryParam(QueryParamTypes::THREAD_ID, "<thread_id>")
// ...
;
or
$webhook = new Webhook("https://discord.com/api/webhooks/xxxxxx/xxxxxx", "<thread_id>");