🚧 comment out profile during migration

This commit is contained in:
Axel Olausson Holtenäs 2022-10-20 11:01:12 +02:00
parent 4c92867bcf
commit 63da5b165c
2 changed files with 54 additions and 63 deletions

View file

@ -3,7 +3,7 @@ import { SlashCommandBuilder } from "@discordjs/builders";
import { ChatInputCommandInteraction } from "discord.js"; import { ChatInputCommandInteraction } from "discord.js";
// Modules // Modules
import modules from "../commands/profile/modules"; import modules from "./modules";
// Handlers // Handlers

View file

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