diff --git a/.gitignore b/.gitignore index 38b6093..73257f9 100644 --- a/.gitignore +++ b/.gitignore @@ -2,6 +2,7 @@ uploaded_images/ bot_data/ .env +music/ # composer packages vendor/ # unneccessary diff --git a/src/Commands/AsciiArt.php b/src/Commands/AsciiArt.php new file mode 100644 index 0000000..142fe53 --- /dev/null +++ b/src/Commands/AsciiArt.php @@ -0,0 +1,41 @@ +registerCommand('ascii', [__CLASS__, 'ascii'], [ + 'description' => 'creates ascii word art', + 'usage' => '', + ]); + + echo __CLASS__ . " registered", PHP_EOL; + } + + + public static function ascii($msg, $args) + { + $process = new Process('figlet hi'); + $process->start(self::$bot->loop); + + $response = ""; + + $process->stdout->on('data', function ($chunk) use (&$response) { + $response .= $chunk; + }); + + $process->on('exit', function ($code) use ($msg, $response) { + Utils::send($msg, $response); + }); + + } + +} \ No newline at end of file