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
| Parameter | Type | Required | Description |
|---|---|---|---|
channel | string | Channel | Yes | The channel ID or a discord.js channel object to inspect. |
message | discord.js Message | Yes | A 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:
| Field | Type | Description |
|---|---|---|
id | string | The channel's ID. |
name | string | null | The channel's name. |
type | string | The channel type as a readable string. See channel types. |
position | number | null | The raw position of the channel in the sidebar. |
parentID | string | null | The ID of the parent category, if any. |
parent | object | null | An object with id and name of the parent category, or null. |
flags | string[] | null | Array of channel flags. |
createdAt | Date | null | When the channel was created. |
deletable | boolean | null | Whether the bot can delete this channel. |
manageable | boolean | null | Whether the bot can manage this channel. |
viewable | boolean | null | Whether the bot can view this channel. |
url | string | null | The channel's URL (Discord jump link). |
permissions | object[] | null | Array of permission overwrites. Each entry has id, type, allow, and deny (as string arrays). |
Channel types
The type field returns one of these strings:
| Value | Discord 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
| Field | Type | Description |
|---|---|---|
description | string | null | The channel topic. |
nsfw | boolean | Whether the channel is age-restricted. |
rateLimit | number | Slowmode duration in seconds. |
lastMessageId | string | null | ID of the last message sent. |
lastPinAt | Date | null | When the last message was pinned. |
defaultAutoArchiveDuration | number | null | Default thread auto-archive duration in minutes. |
threads | object[] | Array of cached threads. Each has id, name, ownerId, createdAt, archived, and locked. |
Voice and stage channels
| Field | Type | Description |
|---|---|---|
description | string | null | The channel topic. |
nsfw | boolean | Whether the channel is age-restricted. |
rateLimit | number | Slowmode duration in seconds. |
bitrate | number | null | Audio bitrate in bits per second. |
userLimit | number | null | Maximum number of users allowed. |
rtcRegion | string | null | Voice region override. null means automatic. |
videoQualityMode | number | null | Video quality mode. |
joinable | boolean | null | Whether the bot can join this voice channel. |
full | boolean | null | Whether the voice channel has reached its user limit. |
Forum and media channels
| Field | Type | Description |
|---|---|---|
description | string | null | The channel topic. |
nsfw | boolean | Whether the channel is age-restricted. |
defaultAutoArchiveDuration | number | null | Default thread auto-archive duration in minutes. |
defaultThreadRateLimitPerUser | number | null | Default slowmode for new threads. |
defaultForumLayout | number | null | Default layout mode for the forum. |
defaultSortOrder | number | null | Default sort order for posts. |
defaultReactionEmoji | object | null | Default reaction emoji with id and name. |
availableTags | object[] | Available tags. Each has id, name, moderated, and emoji ({ id, name }). |
threads | object[] | Array of cached threads. Each has id, name, ownerId, createdAt, archived, locked, and appliedTags. |
Thread channels (private, public, announcement)
| Field | Type | Description |
|---|---|---|
rateLimit | number | Slowmode duration in seconds. |
ownerId | string | null | ID of the user who created the thread. |
archived | boolean | null | Whether the thread is archived. |
archivedAt | Date | null | When the thread was archived. |
autoArchiveDuration | number | null | Auto-archive duration in minutes. |
locked | boolean | null | Whether the thread is locked. |
invitable | boolean | null | Whether non-moderators can add members (private threads only). |
joined | boolean | null | Whether the bot has joined this thread. |
unarchivable | boolean | null | Whether the thread can be unarchived. |
memberCount | number | null | Approximate number of members. |
messageCount | number | null | Approximate number of messages (capped at 50). |
totalMessageSent | number | null | Total messages ever sent in the thread. |
permissionsLocked | boolean | null | Whether 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.