{"id":36972258,"url":"https://github.com/marcio1002/discord-webhook-sdk-php","last_synced_at":"2026-01-13T21:55:54.822Z","repository":{"id":62550487,"uuid":"488204304","full_name":"marcio1002/discord-webhook-sdk-php","owner":"marcio1002","description":"This sdk provides a simple way to send messages by webhooks in discord ","archived":false,"fork":false,"pushed_at":"2022-11-06T00:05:28.000Z","size":240,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-03-22T22:02:25.880Z","etag":null,"topics":["discord","discord-php","webhooks"],"latest_commit_sha":null,"homepage":"https://packagist.org/packages/marcio1002/discord-webhook-sdk-php","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/marcio1002.png","metadata":{"files":{"readme":"README.MD","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-05-03T12:37:56.000Z","updated_at":"2023-08-14T17:35:56.000Z","dependencies_parsed_at":"2023-01-21T01:50:17.290Z","dependency_job_id":null,"html_url":"https://github.com/marcio1002/discord-webhook-sdk-php","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/marcio1002/discord-webhook-sdk-php","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marcio1002%2Fdiscord-webhook-sdk-php","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marcio1002%2Fdiscord-webhook-sdk-php/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marcio1002%2Fdiscord-webhook-sdk-php/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marcio1002%2Fdiscord-webhook-sdk-php/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/marcio1002","download_url":"https://codeload.github.com/marcio1002/discord-webhook-sdk-php/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marcio1002%2Fdiscord-webhook-sdk-php/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28401970,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-13T14:36:09.778Z","status":"ssl_error","status_checked_at":"2026-01-13T14:35:19.697Z","response_time":56,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["discord","discord-php","webhooks"],"created_at":"2026-01-13T21:55:54.145Z","updated_at":"2026-01-13T21:55:54.818Z","avatar_url":"https://github.com/marcio1002.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Discord Webhook PHP\n\n\u003cdiv align='center'\u003e\n    \u003cimg src='./assets/send-message.png' alt='Message sent in Discord by webhook' width='50%'/\u003e\n\u003c/div\u003e\n\n---\n\n## installation\n\n```\ncomposer require marcio1002/discord-webhook-sdk-php\n```\n\n## Constructor parameter options\n\nPass an array of options to the constructor, note that the webhook url is required.\n\n| param       | type    | description                                                                                                                       | Required |\n| ----------- | ------- | --------------------------------------------------------------------------------------------------------------------------------- | -------- |\n| webhook_id | string  | The webhook ID | Yes      |\n| token | string | The webhook token | Yes\n| tts         | boolean | If true read message to channel members                                                                                           | No       |\n| thread_id  | string  | Name of thread to create (requires the webhook channel to be a forum channel)                                                     | No       |\n\n## Sending simple message\n\n```php\nuse Marcio1002\\DiscordWebhook\\DiscordWebhook;\n\n$webhook = new DiscordWebhook([\n    'webhook_id' =\u003e '12345686',\n    'token' =\u003e 'dghjt4fw3tk7865edfgt67iykmdw45g$Gdeg4C_VGHT43RW',\n]);\n\n\n//Synchronous envio\n$webhook-\u003esendMessage('This is a message', true);\n\n//Asynchronous envio\n$webhook-\u003esendMessage('This is a message');\n\n```\n\n## Changing the webhook\n\nWith the Message class you can change the name, url, define the content and create embeds\n\n```php\nuse Marcio1002\\DiscordWebhook\\DiscordWebhook;\nuse Marcio1002\\DiscordWebhook\\Message;\n\n$message = new Message();\n    -\u003esetUsername('DC Notification')\n    -\u003esetAvatar('URL');\n    -\u003esetContent('Alert message');\n\n$webhook\n    -\u003esendMessage($message)\n    -\u003ethen(\n        fn() =\u003e print_r('Success!'),\n        fn(\\Throwable $err) =\u003e print_r($err-\u003egetMessage())\n    )\n\n```\n\n## Sending embed\n\n```php\nuse Marcio1002\\DiscordWebhook\\DiscordWebhook;\nuse Marcio1002\\DiscordWebhook\\MessageEmbed;\n\n$message_embed = new MessageEmbed();\n\n$message_embed\n    -\u003esetTitle('Title')\n    -\u003esetDescription('Description');\n    -\u003esetThumbnail('URL')\n\n$discord-\u003esendMessage($message_embed);\n\n\n$embeds = range(0, 9); // limit 10 embeds\n\n$embeds = array_map(\n    fn ($n) =\u003e (new MessageEmbed)\n        -\u003esetTitle(\"Title $n\"),\n        -\u003esetColor(MessageEmbed::randomColor())\n    $embeds\n);\n\n$webhook-\u003esendMessage($embeds);\n```\n\n## Sending facades class\n\n```php\nuse Marcio1002\\DiscordWebhook\\Facades\\DiscordWebhook;\n\nDiscordWebhook::configure([\n    'webhook_id' =\u003e '12345686',\n    'token' =\u003e 'dghjt4fw3tk7865edfgt67iykmdw45g$Gdeg4C_VGHT43RW',\n]);\n\nDiscordWebhook::sendMessage('Message');\n```\n\n## Edit, get and delete message\n\nWhen editing the message you can pass the same parameter that is passed in the **sendMessage** method\n\n```php\nDiscordWebhook::configure([\n    'webhook_id' =\u003e '12345686',\n    'token' =\u003e 'dghjt4fw3tk7865edfgt67iykmdw45g$Gdeg4C_VGHT43RW',\n]);\n\nDiscordWebhook::editMessage('ID', 'message', true);\n\nDiscordWebhook::getMessage('ID')-\u003ethen(fn($message) =\u003e print_r($message));\n\nDiscordWebhook::deleteMessage('ID', true);\n\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarcio1002%2Fdiscord-webhook-sdk-php","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmarcio1002%2Fdiscord-webhook-sdk-php","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarcio1002%2Fdiscord-webhook-sdk-php/lists"}