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
| Parameter | Type | Required | Description |
|---|---|---|---|
user | string | discord.js User | Yes | The user ID or a discord.js user object to look up. |
message | discord.js Message | Yes | A 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:
| Field | Type | Description |
|---|---|---|
id | string | The user's ID. |
username | string | The user's username. |
displayName | string | The user's full tag (e.g. username#0). |
globalName | string | null | The user's global display name, if set. |
discriminator | string | The user's discriminator (e.g. "0" for users on the new username system). |
createdAt | Date | When the Discord account was created. |
flags | string[] | Array of user flag strings (e.g. "HypeSquadOnlineHouse1"). |
avatar | object | Avatar info: { id, url }. url is at 512px. |
decoration | object | null | Raw avatar decoration data from the Discord API, or null. |
banner | object | Banner info: { id, url }. url is at 1024px. |
application | object | Bot/app info: { app, verified }. app is true if the user is a bot. |
state | string | The user's presence status: "online", "idle", "dnd", or "offline". |
activities | object[] | null | Array of current activities, or null if unavailable. See activities. |
Activities
Each item in the activities array contains:
| Field | Type | Description |
|---|---|---|
type | number | Activity type integer (playing, streaming, listening, etc.). |
name | string | The activity name. |
details | string | null | Additional details about the activity. |
state | string | null | The activity's current state text. |
applicationId | string | null | ID of the application linked to this activity. |
timestamps | object | null | Start and end timestamps. |
emoji | object | null | Emoji 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.
| Field | Type | Description |
|---|---|---|
id | string | The guild ID. |
nickname | string | null | The member's server nickname, or null if not set. |
avatar | object | Server-specific avatar: { id, url }. |
roles | object[] | Array of roles the member has: { id, name, color }. |
joinedAt | Date | null | When the member joined the server. |
premiumSince | Date | null | When the member started boosting the server, or null. |
permissions | string[] | Array of permission flag strings the member has in the guild. |
pending | boolean | Whether the member has passed the membership screening. |
communicationDisabledUntil | Date | null | When a timeout expires, or null if not timed out. |
isOwner | boolean | Whether the member is the server owner. |
isAdmin | boolean | Whether the member has the Administrator permission. |
boost | Date | null | Same as premiumSince. null if the user is not boosting. |
serverAvatarDifferent | boolean | Whether the member's server avatar differs from their global avatar. |
banner | object | Server-specific banner: { id, url }. |
mute | object | Mute and deafen state. See mute below. |
ban | object | Ban state: { banned, reason }. |
description | string | null | The guild's description (not the member's). |
Mute
| Field | Type | Description |
|---|---|---|
voice.muted | boolean | Whether the member is muted in voice (by any means). |
voice.self | boolean | Whether the member muted themselves. |
voice.server | boolean | Whether a moderator server-muted the member. |
deaf.deafened | boolean | Whether the member is deafened (by any means). |
deaf.self | boolean | Whether the member deafened themselves. |
deaf.server | boolean | Whether a moderator server-deafened the member. |
text.muted | boolean | Whether the member is currently timed out. |
text.until | Date | null | When the timeout expires. |
text.remaining | number | Milliseconds 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.