im tired.

This commit is contained in:
2026-09-07 17:26:53 +08:00
parent 3aff82422e
commit 016585ddf9
26 changed files with 695 additions and 381 deletions
+40
View File
@@ -0,0 +1,40 @@
import { Command, CommandBuilder, CommandClient, CommandInteraction, Constants, SlashCommand } from "athena-prime";
import database from "../database";
// ----------
@SlashCommand(
new CommandBuilder('rank', 'See your rank information.')
.setIntegrationTypes(Constants.ApplicationIntegrationType.GuildInstall)
.setContexts(Constants.InteractionContextType.Guild)
.setCommandType(Constants.ApplicationCommandType.ChatInput)
)
class RankCommand extends Command<CommandClient> {
async handleCommand(context: CommandClient<any, any>, interaction: CommandInteraction) {
if (!interaction.inGuild()) return;
await interaction.defer();
const _points = await database.points.getOrCreatePoints(interaction.guild.id, interaction.member.id);
const _rank = await database.leaderboard.getLeaderboardPosition(interaction.guild.id, interaction.member.id);
await interaction.createMessage({
embeds: [{
author: {
name: interaction.member.username,
icon_url: interaction.member.avatarURL
},
color: 0xe77ed1,
title: `Rank | ${interaction.member.username}`,
fields: [
{ name: 'Points', value: `${_points}`, inline: true },
{ name: 'Rank', value: `${_rank ?? 'N/A'}`, inline: true }
],
}]
});
}
}
export default new RankCommand('rank');