updated profile and centralized functions
This commit is contained in:
@@ -0,0 +1,61 @@
|
||||
const {
|
||||
SlashCommandBuilder
|
||||
} = require("discord.js");
|
||||
|
||||
const {
|
||||
buildRecordsEmbed,
|
||||
getRecordChoices
|
||||
} = require(
|
||||
"../../utils/profileRecords"
|
||||
);
|
||||
|
||||
module.exports = {
|
||||
data:
|
||||
new SlashCommandBuilder()
|
||||
.setName(
|
||||
"records"
|
||||
)
|
||||
.setDescription(
|
||||
"View Shai Cookie and Crumb Saucer records"
|
||||
)
|
||||
.addStringOption(
|
||||
option =>
|
||||
option
|
||||
.setName(
|
||||
"category"
|
||||
)
|
||||
.setDescription(
|
||||
"Record category"
|
||||
)
|
||||
.setRequired(
|
||||
true
|
||||
)
|
||||
.addChoices(
|
||||
...getRecordChoices()
|
||||
)
|
||||
),
|
||||
|
||||
async execute(
|
||||
interaction
|
||||
) {
|
||||
const category =
|
||||
interaction.options.getString(
|
||||
"category",
|
||||
true
|
||||
);
|
||||
|
||||
const embed =
|
||||
await buildRecordsEmbed({
|
||||
guildId:
|
||||
interaction.guildId,
|
||||
category,
|
||||
botUserId:
|
||||
interaction.client.user.id,
|
||||
limit: 10
|
||||
});
|
||||
|
||||
return interaction.reply({
|
||||
embeds: [embed]
|
||||
});
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user