Download the PHP package hesmatt/discord-hooker without Composer
On this page you can find all versions of the php package hesmatt/discord-hooker. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download hesmatt/discord-hooker
More information about hesmatt/discord-hooker
Files in hesmatt/discord-hooker
Package discord-hooker
Short Description A lightweight Discord webhook client library for PHP
License
Informations about the package discord-hooker
Discord Hooker
Discord Hooker is a lighweight Discord webhook client library for PHP (>=7.0)
Installation
You just make your project require it via Composer 👀
Usage
It's pretty simple to use Discord Hooker, let's start with an example that includes just message.
Basic usage
The result
We can also set the username and image, you can do that via the Webhook settings in Discord as well, but this way we can 'enforce' a different one that's not set there.
Let's change the code a bit
The result
Using embeds
You are also able to build Embeds and send them, that's probably the thing you'll be using the most, to make your messages look sexy 🌶️
It's not hard to build and add Embed, and the best thing is that you can add as many of them as you want (Or as Discord will let you 😉)
Let's start by building an Embed, an Embed can be something as simple as just a title.
We need to send it now.
The result
The embeds have many settings, I'll be listing them here without 'The result' part, to not make it any longer than it is necessary.
Adding a footer to embed
Setting a color
Setting a thumbnail
Adding an author
Adding a field
We can of course combine any of these together, note that at least one field is required. So you need either an actual field, or title/description.
Contributing
Contributions are always welcome!