Compare commits

...

2 Commits

  1. 1
      src/bot.ts
  2. 4
      src/commands/list.ts

@ -33,6 +33,7 @@ export class UEMEloBot extends Client {
} }
parsePlayersFromFile(){ parsePlayersFromFile(){
// TODO get players from sql instead
if (fs.existsSync(this.fileName)){ if (fs.existsSync(this.fileName)){
let fileContent = fs.readFileSync(this.fileName).toString(); let fileContent = fs.readFileSync(this.fileName).toString();
try { try {

@ -24,6 +24,8 @@ class List extends Command {
return; return;
} }
await interaction.deferReply();
const maxNameLength = players.reduce((max: number, next: Player) => Math.max(max, next.toString().length), 0); const maxNameLength = players.reduce((max: number, next: Player) => Math.max(max, next.toString().length), 0);
const maxProgressDigits = players.reduce((max, next) => Math.max(max, Math.abs(next.getProgress()).toString().length), 0); const maxProgressDigits = players.reduce((max, next) => Math.max(max, Math.abs(next.getProgress()).toString().length), 0);
@ -58,7 +60,7 @@ class List extends Command {
]) ])
.setThumbnail(iconURL); .setThumbnail(iconURL);
await interaction.reply({embeds: [embed]}); await interaction.editReply({embeds: [embed]});
} }
} }

Loading…
Cancel
Save