cmd.user.info

Retrieves detailed information about a user, including their global Discord profile and their server-specific member data.

JavaScript
const { cmd } = require("syntx.js");

await cmd.user.info(user, message);

Parameters

ParameterTypeRequiredDescription
userstring | discord.js UserYesThe user ID or a discord.js user object to look up.
messagediscord.js MessageYesA guild message or interaction, used to access the guild.

Returns

An object with two top-level keys: global and guild.

global

Contains information from the user's Discord-wide profile:

FieldTypeDescription
idstringThe user's ID.
usernamestringThe user's username.
displayNamestringThe user's full tag (e.g. username#0).
globalNamestring | nullThe user's global display name, if set.
discriminatorstringThe user's discriminator (e.g. "0" for users on the new username system).
createdAtDateWhen the Discord account was created.
flagsstring[]Array of user flag strings (e.g. "HypeSquadOnlineHouse1").
avatarobjectAvatar info: { id, url }. url is at 512px.
decorationobject | nullRaw avatar decoration data from the Discord API, or null.
bannerobjectBanner info: { id, url }. url is at 1024px.
applicationobjectBot/app info: { app, verified }. app is true if the user is a bot.
statestringThe user's presence status: "online", "idle", "dnd", or "offline".
activitiesobject[] | nullArray of current activities, or null if unavailable. See activities.

Activities

Each item in the activities array contains:

FieldTypeDescription
typenumberActivity type integer (playing, streaming, listening, etc.).
namestringThe activity name.
detailsstring | nullAdditional details about the activity.
statestring | nullThe activity's current state text.
applicationIdstring | nullID of the application linked to this activity.
timestampsobject | nullStart and end timestamps.
emojiobject | nullEmoji used in the activity: { name, id, animated }.

guild

Contains server-specific member data. Is null if the user is not a member of the guild.

FieldTypeDescription
idstringThe guild ID.
nicknamestring | nullThe member's server nickname, or null if not set.
avatarobjectServer-specific avatar: { id, url }.
rolesobject[]Array of roles the member has: { id, name, color }.
joinedAtDate | nullWhen the member joined the server.
premiumSinceDate | nullWhen the member started boosting the server, or null.
permissionsstring[]Array of permission flag strings the member has in the guild.
pendingbooleanWhether the member has passed the membership screening.
communicationDisabledUntilDate | nullWhen a timeout expires, or null if not timed out.
isOwnerbooleanWhether the member is the server owner.
isAdminbooleanWhether the member has the Administrator permission.
boostDate | nullSame as premiumSince. null if the user is not boosting.
serverAvatarDifferentbooleanWhether the member's server avatar differs from their global avatar.
bannerobjectServer-specific banner: { id, url }.
muteobjectMute and deafen state. See mute below.
banobjectBan state: { banned, reason }.
descriptionstring | nullThe guild's description (not the member's).

Mute

FieldTypeDescription
voice.mutedbooleanWhether the member is muted in voice (by any means).
voice.selfbooleanWhether the member muted themselves.
voice.serverbooleanWhether a moderator server-muted the member.
deaf.deafenedbooleanWhether the member is deafened (by any means).
deaf.selfbooleanWhether the member deafened themselves.
deaf.serverbooleanWhether a moderator server-deafened the member.
text.mutedbooleanWhether the member is currently timed out.
text.untilDate | nullWhen the timeout expires.
text.remainingnumberMilliseconds remaining on the timeout. 0 if not timed out.

Example

JavaScript
client.command({
  name: "userinfo",
  content: async (message) => {
    const id = cmd.message.mentioned(message, 1) ?? message.author.id;
    const info = await cmd.user.info(id, message);

    const g = info.guild;
    const lines = [
      `**Username:** ${info.global.username}`,
      `**ID:** ${info.global.id}`,
      `**Created:** ${info.global.createdAt.toDateString()}`,
      `**Status:** ${info.global.state}`,
    ];

    if (g) {
      lines.push(`**Joined:** ${g.joinedAt?.toDateString() ?? "Unknown"}`);
      lines.push(`**Roles:** ${g.roles.map(r => r.name).join(", ")}`);
      if (g.mute.text.muted) lines.push(`**Timed out until:** ${g.communicationDisabledUntil}`);
    }

    message.reply(lines.join("\n"));
  },
});

Note

Presence data (state, activities) is only available when the bot has the GuildPresences privileged intent enabled in the Discord Developer Portal.