updated mcs generated image footer
This commit is contained in:
		
							parent
							
								
									51f2a5cb27
								
							
						
					
					
						commit
						b8e11d5c5c
					
				| @ -8,7 +8,7 @@ | ||||
|     "prisma": "^6.6.0" | ||||
|   }, | ||||
|   "scripts": { | ||||
|     "dev": "bun --env-file=.env --watch src/index.ts" | ||||
|     "dev": "bun --env-file=.env --hot src/index.ts" | ||||
|   }, | ||||
|   "peerDependencies": { | ||||
|     "typescript": "^5" | ||||
|  | ||||
| @ -70,13 +70,15 @@ export default class McsCommand extends Command { | ||||
| 
 | ||||
|     const page = await browser.newPage(); | ||||
|     const status: Status = data.status as any | ||||
|     let result = `<p>${ip} - Latency ${data.latency}</p>` | ||||
|     let result = `<p>${ip} - Latency ${data.latency} ms</p>` | ||||
|     result += `<p>Version: ${status.version.name} - ${status.version.protocol}</p>` | ||||
|     result += `<p>${motdParser(status.description)}</p>` | ||||
|     result += `<p>Online - ${status.players.online}/${status.players.max}</p>` | ||||
|     const html = generateHtml(result, status.favicon) | ||||
| 
 | ||||
|     await page.setViewport({ width: 650, height: 340}) | ||||
|     let hight = 340 | ||||
|     if (!status.favicon) hight = 300 | ||||
|     await page.setViewport({ width: 650, height: hight }) | ||||
|     await page.setContent(html) | ||||
|     await page.waitForSelector('body') | ||||
|     const screenshot = await page.screenshot({ | ||||
| @ -133,14 +135,14 @@ function generateHtml(result: string, icon64: string): string { | ||||
| </head> | ||||
| <body style="width: 650px"> | ||||
|   <div class="container mx-auto py-8"> | ||||
|     <div class="text-center"><img src=${icon64} alt="icon" class="w-80px h-80px mx-auto" /></div> | ||||
|     ${icon64 ? `<div class="text-center"><img src=${icon64} alt="icon" class="w-80px h-80px mx-auto" /></div>` : ''} | ||||
|     <div class="text-center mt-4"> | ||||
|       <div class="text-lg font-bold text-[#cdd6f4]">${result}</div> | ||||
|     </div> | ||||
|   </div> | ||||
|   <footer class="bg-[#313244] text-center py-2"> | ||||
|     <p class="text-sm text-[#cdd6f4]">Generated by Fantastic Spoon - Discord</p> | ||||
|     <p class="text-sm text-[#cdd6f4]">https://git.itzdrli.cc/itzdrli/fantastic_spoon_dc</p>
 | ||||
|     <p class="text-sm text-[#cdd6f4]">Open Sourced on git.itzdrli.cc © 2025 itzdrli - All Rights Reserved. </p> | ||||
|   </footer> | ||||
| </body> | ||||
| </html>`;
 | ||||
|  | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user