feat: initial Papo bot scaffold
This commit is contained in:
19
src/commands/utility/rank.ts
Normal file
19
src/commands/utility/rank.ts
Normal file
@@ -0,0 +1,19 @@
|
||||
import { SlashCommandBuilder, ChatInputCommandInteraction } from 'discord.js';
|
||||
import { SlashCommand } from '../../utils/types.js';
|
||||
import { context } from '../../config/context.js';
|
||||
|
||||
const command: SlashCommand = {
|
||||
guildOnly: true,
|
||||
data: new SlashCommandBuilder()
|
||||
.setName('rank')
|
||||
.setDescription('Zeigt deinen XP-Status an.')
|
||||
.addUserOption((opt) => opt.setName('user').setDescription('Nutzer (optional)')),
|
||||
async execute(interaction: ChatInputCommandInteraction) {
|
||||
if (!interaction.guildId) return;
|
||||
const user = interaction.options.getUser('user') ?? interaction.user;
|
||||
const level = context.leveling.getLevel(user.id, interaction.guildId);
|
||||
await interaction.reply({ content: `${user.tag}: Level ${level.level}, XP ${level.xp}` });
|
||||
}
|
||||
};
|
||||
|
||||
export default command;
|
||||
Reference in New Issue
Block a user