【发布时间】:2018-08-19 12:01:54
【问题描述】:
我正在使用 Discord-py API 制作一个不和谐机器人,但我遇到了一个问题,我无法让 move 成员工作。
@bot.command(pass_context=True)
async def w(member = discord.Member):
await bot.say("Password Correct!")
await move_member(member, 5)
我收到了这个错误
Ignoring exception in command w
Traceback (most recent call last):
File "C:\Program Files (x86)\Python36-32\lib\site-packages\discord\ext\commands\core.py", line 50, in wrapped
ret = yield from coro(*args, **kwargs)
File "C:\Users\Richard\Desktop\Test Bot\testbot2.py", line 29, in w
await move_member(member, 5)
NameError: name 'move_member' is not defined
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "C:\Program Files (x86)\Python36-32\lib\site-packages\discord\ext\commands\bot.py", line 846, in process_commands
yield from command.invoke(ctx)
File "C:\Program Files (x86)\Python36-32\lib\site-packages\discord\ext\commands\core.py", line 374, in invoke
yield from injected(*ctx.args, **ctx.kwargs)
File "C:\Program Files (x86)\Python36-32\lib\site-packages\discord\ext\commands\core.py", line 54, in wrapped
raise CommandInvokeError(e) from e
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: NameError: name 'move_member' is not defined
谁有我可以使用的例子?或任何建议。
【问题讨论】:
标签: python discord discord.py