public function init()
    {
        // Ugh...PHP 5.3, you're killin' me.
        $that = $this;

        // Get me an image!
        $this->bot->onChannel('/^!(?:img|image) (.+)$/i', function(Event $event) use ($that) {
            $matches = $event->getMatches();
            if ($img = $that->getImage(trim($matches[0]), false)) {
                $event->addResponse(Response::msg($event->getRequest()->getSource(), $img));
            }
        });


        // Get me a gif!
        $this->bot->onChannel('/^!gif (.+)$/i', function(Event $event) use ($that) {
            $matches = $event->getMatches();
            if ($img = $that->getImage(trim($matches[0]), true)) {
                $event->addResponse(Response::msg($event->getRequest()->getSource(), $img));
            }
        });
    }
public function init()
    {
        // Ugh...PHP 5.3, you're killin' me.
        $that = $this;

        // Get me an image!
        $this->bot->onChannel('/^!(?:img|image) (.+)$/i', function(Event $event) use ($that) {
            $matches = $event->getMatches();
            if ($img = $that->getImage(trim($matches[0]), false)) {
                $event->addResponse(Response::msg($event->getRequest()->getSource(), $img));
            }
        });


        // Get me a gif!
        $this->bot->onChannel('/^!gif (.+)$/i', function(Event $event) use ($that) {
            $matches = $event->getMatches();
            if ($img = $that->getImage(trim($matches[0]), true)) {
                $event->addResponse(Response::msg($event->getRequest()->getSource(), $img));
            }
        });
    }
public function init ( ) { // Ugh...PHP 5.3, you're killin' me. $ that = $ this ; // Get me an image! $ this -> bot -> onChannel ( '/^!(?:img|image) (.+)$/i' , function ( Event $ event ) use ( $ that ) { $ matches = $ event -> getMatches ( ) ; if ( $ img = $ that -> getImage ( trim ( $ matches [ 0 ] ) , false ) ) { $ event -> addResponse ( Response :: msg ( $ event -> getRequest ( ) -> getSource ( ) , $ img ) ) ; } } ) ; // Get me a gif! $ this -> bot -> onChannel ( '/^!gif (.+)$/i' , function ( Event $ event ) use ( $ that ) { $ matches = $ event -> getMatches ( ) ; if ( $ img = $ that -> getImage ( trim ( $ matches [ 0 ] ) , true ) ) { $ event -> addResponse ( Response :: msg ( $ event -> getRequest ( ) -> getSource ( ) , $ img ) ) ; } } ) ; }
Initialize the plugin.
Initialize the plugin .