public function loadCommand($command) { if ($command instanceof Command\BaseCommand) { $this->commands[$command->getName()] = $command; } else { throw new \Exception('Command must implement PhpSlackBot\\Command\\BaseCommand'); } }
<?php use gries\Pokebot\Command\PokemathCommand; use PhpSlackBot\Bot; require_once __DIR__ . '/../vendor/autoload.php'; $bot = new Bot(); $bot->setToken('token'); $bot->loadCommand(new PokemathCommand()); $bot->run();