artibot
Version:
Modern, fast and modular open-source Discord bot
34 lines • 1.65 kB
JavaScript
/** Get some information on a user */
export default async function execute(interaction, { config, contributors, localizer, createEmbed }) {
const infos = await interaction.targetMember.fetch(true);
let type = localizer._("User");
const since = infos.joinedTimestamp / 1000;
let more = "";
if (infos.user.bot) {
type = localizer._("Bot");
}
else if (infos.user.system) {
type = localizer._("System");
}
if (infos.guild.ownerId === infos.user.id) {
more += localizer._("\nIs the owner of this server.");
}
if (config.ownerId === infos.user.id) {
more += localizer._("\nIs the owner of this bot.");
}
if (contributors.devs.find(element => element.discordId === infos.user.id)) {
more += localizer._("\n**Is one of the super devs of this bot!**");
}
if (contributors.donators.find(element => element.discordId === infos.user.id)) {
more += localizer._("\n**Is one of the super donators of this bot!**");
}
const embed = createEmbed()
.setTitle(localizer._("Information on the user"))
.setDescription(localizer._("Name on the server: ") + (infos.nickname ? infos.nickname : infos.user.username) + "\n" +
localizer._("Tag:") + " `" + infos.user.username + "#" + infos.user.discriminator + "`\n" +
localizer._("ID:") + " `" + infos.user.id + "`" +
more)
.addFields({ name: localizer._("Type"), value: type }, { name: localizer._("On this server since"), value: `<t:${since}:f> (<t:${since}:R>)` });
await interaction.reply({ embeds: [embed] });
}
//# sourceMappingURL=informations.js.map