Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const { SlashCommandBuilder, EmbedBuilder } = require("discord.js");
- const User = require("../../schemas/users");
- module.exports = {
- data: new SlashCommandBuilder()
- .setName("whois")
- .setDescription("whois command")
- .addUserOption((option) =>
- option.setName("user").setDescription("User to get info on")
- ),
- async execute(interaction) {
- const { options } = interaction;
- let user = options.getUser("user");
- if (!user) user = interaction.user;
- // Get the users roles
- let guser = interaction.guild.members.cache.get(user.id);
- let roles = guser.roles.cache.map((role) => `<@&${role.id}>`).join(", ");
- let profile = await User.findOne({ id: user.id });
- let joinedTimestamp = guser.joinedTimestamp / 1000;
- let Nick = guser.nickname ? guser.nickname : "None";
- const embed = new EmbedBuilder()
- .setColor("#0099ff")
- .setTitle(`Info About ${user.username}`)
- .setDescription(`Yep.. this is the description`)
- .setThumbnail(guser.displayAvatarURL({ dynamic: true }))
- .addFields(
- {
- name: "Discord Name",
- value: user.username,
- inline: true,
- },
- {
- name: "Discord ID",
- value: user.id,
- inline: true,
- },
- {
- name: "TGC Profile Made",
- value: `<t:${profile.timeCreated}>`,
- inline: true,
- },
- {
- name: "Account Creation Date",
- value: `<t:${Math.floor(user.createdTimestamp / 1000)}>`,
- inline: false,
- },
- {
- name: "Bot",
- value: user.bot ? "Yes" : "No",
- inline: true,
- },
- {
- name: "Server Join Date",
- value: `<t:${Math.floor(joinedTimestamp)}>`,
- inline: true,
- },
- {
- name: "Nickname",
- value: Nick,
- inline: true,
- },
- {
- name: "Roles",
- value: roles,
- inline: false,
- }
- );
- interaction.reply({
- content: "T",
- embeds: [embed]
- })
- },
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement