This commit is contained in:
parent
cfc548200a
commit
c1ee1ec764
@ -1,4 +1,5 @@
|
|||||||
// comandos/add.js
|
// comandos/add.js
|
||||||
|
import { Table } from 'embed-table';
|
||||||
const { InteractionContextType, EmbedBuilder, PermissionFlagsBits, SlashCommandBuilder, MessageFlags } = require('discord.js');
|
const { InteractionContextType, EmbedBuilder, PermissionFlagsBits, SlashCommandBuilder, MessageFlags } = require('discord.js');
|
||||||
const conn = require('../../../database/db'); // Ajusta o caminho
|
const conn = require('../../../database/db'); // Ajusta o caminho
|
||||||
|
|
||||||
@ -49,11 +50,29 @@ module.exports = {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
const table = new Table({
|
||||||
|
titles: ['Level', 'Money', 'Wins'],
|
||||||
|
titleIndexes: [0, 8, 16],
|
||||||
|
columnIndexes: [0, 6, 14],
|
||||||
|
start: '`',
|
||||||
|
end: '`',
|
||||||
|
padEnd: 3
|
||||||
|
});
|
||||||
|
|
||||||
|
table.addRow(['1', '$120', '2'], { override: 4 });
|
||||||
|
table.addRow(['72', '$10', '25'], { override: 0 });
|
||||||
|
table.addRow(['614', '$1220', '12']);
|
||||||
|
|
||||||
|
// Use this 'embed' when sending a message to a channel.
|
||||||
|
const embed = new EmbedBuilder().setFields(table.toField());
|
||||||
|
|
||||||
|
// Use this 'tableString' in a plain text area, (embed description or a regular message)
|
||||||
|
const string = table.toString();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
await interaction.editReply(`\n${string}\n`);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user