mirror of
https://github.com/veganhacktivists/arabot.git
synced 2025-10-14 11:57:40 +02:00
Merge branch 'main' of https://github.com/MercStef/arabot
This commit is contained in:
commit
330b4bd8a6
@ -16,7 +16,6 @@
|
|||||||
- `/balance`/`?balance` - Checks how many ARAs you have
|
- `/balance`/`?balance` - Checks how many ARAs you have
|
||||||
- `/topbalances`/`?topbalances` - Displays the richest server members
|
- `/topbalances`/`?topbalances` - Displays the richest server members
|
||||||
|
|
||||||
|
|
||||||
## XP
|
## XP
|
||||||
|
|
||||||
- `/rank <optional: user>`/`?rank <optional: user>` - Shows your rank based on the amount of XP you have. If you provide
|
- `/rank <optional: user>`/`?rank <optional: user>` - Shows your rank based on the amount of XP you have. If you provide
|
||||||
|
@ -34,9 +34,7 @@ export class TopBalancesCommand extends Command {
|
|||||||
// Registers that this is a slash command
|
// Registers that this is a slash command
|
||||||
public override registerApplicationCommands(registry: Command.Registry) {
|
public override registerApplicationCommands(registry: Command.Registry) {
|
||||||
registry.registerChatInputCommand(
|
registry.registerChatInputCommand(
|
||||||
(builder) => builder
|
(builder) => builder.setName(this.name).setDescription(this.description),
|
||||||
.setName(this.name)
|
|
||||||
.setDescription(this.description),
|
|
||||||
{
|
{
|
||||||
behaviorWhenNotIdentical: RegisterBehavior.Overwrite,
|
behaviorWhenNotIdentical: RegisterBehavior.Overwrite,
|
||||||
},
|
},
|
||||||
@ -95,13 +93,19 @@ export class TopBalancesCommand extends Command {
|
|||||||
const embed = new EmbedBuilder()
|
const embed = new EmbedBuilder()
|
||||||
.setColor('#cc802c')
|
.setColor('#cc802c')
|
||||||
.setTitle('Top Balances on the Server')
|
.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 leaders = await getTopBalances(5);
|
||||||
const fetchMemberPromises: Promise<GuildMember | null>[] = [];
|
const fetchMemberPromises: Promise<GuildMember | null>[] = [];
|
||||||
|
|
||||||
for (const leader of leaders) {
|
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);
|
const members = await Promise.all(fetchMemberPromises);
|
||||||
@ -114,13 +118,18 @@ export class TopBalancesCommand extends Command {
|
|||||||
if (member) {
|
if (member) {
|
||||||
embed.addFields(
|
embed.addFields(
|
||||||
{
|
{
|
||||||
name: (i + 1) + '.',
|
name: i + 1 + '.',
|
||||||
value: '[' + member.displayName + '](<https://discord.com/users/' + leader.userId + '>)',
|
value:
|
||||||
|
'[' +
|
||||||
|
member.displayName +
|
||||||
|
'](<https://discord.com/users/' +
|
||||||
|
leader.userId +
|
||||||
|
'>)',
|
||||||
inline: true,
|
inline: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'Balance',
|
name: 'Balance',
|
||||||
value: leader.balance + ' ARA\'s',
|
value: leader.balance + " ARA's",
|
||||||
inline: true,
|
inline: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user