Sakulin 3 сар өмнө
parent
commit
75c476c96d
1 өөрчлөгдсөн 5 нэмэгдсэн , 0 устгасан
  1. 5 0
      src/lib/decorators.ts

+ 5 - 0
src/lib/decorators.ts

@@ -73,6 +73,7 @@ export interface PluginConfig {
         command?: string[];     // 帮助命令
         description?: string;   // 帮助命令描述
     };
+    default?: () => ({}); // 默认函数
 }
 
 // 在 decorators.ts 中定义统一的接口
@@ -207,6 +208,10 @@ export function plugins(config: PluginConfig): ClassDecorator {
             plugin.commands.push(helpCommand);
             botlogger.info(`成功注册[${plugin.id}]帮助命令: ${CMD_PREFIX}${plugin.id} help`);
         }
+
+        if (!config.default) {
+            config.default = () => ({redirect: "help"});
+        }
     };
 }