“Discord.py Get Channel Objet de l'ID” Réponses codées

Obtenez le canal de ID Discord.py

channel = client.get_channel(channel_id)
DenverCoder1

Discord Py Get Id Channel par nom

@bot.command()
async def get_channel(ctx, *, given_name=None):
    for channel in ctx.guild.channels:
        if channel.name == given_name:
            wanted_channel_id = channel.id

    await ctx.send(wanted_channel_id) # this is just to check 
Mentix

Discord.py Get Channel ID par nom de canal

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

Discord.py Get Channel ID par nom de canal

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

Discord.py Get Channel Objet de l'ID

channel_id = 747076221484924998 # must be an int and a valid channel id
channel = bot.get_channel(channel_id)
await ctx.send(f"The given channel is {channel.mention} with the id {channel.id}")
BagleBagleBagleBagleBagle

Réponses similaires à “Discord.py Get Channel Objet de l'ID”

Questions similaires à “Discord.py Get Channel Objet de l'ID”

Parcourir les réponses de code populaires par langue

Parcourir d'autres langages de code