feat: support i18n broadcast
This commit is contained in:
		
							parent
							
								
									b2cf70c17d
								
							
						
					
					
						commit
						d5d08d040b
					
				
							
								
								
									
										10
									
								
								package.json
									
									
									
									
									
								
							
							
						
						
									
										10
									
								
								package.json
									
									
									
									
									
								
							| @ -1,7 +1,7 @@ | ||||
| { | ||||
|   "name": "koishi-plugin-market-info", | ||||
|   "description": "Koishi plugin market information", | ||||
|   "version": "1.1.4", | ||||
|   "version": "1.1.5", | ||||
|   "main": "lib/index.js", | ||||
|   "typings": "lib/index.d.ts", | ||||
|   "files": [ | ||||
| @ -43,10 +43,10 @@ | ||||
|     "koishi": "^4.10.5" | ||||
|   }, | ||||
|   "devDependencies": { | ||||
|     "@koishijs/registry": "^4.4.5", | ||||
|     "@types/node": "^18.11.18", | ||||
|     "@koishijs/registry": "^4.6.0", | ||||
|     "@types/node": "^18.15.5", | ||||
|     "atsc": "^1.2.2", | ||||
|     "koishi": "^4.11.3", | ||||
|     "typescript": "^4.9.4" | ||||
|     "koishi": "^4.12.1", | ||||
|     "typescript": "^4.9.5" | ||||
|   } | ||||
| } | ||||
|  | ||||
| @ -59,7 +59,8 @@ export function apply(ctx: Context, config: Config) { | ||||
| 
 | ||||
|     ctx.command('market') | ||||
|       .action(async ({ session }) => { | ||||
|         return session.text('.overview', [Object.keys(previous).length]) | ||||
|         const objects = Object.values(previous).filter(data => !data.manifest.hidden) | ||||
|         return session.text('.overview', [objects.length]) | ||||
|       }) | ||||
| 
 | ||||
|     ctx.setInterval(async () => { | ||||
| @ -70,7 +71,7 @@ export function apply(ctx: Context, config: Config) { | ||||
|         if (version1 === version2) return | ||||
| 
 | ||||
|         if (!version1) { | ||||
|           let output = `新增:${name}` | ||||
|           let output = <p><i18n path="market-info.created"></i18n></p> | ||||
|           if (config.showPublisher) output += ` (@${current[name].publisher.username})` | ||||
|           if (config.showDescription) { | ||||
|             const { description } = current[name].manifest | ||||
| @ -4,3 +4,9 @@ commands: | ||||
| 
 | ||||
|     messages: | ||||
|       overview: 当前共有 {0} 个插件。 | ||||
| 
 | ||||
| market-info: | ||||
|   header: '[插件市场更新]' | ||||
|   created: 新增:{0} | ||||
|   updated: 更新:{0} ({1} → {2})` | ||||
|   deleted: 移除:{0} | ||||
|  | ||||
| @ -9,7 +9,9 @@ | ||||
|     "incremental": true, | ||||
|     "skipLibCheck": true, | ||||
|     "esModuleInterop": true, | ||||
|     "moduleResolution": "node" | ||||
|     "moduleResolution": "node", | ||||
|     "jsx": "react-jsx", | ||||
|     "jsxImportSource": "@satorijs/element", | ||||
|   }, | ||||
|   "include": [ | ||||
|     "src" | ||||
|  | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user