{"id":15524197,"url":"https://github.com/leocavalcante/swoole-irc-client","last_synced_at":"2025-08-20T16:14:24.168Z","repository":{"id":57013940,"uuid":"303812619","full_name":"leocavalcante/swoole-irc-client","owner":"leocavalcante","description":"💬 Swoole based IRC (Internet Relay Chat) Client","archived":false,"fork":false,"pushed_at":"2020-10-14T19:53:10.000Z","size":122,"stargazers_count":14,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-29T22:41:18.525Z","etag":null,"topics":["hacktoberfest","irc-client","swoole"],"latest_commit_sha":null,"homepage":"https://tools.ietf.org/html/rfc1459","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/leocavalcante.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":"2020-10-13T19:47:18.000Z","updated_at":"2023-09-15T02:12:04.000Z","dependencies_parsed_at":"2022-08-21T14:50:37.600Z","dependency_job_id":null,"html_url":"https://github.com/leocavalcante/swoole-irc-client","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leocavalcante%2Fswoole-irc-client","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leocavalcante%2Fswoole-irc-client/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leocavalcante%2Fswoole-irc-client/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leocavalcante%2Fswoole-irc-client/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/leocavalcante","download_url":"https://codeload.github.com/leocavalcante/swoole-irc-client/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250390450,"owners_count":21422705,"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":["hacktoberfest","irc-client","swoole"],"created_at":"2024-10-02T10:49:40.818Z","updated_at":"2025-04-23T07:29:37.003Z","avatar_url":"https://github.com/leocavalcante.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Swoole IRC Client\n\n💬 [Swoole](https://www.swoole.co.uk/) based [IRC (Internet Relay Chat)](https://tools.ietf.org/html/rfc1459) Client.\n\n## Installation\n```bash\ncomposer require leocavalcante/swoole-irc-client\n```\n\n## Usage\n```php\nuse SwooleIrc\\{HandlerInterface, Reply, Client};\n\nclass MyHandler implements HandlerInterface {\n    public function onConnect(Client $irc): void {}\n    public function onReply(Reply $reply, Client $irc): void {}\n}\n\n$irc = Client::withHandler(new MyHandler());\n$irc-\u003econnect($host, $port);\n$irc-\u003estart();\n```\n\n### CallbackHandler\n\nThis library provides a convenient way to pass a regular callable as well if you don't want to create a class and implement an interface.\n\n```php\nuse SwooleIrc\\{Reply, Client, CallbackHandler};\n\n$handler = static function (Reply $reply): void {};\n\n$irc = Client::withHandler(CallbackHandler::reply($handler))\n    -\u003econnect($host, $port)\n    -\u003estart();\n```\n\n#### Examples\n- [Twitch.tv Chatbot](https://github.com/leocavalcante/swoole-irc-client/tree/main/examples/twitch)\n- [Freenode Chat CLI Client](https://github.com/leocavalcante/swoole-irc-client/tree/main/examples/freenode)\n\n## Commands\n\n### PASS\n```php\n$irc-\u003epass($password);\n```\n\n### NICK\n```php\n$irc-\u003enick($nickname);\n```\n\n### JOIN\n```php\n$irc-\u003ejoin([$channel]);\n$irc-\u003ejoin([$channel], [$key]);\n```\n\n### PART\n```php\n$irc-\u003epart([$channel]);\n```\n\n### PRIVMSG\n```php\n$irc-\u003eprivmsg([$channel], $text);\n```\n\n---\n\nPlease, for now, take a look at the source code to see all supported commands.\n\nAnd you can always implement `MessageInterface` to send your own messages thought `$irc-\u003esend(MessageInterface $message)`\nor send raw lines with `$irc-\u003ewriteln(string $raw)`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fleocavalcante%2Fswoole-irc-client","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fleocavalcante%2Fswoole-irc-client","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fleocavalcante%2Fswoole-irc-client/lists"}