Answer the question
In order to leave comments, you need to log in
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
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question