add Usage support & add no argu func support

This commit is contained in:
dennydai
2016-06-16 17:20:20 +08:00
parent c464bcf46c
commit 1f47f997ba
3 changed files with 61 additions and 61 deletions
+9 -15
View File
@@ -1,16 +1,10 @@
<?php
foreach ($TAGs as $TAG) {
if (preg_match("/^(".preg_quote($TAG, '/')."help|".preg_quote($TAG, '/')."help".preg_quote('@').BOT_NAME.")$/", $text)) {
foreach ($load_plugins as $value) {
$plugin_name = substr($value, strlen(PATH.'plugins'.DIRECTORY_SEPARATOR), -4);
$lines=file($value);
eval($lines[1]);
}
$plugin_list = HELP_BEGIN."\n";
foreach ($plugins as $value) {
$plugin_list .= "\n".$value;
}
$plugin_list .= "\n\n".HELP_END;
$BOT->msg($from, $plugin_list);
}
}
PluginSet("Show help",null,false);
$plugin_list = HELP_BEGIN."\n";
foreach ($plugins as $value) {
if ($value['visible'] == True) {
$plugin_list .= "\n".$value['desc'];
}
}
$plugin_list .= "\n\n".HELP_END;
$BOT->msg($from, $plugin_list);