List external commands in help. Allow reload of external commands (#12137)

This commit is contained in:
Olen
2020-09-22 14:34:01 +02:00
committed by GitHub
parent 4023baf899
commit 944d7c9ef9

View File

@@ -657,10 +657,14 @@ class IRCBot
//end _auth() //end _auth()
private function _reload() private function _reload($params)
{ {
if ($this->user['level'] == 10) { if ($this->user['level'] == 10) {
$new_config = Config::reload(); if ($params == 'external') {
$this->respond('Reloading external scripts.');
return $this->loadExternal();
}
$new_config = Config::load();
$this->respond('Reloading configuration & defaults'); $this->respond('Reloading configuration & defaults');
if ($new_config != $this->config) { if ($new_config != $this->config) {
return $this->__construct(); return $this->__construct();
@@ -698,12 +702,11 @@ class IRCBot
private function _help($params) private function _help($params)
{ {
foreach ($this->commands as $cmd) { $msg = join(', ', $this->commands);
$msg .= ', ' . $cmd; if (count($this->external) > 0) {
$msg .= ', '. join(', ', array_keys($this->external));
} }
$msg = substr($msg, 2);
return $this->respond("Available commands: $msg"); return $this->respond("Available commands: $msg");
} }