This commit is contained in:
Stefanie Merceron 2023-11-18 20:04:39 -05:00
commit 330b4bd8a6
2 changed files with 17 additions and 9 deletions

View File

@ -16,7 +16,6 @@
- `/balance`/`?balance` - Checks how many ARAs you have
- `/topbalances`/`?topbalances` - Displays the richest server members
## XP
- `/rank <optional: user>`/`?rank <optional: user>` - Shows your rank based on the amount of XP you have. If you provide

View File

@ -34,9 +34,7 @@ export class TopBalancesCommand extends Command {
// Registers that this is a slash command
public override registerApplicationCommands(registry: Command.Registry) {
registry.registerChatInputCommand(
(builder) => builder
.setName(this.name)
.setDescription(this.description),
(builder) => builder.setName(this.name).setDescription(this.description),
{
behaviorWhenNotIdentical: RegisterBehavior.Overwrite,
},
@ -95,13 +93,19 @@ export class TopBalancesCommand extends Command {
const embed = new EmbedBuilder()
.setColor('#cc802c')
.setTitle('Top Balances on the Server')
.setAuthor({ name: 'ARA', iconURL: 'https://github.com/veganhacktivists/arabot/blob/main/docs/images/logo.png?raw=true' });
.setAuthor({
name: 'ARA',
iconURL:
'https://github.com/veganhacktivists/arabot/blob/main/docs/images/logo.png?raw=true',
});
const leaders = await getTopBalances(5);
const fetchMemberPromises: Promise<GuildMember | null>[] = [];
for (const leader of leaders) {
fetchMemberPromises.push(guild.members.fetch(leader.userId).catch(() => null));
fetchMemberPromises.push(
guild.members.fetch(leader.userId).catch(() => null),
);
}
const members = await Promise.all(fetchMemberPromises);
@ -114,13 +118,18 @@ export class TopBalancesCommand extends Command {
if (member) {
embed.addFields(
{
name: (i + 1) + '.',
value: '[' + member.displayName + '](<https://discord.com/users/' + leader.userId + '>)',
name: i + 1 + '.',
value:
'[' +
member.displayName +
'](<https://discord.com/users/' +
leader.userId +
'>)',
inline: true,
},
{
name: 'Balance',
value: leader.balance + ' ARA\'s',
value: leader.balance + " ARA's",
inline: true,
},
{