cmd.channel.info

Retrieves detailed information about a channel. The returned object always includes a common set of fields, with additional fields added depending on the channel type.

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

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

Parameters

ParameterTypeRequiredDescription
channelstring | ChannelYesThe channel ID or a discord.js channel object to inspect.
messagediscord.js MessageYesA guild message or interaction, used to access the guild.

Returns

An object containing channel information. The exact shape depends on the channel type.

Common fields

These fields are present for every channel type:

FieldTypeDescription
idstringThe channel's ID.
namestring | nullThe channel's name.
typestringThe channel type as a readable string. See channel types.
positionnumber | nullThe raw position of the channel in the sidebar.
parentIDstring | nullThe ID of the parent category, if any.
parentobject | nullAn object with id and name of the parent category, or null.
flagsstring[] | nullArray of channel flags.
createdAtDate | nullWhen the channel was created.
deletableboolean | nullWhether the bot can delete this channel.
manageableboolean | nullWhether the bot can manage this channel.
viewableboolean | nullWhether the bot can view this channel.
urlstring | nullThe channel's URL (Discord jump link).
permissionsobject[] | nullArray of permission overwrites. Each entry has id, type, allow, and deny (as string arrays).

Channel types

The type field returns one of these strings:

ValueDiscord channel type
"text"Guild text channel
"voice"Guild voice channel
"forum"Guild forum channel
"announcement"Guild announcement channel
"category"Guild category
"stage"Guild stage voice channel
"private_thread"Private thread
"public_thread"Public thread
"announcement_thread"Announcement thread
"directory"Guild directory
"media"Guild media channel
"unknown"Unrecognized channel type

Additional fields by type

Depending on the type value, the returned object includes extra fields.

Text and announcement channels

FieldTypeDescription
descriptionstring | nullThe channel topic.
nsfwbooleanWhether the channel is age-restricted.
rateLimitnumberSlowmode duration in seconds.
lastMessageIdstring | nullID of the last message sent.
lastPinAtDate | nullWhen the last message was pinned.
defaultAutoArchiveDurationnumber | nullDefault thread auto-archive duration in minutes.
threadsobject[]Array of cached threads. Each has id, name, ownerId, createdAt, archived, and locked.

Voice and stage channels

FieldTypeDescription
descriptionstring | nullThe channel topic.
nsfwbooleanWhether the channel is age-restricted.
rateLimitnumberSlowmode duration in seconds.
bitratenumber | nullAudio bitrate in bits per second.
userLimitnumber | nullMaximum number of users allowed.
rtcRegionstring | nullVoice region override. null means automatic.
videoQualityModenumber | nullVideo quality mode.
joinableboolean | nullWhether the bot can join this voice channel.
fullboolean | nullWhether the voice channel has reached its user limit.

Forum and media channels

FieldTypeDescription
descriptionstring | nullThe channel topic.
nsfwbooleanWhether the channel is age-restricted.
defaultAutoArchiveDurationnumber | nullDefault thread auto-archive duration in minutes.
defaultThreadRateLimitPerUsernumber | nullDefault slowmode for new threads.
defaultForumLayoutnumber | nullDefault layout mode for the forum.
defaultSortOrdernumber | nullDefault sort order for posts.
defaultReactionEmojiobject | nullDefault reaction emoji with id and name.
availableTagsobject[]Available tags. Each has id, name, moderated, and emoji ({ id, name }).
threadsobject[]Array of cached threads. Each has id, name, ownerId, createdAt, archived, locked, and appliedTags.

Thread channels (private, public, announcement)

FieldTypeDescription
rateLimitnumberSlowmode duration in seconds.
ownerIdstring | nullID of the user who created the thread.
archivedboolean | nullWhether the thread is archived.
archivedAtDate | nullWhen the thread was archived.
autoArchiveDurationnumber | nullAuto-archive duration in minutes.
lockedboolean | nullWhether the thread is locked.
invitableboolean | nullWhether non-moderators can add members (private threads only).
joinedboolean | nullWhether the bot has joined this thread.
unarchivableboolean | nullWhether the thread can be unarchived.
memberCountnumber | nullApproximate number of members.
messageCountnumber | nullApproximate number of messages (capped at 50).
totalMessageSentnumber | nullTotal messages ever sent in the thread.
permissionsLockedboolean | nullWhether thread permissions are synced to the parent.

Example

JavaScript
client.command({
  name: "channelinfo",
  content: async (message) => {
    const channelId = cmd.channel.mentioned(message, 1) ?? message.channel.id;

    const info = await cmd.channel.info(channelId, message);

    const lines = [
      `**Name:** ${info.name}`,
      `**Type:** ${info.type}`,
      `**ID:** ${info.id}`,
      `**Created:** ${info.createdAt?.toDateString() ?? "Unknown"}`,
    ];

    if (info.description) lines.push(`**Topic:** ${info.description}`);
    if (info.parent) lines.push(`**Category:** ${info.parent.name}`);

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

Note

The channel must belong to the current guild. Passing a channel from another guild throws a SyntxError.