【发布时间】:2018-04-21 19:22:08
【问题描述】:
我正在尝试在 python 中制作一个不和谐的机器人,但我一直遇到问题。我想做的是使用 discord.ext.commands.Bot() 运行命令来创建通道(使用 discord.Client() )。每当我使用 bot.run('token') 启动机器人时,客户端部分都不起作用。但是如果我使用 client.run('token') 运行机器人,我可以创建通道,但不能使用命令。有没有办法让两者同时运行,还是我不走运?
命令代码为:
@bot.command(pass_context=True)
async def channel(ctx):
client.create_channel(ctx.message.server, 'test', type=discord.ChannelType.text)
【问题讨论】:
-
你能分享你的整个代码吗?
-
这里是代码链接:pastebin.com/FGBEiPSp
标签: python discord.py