🚧 comment out profile during migration
This commit is contained in:
parent
4c92867bcf
commit
63da5b165c
2 changed files with 54 additions and 63 deletions
|
@ -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
|
||||
|
||||
|
|
|
@ -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] });
|
||||
},
|
||||
};
|
||||
|
|
Loading…
Add table
Reference in a new issue