The token used for authentication with the Discord API.
The ID of the guild in which to create the channel.
The name of the channel to create.
The ID of the member for whom the channel is being created.
A promise that resolves to the newly created TextChannel, or null if a channel with the specified name already exists.
Will throw an error if there is a problem creating the channel.
const token = 'your_discord_token_here';
const guildId = 'your_guild_id_here';
const channelName = 'private-channel';
const memberId = 'your_member_id_here';
const channel = await createPrivateChannel(token, guildId, channelName, memberId)
if (channel) {
console.log(`Channel created with ID: ${channel.id}`);
} else {
console.log('Channel already exists.');
}
Generated using TypeDoc
Creates a private channel within a guild if a channel with the specified name does not already exist.