forked from miguel456/luke-bot
42 lines
880 B
PHP
42 lines
880 B
PHP
<?php
|
|
|
|
namespace nogueiracodes\RaspberryBot\Bot\Commands;
|
|
|
|
use Exception;
|
|
use nogueiracodes\RaspberryBot\Core\Interfaces\Command;
|
|
use nogueiracodes\RaspberryBot\Traits\HasSignature;
|
|
use Zttp\Zttp;
|
|
|
|
class Help implements Command
|
|
{
|
|
use HasSignature;
|
|
|
|
|
|
public $signature = "help {section: The section to retrieve help for}";
|
|
|
|
|
|
public function run(array $parameters)
|
|
{
|
|
|
|
switch($parameters['section'])
|
|
{
|
|
case "commands":
|
|
|
|
if(file_exists(PROJECT_ROOT . "/Commandfiles/help.txt"))
|
|
{
|
|
return str_replace("<prefix>", $_ENV['COMMAND_PREFIX'], file_get_contents(PROJECT_ROOT . "/Commandfiles/help.txt"));
|
|
}
|
|
else
|
|
{
|
|
return ":x: There is currently no available help.";
|
|
}
|
|
|
|
break;
|
|
|
|
default:
|
|
return ":x: There is no help section named " . $parameters['section'] . ".";
|
|
break;
|
|
}
|
|
}
|
|
}
|