Profiles: Add user profile model and command
This commit is contained in:
18
commands/profile.js
Normal file
18
commands/profile.js
Normal file
@@ -0,0 +1,18 @@
|
||||
const { SlashCommandBuilder, EmbedBuilder, ActionRowBuilder, ButtonBuilder, ButtonStyle } = require("discord.js");
|
||||
const { Card, User, Character } = require("../models");
|
||||
const UserUtils = require("../util/users");
|
||||
|
||||
const pageSize = 8;
|
||||
|
||||
//fetch all cards owned by the user and list them
|
||||
module.exports = {
|
||||
data: new SlashCommandBuilder()
|
||||
.setName("profile")
|
||||
.setDescription("View your profile"),
|
||||
async execute(interaction) {
|
||||
let user = await UserUtils.getUserByDiscordId(interaction.member.id);
|
||||
|
||||
let profile = await user.getProfile();
|
||||
await interaction.reply(`json: ${JSON.stringify(profile)}`);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user