update: 优化插件参数
This commit is contained in:
		
							parent
							
								
									1c2d1757b3
								
							
						
					
					
						commit
						d3c6a0048b
					
				|  | @ -84,7 +84,8 @@ export class Plugin { | ||||||
|    * @param priority 优先级,数字越小优先级越高 |    * @param priority 优先级,数字越小优先级越高 | ||||||
|    * @param rule 优先级,数字越小优先级越高 |    * @param rule 优先级,数字越小优先级越高 | ||||||
|    */ |    */ | ||||||
|   constructor({ |   constructor(init?: PluginSuperType) { | ||||||
|  |     const { | ||||||
|       event, |       event, | ||||||
|       priority = 5000, |       priority = 5000, | ||||||
|       rule, |       rule, | ||||||
|  | @ -93,13 +94,15 @@ export class Plugin { | ||||||
|       handler, |       handler, | ||||||
|       namespace, |       namespace, | ||||||
|       task, |       task, | ||||||
|   }: PluginSuperType) { |     } = init | ||||||
|     name && (this.name = name) |     name && (this.name = name) | ||||||
|     dsc && (this.dsc = dsc) |     dsc && (this.dsc = dsc) | ||||||
|     event && (this.event = event) |     event && (this.event = event) | ||||||
|     priority && (this.priority = priority) |     priority && (this.priority = priority) | ||||||
| 
 | 
 | ||||||
|     /** 定时任务,可以是数组 */ |     /** | ||||||
|  |      * 定时任务,可以是数组 | ||||||
|  |      */ | ||||||
|     task && |     task && | ||||||
|       (this.task = { |       (this.task = { | ||||||
|         /** 任务名 */ |         /** 任务名 */ | ||||||
|  | @ -110,7 +113,9 @@ export class Plugin { | ||||||
|         cron: task?.cron ?? '' |         cron: task?.cron ?? '' | ||||||
|       }) |       }) | ||||||
| 
 | 
 | ||||||
|     /** 命令规则 */ |     /** | ||||||
|  |      * 命令规则 | ||||||
|  |      */ | ||||||
|     rule && (this.rule = rule) |     rule && (this.rule = rule) | ||||||
| 
 | 
 | ||||||
|     if (handler) { |     if (handler) { | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue