https://github.com/gianarb/girc
IRC bot written in PHP
https://github.com/gianarb/girc
Last synced: over 1 year ago
JSON representation
IRC bot written in PHP
- Host: GitHub
- URL: https://github.com/gianarb/girc
- Owner: gianarb
- License: mit
- Created: 2014-02-15T13:00:22.000Z (over 12 years ago)
- Default Branch: master
- Last Pushed: 2014-02-26T09:28:56.000Z (over 12 years ago)
- Last Synced: 2025-02-01T21:43:41.759Z (over 1 year ago)
- Language: PHP
- Size: 199 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## Girc
Girc is a simple irc Bot written in PHP.
### Use Case
``` php
$con = new \Girc\Connection\Socket("irc.freenode.net", 6667);
$bot = new \Girc\Bot($con);
$bot->getEventManager()->attach("Bot::run", function(\Zend\EventManager\Event $e){
$b = $e->getParam('bot');
$m = $e->getParam('message');
if(preg_match("/!hello/", $m)){
$b->getConnection()->send(\Girc\Command\PrivMsg::send("#BotDiProva", "Hi!!"));
}
});
$bot->run();
```
### Install
``` bash
git clone https://github.com/gianarb/girc.git
cd girc
composer install
```