{"id":36253593,"url":"https://github.com/agorlov/discordmsg","last_synced_at":"2026-01-11T07:03:30.682Z","repository":{"id":56942178,"uuid":"143513664","full_name":"agorlov/discordmsg","owner":"agorlov","description":"PHP Class to Send message to Discord channel (webhook)","archived":false,"fork":false,"pushed_at":"2018-12-28T07:43:14.000Z","size":10,"stargazers_count":11,"open_issues_count":1,"forks_count":4,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-12-15T00:35:30.414Z","etag":null,"topics":["discord","message","php","simple"],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/agorlov.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-08-04T08:59:36.000Z","updated_at":"2024-06-22T11:59:38.000Z","dependencies_parsed_at":"2022-08-21T07:20:35.568Z","dependency_job_id":null,"html_url":"https://github.com/agorlov/discordmsg","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/agorlov/discordmsg","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/agorlov%2Fdiscordmsg","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/agorlov%2Fdiscordmsg/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/agorlov%2Fdiscordmsg/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/agorlov%2Fdiscordmsg/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/agorlov","download_url":"https://codeload.github.com/agorlov/discordmsg/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/agorlov%2Fdiscordmsg/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28296941,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-11T04:44:51.577Z","status":"ssl_error","status_checked_at":"2026-01-11T04:44:44.232Z","response_time":60,"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","message","php","simple"],"created_at":"2026-01-11T07:03:30.622Z","updated_at":"2026-01-11T07:03:30.672Z","avatar_url":"https://github.com/agorlov.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Send message to Discord (php)\n\nVery simple code to send single messages to discord channel.\n\nThis code was originally writen to send service messages\nabout deploying my project to production.\n\n## How to Use\n\n### Composer\n\nExecute:\n\n```bash\n$ composer require agorlov/discordmsg\n``` \n\n**Create** ``example.php``:\n\n```php\n\u003c?php\n\nuse AG\\DiscordMsg;\n\nrequire_once './vendor/autoload.php';\n\n(new DiscordMsg('Greetings!'))-\u003esend();\n```\n\n**Run it:**\n\n```bash\n$ php example.php\n```\n\nCheck discord chanel (for tests), your message is there:\n\nhttps://discord.gg/jB5FsPf\n\n\n\n\n### Good old require_once\n\n1. Put Msg.php and DiscordMsg.php to your project: \n\n2. Check out how it works:\n\n\n``example.php``\n\n```php\nrequire_once 'Msg.php';\nrequire_once 'DiscordMsg.php';\n\n\necho \"To see dumb messages..\\n\";\necho \"..join the discordmsg chanel https://discord.gg/Bh4EZB and enjoy!\\n\";\necho \"Feel free to test!\\n\";\n\n\n// First message\n$msg = new \\AG\\DiscordMsg('Hello, Friends');\n$msg-\u003esend();\n\n\n// Second message\n(new \\AG\\DiscordMsg(\n    'I started the example.php, something happened?',\n    null,\n    $_ENV[\"USER\"] ?? 'Mr. Pitkin'\n))-\u003esend();\n\n\n// Third message\n(new \\AG\\DiscordMsg(\n    \"Maybe the missile is launched? :grimacing:\", // message\n    'https://discordapp.com/api/webhooks/475239272610398218/' . // chanel webhook link\n        'tfpeg5EFI_94oEHfltZwcB5UAurfcswkBw5mKouZCq-akhvxe5BNOtN16AqSHvmSwpum',\n    get_current_user(), // bot name\n    '' // avatar url\n))-\u003esend();\n\n\n```bash\n$ php example.php\n```\n\n## How to notify user\n\nThank to @bricecarbou (https://github.com/agorlov/discordmsg/issues/3)\n\nTo notify anybody by webhook, we need to use the \"real\" id of user (recover in discord with @\u003cusername\u003e) and use $msg=\"\u003c@id_recovered\u003e ...\n\n```php\n$msg = \"\u003c@4386638385456546554\u003e is notified\";\n(new \\AG\\DiscordMsg(\n  $msg, // message\n  $webhookurl, // chanel webhook link\n  \"Trad Bot\", // bot name\n  '' // avatar url\n))-\u003esend();\n```\n\n\n## How to get Webhook link\n\nOpen chanel preferences (if you have enough permissions):\n![image](https://user-images.githubusercontent.com/2485728/43675882-27431cc0-97f0-11e8-8092-917494a87bd3.png)\n\nCreate Webhook:\n![image](https://user-images.githubusercontent.com/2485728/43675886-33ca6872-97f0-11e8-93d9-1a48c35843a9.png)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fagorlov%2Fdiscordmsg","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fagorlov%2Fdiscordmsg","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fagorlov%2Fdiscordmsg/lists"}