From 7772843630f82f0028893057adad65de6516b110 Mon Sep 17 00:00:00 2001 From: Fbenas Date: Sun, 14 Jun 2020 20:58:52 +0100 Subject: Add composer and a core bot script --- src/Bot/Application.php | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 src/Bot/Application.php (limited to 'src/Bot/Application.php') diff --git a/src/Bot/Application.php b/src/Bot/Application.php new file mode 100644 index 0000000..2b8dae0 --- /dev/null +++ b/src/Bot/Application.php @@ -0,0 +1,49 @@ +setName('bot:list'); + + $command->setExecuteCallback( + function (InputInterface $input, OutputInterface $output) { + $output->writeLn( + $this->getCommands() + ); + + return Command::SUCCESS; + } + ); + + $command2 = new Command; + $command2->setName('bot:reload'); + + $command2->setExecuteCallback( + function (InputInterface $input, OutputInterface $output) { + + $output->writeLn( + 'Config reloaded' + ); + + return Command::SUCCESS; + } + ); + + return [$command, $command2]; + } + + protected function getCommands() + { + return implode(', ', array_keys(parse_ini_file(__DIR__ . '/../../Blatech.ini', true))); + } +} -- cgit v1.2.3