S
S
SANFY2021-03-06 16:49:53
Python
SANFY, 2021-03-06 16:49:53

How to convert the code for creating a voice channel to discord?

The code itself:

@client.command(name='create_channel')
@commands.has_role('@everyone')
async def create_channel(ctx, channel_name='Новый канал'):
    guild = ctx.guild
    existing_channel = discord.utils.get(guild.channels, name=channel_name)
    if not existing_channel:
        print(f'Creating a new channel: {channel_name}')
        await guild.create_text_channel(channel_name)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
O
old_stalin, 2021-03-14
@old_stalin

await guild.create_voice_channel(channel_name = ...)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question