discord python api Bot() 和 Client()

discord python api Bot() and Client()

我正在尝试在 python 中制作一个不和谐的机器人,但我一直 运行 遇到问题。我想要做的是使用 discord.ext.commands.Bot() 到 运行 一个命令来创建一个频道(使用 discord.Client() )。每当我使用 bot.run('token') 启动机器人时,客户端部分都不起作用。但是如果我 运行 使用 client.run('token') 的机器人,我可以创建频道,但不能使用命令。有没有办法同时拥有两个 运行ning,还是我运气不好?

命令的代码是:

@bot.command(pass_context=True)
async def channel(ctx):
    client.create_channel(ctx.message.server, 'test', type=discord.ChannelType.text)

你不能只使用:

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