1
0
mirror of https://github.com/toast-ts/Daggerbot-TS.git synced 2024-11-17 20:30:58 -05:00

ANSI-ify the pallet command

This commit is contained in:
toast-ts 2024-04-02 09:36:03 +11:00
parent c6d7f8e04c
commit 17c7f45c61

View File

@ -1,3 +1,4 @@
import ansi from 'ansi-colors';
import Discord from 'discord.js'; import Discord from 'discord.js';
import TClient from '../client.js'; import TClient from '../client.js';
import Logger from '../helpers/Logger.js'; import Logger from '../helpers/Logger.js';
@ -105,8 +106,8 @@ export default class MP {
else { else {
const getLongestName = Object.entries(PalletLibrary(DSS)).map(([name, _])=>name.length).sort((a,b)=>b-a)[0]; const getLongestName = Object.entries(PalletLibrary(DSS)).map(([name, _])=>name.length).sort((a,b)=>b-a)[0];
await interaction.reply(MessageTool.concatMessage( await interaction.reply(MessageTool.concatMessage(
`There are currently **${filter.length}** pallets on the server. Here\'s the breakdown:\`\`\``, `There are currently **${filter.length}** pallets on the server. Here\'s the breakdown:\`\`\`ansi`,
Object.entries(PalletLibrary(DSS)).map(([name, count])=>`${name.padEnd(getLongestName+3)}${count}`).join('\n'), Object.entries(PalletLibrary(DSS)).map(([name, count])=>`${ansi.blue(name.padEnd(getLongestName+3))}${ansi.yellow(count.toString())}`).join('\n'),
'```' '```'
)) ))
} }