discord py get channel id by name

Solutions on MaxInterview for discord py get channel id by name by the best coders in the world

showing results for - "discord py get channel id by name"
Emer
01 Aug 2016
1@bot.command()
2async def get_channel(ctx, *, given_name=None):
3    for channel in ctx.guild.channels:
4        if channel.name == given_name:
5            wanted_channel_id = channel.id
6
7    await ctx.send(wanted_channel_id) # this is just to check 
8
Angel
22 Sep 2016
1channel = discord.utils.get(server.channels, name="Channel_name_here", type="ChannelType.voice")