diff --git a/src/commands/profile/index.ts b/src/commands/profile/index.ts index 08e3048..dc24a42 100644 --- a/src/commands/profile/index.ts +++ b/src/commands/profile/index.ts @@ -3,7 +3,7 @@ import { SlashCommandBuilder } from "@discordjs/builders"; import { ChatInputCommandInteraction } from "discord.js"; // Modules -import modules from "../commands/profile/modules"; +import modules from "./modules"; // Handlers diff --git a/src/commands/profile/modules/view/index.ts b/src/commands/profile/modules/view/index.ts index cf4f9b2..e0abb27 100644 --- a/src/commands/profile/modules/view/index.ts +++ b/src/commands/profile/modules/view/index.ts @@ -1,11 +1,8 @@ // Dependencies import { SlashCommandSubcommandBuilder } from "@discordjs/builders"; -import { CommandInteraction, EmbedBuilder } from "discord.js"; +import { CommandInteraction } from "discord.js"; // Configurations -import getEmbedConfig from "../../../../helpers/getEmbedData"; // Models -import fetchUser from "../../../../helpers/userData"; -import logger from "../../../../middlewares/logger"; // Function export default { @@ -21,63 +18,57 @@ export default { }, execute: async (interaction: CommandInteraction) => { - const { errorColor, footerText, footerIcon } = await getEmbedConfig( - interaction.guild - ); // Destructure - const { client, options, user, guild } = interaction; - - // Target information - const target = options?.getUser("target"); - - // Discord User Information - const discordUser = await client?.users?.fetch( - `${target ? target?.id : user?.id}` - ); - - if (guild === null) { - return logger?.silly(`Guild is null`); - } - - // User Information - const userObj = await fetchUser(discordUser, guild); - - const embed = new EmbedBuilder() - .setAuthor({ - name: `${discordUser?.username}#${discordUser?.discriminator}`, - iconURL: discordUser?.displayAvatarURL(), - }) - .addFields( - { - name: `:dollar: Credits`, - value: `${userObj?.credits || "Not found"}`, - inline: true, - }, - { - name: `:squeeze_bottle: Level`, - value: `${userObj?.level || "Not found"}`, - inline: true, - }, - { - name: `:squeeze_bottle: Points`, - value: `${userObj?.points || "Not found"}`, - inline: true, - }, - { - name: `:loudspeaker: Reputation`, - value: `${userObj?.reputation || "Not found"}`, - inline: true, - }, - { - name: `:rainbow_flag: Language`, - value: `${userObj?.language || "Not found"}`, - inline: true, - } - ) - .setTimestamp() - .setColor(errorColor) - .setFooter({ text: footerText, iconURL: footerIcon }); - - // Return interaction reply - return interaction?.editReply({ embeds: [embed] }); + // const { errorColor, footerText, footerIcon } = await getEmbedConfig( + // interaction.guild + // ); // Destructure + // const { client, options, user, guild } = interaction; + // // Target information + // const target = options?.getUser("target"); + // // Discord User Information + // const discordUser = await client?.users?.fetch( + // `${target ? target?.id : user?.id}` + // ); + // if (guild === null) { + // return logger?.silly(`Guild is null`); + // } + // // User Information + // const userObj = await fetchUser(discordUser, guild); + // const embed = new EmbedBuilder() + // .setAuthor({ + // name: `${discordUser?.username}#${discordUser?.discriminator}`, + // iconURL: discordUser?.displayAvatarURL(), + // }) + // .addFields( + // { + // name: `:dollar: Credits`, + // value: `${userObj?.credits || "Not found"}`, + // inline: true, + // }, + // { + // name: `:squeeze_bottle: Level`, + // value: `${userObj?.level || "Not found"}`, + // inline: true, + // }, + // { + // name: `:squeeze_bottle: Points`, + // value: `${userObj?.points || "Not found"}`, + // inline: true, + // }, + // { + // name: `:loudspeaker: Reputation`, + // value: `${userObj?.reputation || "Not found"}`, + // inline: true, + // }, + // { + // name: `:rainbow_flag: Language`, + // value: `${userObj?.language || "Not found"}`, + // inline: true, + // } + // ) + // .setTimestamp() + // .setColor(errorColor) + // .setFooter({ text: footerText, iconURL: footerIcon }); + // // Return interaction reply + // return interaction?.editReply({ embeds: [embed] }); }, };