cmd.channel.id
Warning
cmd.channel.id is deprecated. Use message.channel.id directly instead.
Returns the ID of the channel where a message was sent.
JavaScript
const { cmd } = require("syntx.js");
cmd.channel.id(message);Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
message | discord.js Message | Yes | The message object from the event. |
Returns
string : The channel ID.
Example
JavaScript
client.command({
name: "channelid",
content: (message) => {
const id = cmd.channel.id(message);
message.reply(`This channel's ID is: ${id}`);
},
});Note
This function is deprecated and will emit a deprecation warning at runtime. Prefer accessing message.channel.id directly, which is the standard discord.js way to get the channel ID.