{"id":20940054,"url":"https://github.com/livaconew/easydiscordwebhook","last_synced_at":"2025-05-13T22:32:11.880Z","repository":{"id":62518029,"uuid":"215415100","full_name":"LivacoNew/EasyDiscordWebhook","owner":"LivacoNew","description":"A simple PHP library for sending and making Discord Webhooks.","archived":false,"fork":false,"pushed_at":"2023-01-16T19:24:56.000Z","size":22,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-19T14:59:39.060Z","etag":null,"topics":["composer","discord","library","php","webhook"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/LivacoNew.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-10-15T23:31:23.000Z","updated_at":"2024-04-06T23:24:20.000Z","dependencies_parsed_at":"2023-02-10T05:40:22.560Z","dependency_job_id":null,"html_url":"https://github.com/LivacoNew/EasyDiscordWebhook","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LivacoNew%2FEasyDiscordWebhook","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LivacoNew%2FEasyDiscordWebhook/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LivacoNew%2FEasyDiscordWebhook/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LivacoNew%2FEasyDiscordWebhook/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/LivacoNew","download_url":"https://codeload.github.com/LivacoNew/EasyDiscordWebhook/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254036820,"owners_count":22003658,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["composer","discord","library","php","webhook"],"created_at":"2024-11-18T23:08:43.278Z","updated_at":"2025-05-13T22:32:09.668Z","avatar_url":"https://github.com/LivacoNew.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# EasyDiscordWebhook\nEasyDiscordWebhook is a simple, easy to use library to allow you to create and send discord webhooks in PHP with minimal effort.  \n\n## Installation\nEasyDiscordWebhook can be installed just like any other composer package.  \n`composer require livaco\\easydiscordwebhook`\n\n## Usage\nTo get started, we'll start by making a `DiscordWebhook` object. This is done as such.\n```php\n$webhook = DiscordWebhook::new(\"https://discord.com/api/webhooks/your/webhook\");\n```\nThe argument in the `new` function is for your webhook url.  \nNext, we can begin setting what our webhook should contain. Every webhook requires either text in the content, or at least one embed.  \nWe'll keep it simple for now though, and just have it say o'l \"Hello, world!\". EasyDiscordWebhook supports fluent interface, so we'll use that as well and get rid of the `$webhook` variable.  \nTo set the content of the webhook, we'll use the `setContent` function. To send it, you from here just need to call the `execute` function.\n```php\nDiscordWebhook::new(\"https://discord.com/api/webhooks/your/webhook\")\n    -\u003esetContent(\"Hello, world!\")\n    -\u003eexecute();\n```\n![The webhook that was sent](https://upload.livaco.dev/u/0CEQT8MGoW.png)  \n  \nCool, right? Let's add an embed now. Let's pretend it's a game information webhook, and we want some basic information about Cyberpunk 2077 (I suck at examples, so this is the best I got).  \nEmbeds are added using the `addEmbed` function. From there, we can feed it an embed object that has all the information attached to it. Once again, we create this object using `Embed::new()` and from there we can use the functions provided to fill out the data.\n```php\nDiscordWebhook::new(\"https://discord.com/api/webhooks/your/webhook\")\n    -\u003eaddEmbed(Embed::new()\n        -\u003esetTitle(\"Cyberpunk 2077\")\n        -\u003esetDescription(\"Cyberpunk 2077 is an open-world, action-adventure RPG set in the megalopolis of Night City, where you play as a cyberpunk mercenary wrapped up in a do-or-die fight for survival. Improved and featuring all-new free additional content, customize your character and playstyle as you take on jobs, build a reputation, and unlock upgrades. The relationships you forge and the choices you make will shape the story and the world around you. Legends are made here. What will yours be?\")\n        -\u003eaddField(\"Release Date\", \"December 10, 2020\", true)\n        -\u003eaddField(\"Platforms\", \"All Major Platforms\", true)\n        -\u003eaddField(\"Developer\", \"CD Projekt Red\", true)\n        -\u003esetColor(\"#FCFF2B\")\n        -\u003esetUrl(\"https://www.cyberpunk.net/gb/en/\")\n        -\u003esetImage(\"https://upload.livaco.dev/u/nYLGepk6X2.png\")\n    )\n    -\u003eexecute();\n```\n![The webhook that was posted](https://upload.livaco.dev/u/PrwU3YgfMW.png)  \n\nIf you want more examples, take a look in /examples.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flivaconew%2Feasydiscordwebhook","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flivaconew%2Feasydiscordwebhook","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flivaconew%2Feasydiscordwebhook/lists"}