get channel by name discord.js code example

Example 1: Find channel discord js

// Insert the Channel ID in the brackets. TO find that, right click the
// channel and select "Copy ID". Discord Developer must be on.
let channel = message.guild.channels.cache.get(channelid)

Example 2: discord.py get channel id by channel name

channel = discord.utils.get(server.channels, name="Channel_name_here", type="ChannelType.voice")

Example 3: message.channel.name.includes

if (!message.channel.name.includes("bot-commands")) return message.channel.send('do commands only at <#bot-commands-id>');
    if(message.content.startswith(`${prefix}help`)){
message.channel.send('help command')
}

Example 4: discord.py get channel id by channel name

channel_names = ['channel1', 'channel2', 'channel3']
for ch in channel_names:
    channel = discord.get.utils(server.channels, name=ch, type="ChannelType.voice")
    full(channel)