1
0
mirror of https://github.com/toast-ts/Daggerbot-TS.git synced 2024-12-26 15:45:38 -05:00

ANSI-ify the pallet command

This commit is contained in:
toast-ts 2024-04-02 09:36:03 +11:00
parent c2f7b2c44a
commit d4760778e8

View File

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