{"id":26066453,"url":"https://github.com/psecio/dbot","last_synced_at":"2025-04-11T16:26:33.232Z","repository":{"id":74279219,"uuid":"108041855","full_name":"psecio/dbot","owner":"psecio","description":"Discord bot platform for PHP","archived":false,"fork":false,"pushed_at":"2017-10-24T16:27:37.000Z","size":7,"stargazers_count":7,"open_issues_count":0,"forks_count":3,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-25T12:40:51.370Z","etag":null,"topics":["bot","discord","php","platform"],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/psecio.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-10-23T21:31:35.000Z","updated_at":"2022-05-15T22:08:40.000Z","dependencies_parsed_at":null,"dependency_job_id":"3018013a-1683-4367-a890-b1a46325e79f","html_url":"https://github.com/psecio/dbot","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/psecio%2Fdbot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/psecio%2Fdbot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/psecio%2Fdbot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/psecio%2Fdbot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/psecio","download_url":"https://codeload.github.com/psecio/dbot/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248439691,"owners_count":21103660,"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":["bot","discord","php","platform"],"created_at":"2025-03-08T20:52:07.264Z","updated_at":"2025-04-11T16:26:33.225Z","avatar_url":"https://github.com/psecio.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"## DBot: A Discord bot in PHP\n\nThe `DBot` library provides a long-running bot process written in PHP.\n\n### Installation\n\n```\ngit clone git@github.com:psecio/dbot.git\ncomposer install\n```\n\nCopy the `.env.dist` file to `.env` and configure it with your bot's token.\n\n### Usage\n\n```\nphp bin/dbot.php\n```\n\n\n### Adding a Dispatch action\n\nWhen the Discord API sends a new event on the websocket, your bot will receive the message with a `t` value in the JSON. This is the \"dispatch type\". Handlers for these can be added to the `bin/dbot.php` script like this for a `GUILD_CREATE`:\n\n```php\n\u003c?php\n$bot = new Bot($_ENV['BOT_TOKEN']);\n\n$bot-\u003eaddDispatch('GUILD_CREATE', function($json) {\n    echo 'guild create!!!!'.\"\\n\";\n\n    return 'test';\n});\n\n$bot-\u003einit();\n?\u003e\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpsecio%2Fdbot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpsecio%2Fdbot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpsecio%2Fdbot/lists"}