feat: support config showPublisher
				
					
				
			This commit is contained in:
		
							parent
							
								
									fb75824145
								
							
						
					
					
						commit
						b2cf70c17d
					
				| @ -1,7 +1,7 @@ | |||||||
| { | { | ||||||
|   "name": "koishi-plugin-market-info", |   "name": "koishi-plugin-market-info", | ||||||
|   "description": "Koishi plugin market information", |   "description": "Koishi plugin market information", | ||||||
|   "version": "1.1.3", |   "version": "1.1.4", | ||||||
|   "main": "lib/index.js", |   "main": "lib/index.js", | ||||||
|   "typings": "lib/index.d.ts", |   "typings": "lib/index.d.ts", | ||||||
|   "files": [ |   "files": [ | ||||||
|  | |||||||
| @ -24,6 +24,7 @@ export interface Config { | |||||||
|   interval: number |   interval: number | ||||||
|   showHidden: boolean |   showHidden: boolean | ||||||
|   showDeletion: boolean |   showDeletion: boolean | ||||||
|  |   showPublisher: boolean | ||||||
|   showDescription: boolean |   showDescription: boolean | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| @ -32,6 +33,7 @@ export const Config: Schema<Config> = Schema.object({ | |||||||
|   interval: Schema.number().default(Time.minute * 30).description('轮询间隔 (毫秒)。'), |   interval: Schema.number().default(Time.minute * 30).description('轮询间隔 (毫秒)。'), | ||||||
|   showHidden: Schema.boolean().default(false).description('是否显示隐藏的插件。'), |   showHidden: Schema.boolean().default(false).description('是否显示隐藏的插件。'), | ||||||
|   showDeletion: Schema.boolean().default(false).description('是否显示删除的插件。'), |   showDeletion: Schema.boolean().default(false).description('是否显示删除的插件。'), | ||||||
|  |   showPublisher: Schema.boolean().default(false).description('是否显示插件发布者。'), | ||||||
|   showDescription: Schema.boolean().default(false).description('是否显示插件描述。'), |   showDescription: Schema.boolean().default(false).description('是否显示插件描述。'), | ||||||
| }) | }) | ||||||
| 
 | 
 | ||||||
| @ -69,8 +71,11 @@ export function apply(ctx: Context, config: Config) { | |||||||
| 
 | 
 | ||||||
|         if (!version1) { |         if (!version1) { | ||||||
|           let output = `新增:${name}` |           let output = `新增:${name}` | ||||||
|  |           if (config.showPublisher) output += ` (@${current[name].publisher.username})` | ||||||
|  |           if (config.showDescription) { | ||||||
|             const { description } = current[name].manifest |             const { description } = current[name].manifest | ||||||
|           if (config.showDescription) output += `\n  ${description.zh || description.en}` |             output += `\n  ${description.zh || description.en}` | ||||||
|  |           } | ||||||
|           return output |           return output | ||||||
|         } |         } | ||||||
| 
 | 
 | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user