snapshot
This commit is contained in:
@@ -1,34 +1,63 @@
|
||||
const { SlashCommandBuilder } = require("discord.js");
|
||||
const {
|
||||
SlashCommandBuilder
|
||||
} = require(
|
||||
"discord.js"
|
||||
);
|
||||
|
||||
const {
|
||||
buildProfileOverview,
|
||||
buildProfileButtons,
|
||||
ensureGuildBadges
|
||||
} = require("../../utils/profileSystem");
|
||||
buildProfileButtons
|
||||
} = require(
|
||||
"../../utils/profileSystem"
|
||||
);
|
||||
|
||||
|
||||
module.exports = {
|
||||
data: new SlashCommandBuilder()
|
||||
.setName("profile")
|
||||
.setDescription("View a player profile")
|
||||
.addUserOption(option =>
|
||||
option
|
||||
.setName("user")
|
||||
.setDescription("Player to view")
|
||||
),
|
||||
data:
|
||||
new SlashCommandBuilder()
|
||||
.setName(
|
||||
"profile"
|
||||
)
|
||||
.setDescription(
|
||||
"View a player profile"
|
||||
)
|
||||
.addUserOption(
|
||||
option =>
|
||||
option
|
||||
.setName(
|
||||
"user"
|
||||
)
|
||||
.setDescription(
|
||||
"Player to view"
|
||||
)
|
||||
),
|
||||
|
||||
async execute(interaction) {
|
||||
const user = interaction.options.getUser("user") ?? interaction.user;
|
||||
|
||||
await ensureGuildBadges(interaction.guildId);
|
||||
async execute(
|
||||
interaction
|
||||
) {
|
||||
const user =
|
||||
interaction.options.getUser(
|
||||
"user"
|
||||
)
|
||||
??
|
||||
interaction.user;
|
||||
|
||||
|
||||
const embed =
|
||||
await buildProfileOverview(
|
||||
interaction.guildId,
|
||||
user
|
||||
);
|
||||
|
||||
const embed = await buildProfileOverview(
|
||||
interaction.guildId,
|
||||
user
|
||||
);
|
||||
|
||||
return interaction.reply({
|
||||
embeds: [embed],
|
||||
components: buildProfileButtons()
|
||||
embeds: [
|
||||
embed
|
||||
],
|
||||
|
||||
components:
|
||||
buildProfileButtons()
|
||||
});
|
||||
}
|
||||
};
|
||||
};
|
||||
Reference in New Issue
Block a user