0
votes

I am trying to make a discord bot in python and I keep running into a problem. What I am trying to do is use discord.ext.commands.Bot() to run a command to create a channel (which uses discord.Client() ). Whenever I start the bot using bot.run('token'), the client part does not work. But if I run the bot using client.run('token'), I am able to create the channel, but not use the command. Is there any way to have both running at the same time, or am I out of luck?

The code for the command is:

@bot.command(pass_context=True)
async def channel(ctx):
    client.create_channel(ctx.message.server, 'test', type=discord.ChannelType.text)
1
Can you share your entire code please?Mik3NL
Here is a link to the code: pastebin.com/FGBEiPSpqspitzer

1 Answers

1
votes

Can't you just use:

await bot.create_channel(ctx.message.server, 'test', type=discord.ChannelType.text)