简体   繁体   English

discord.py 机器人不回复命令

[英]discord.py bot not replying on command

i want to make command that look like you killed someone我想做一个看起来像你杀了人的命令

here my code:这是我的代码:

@client.command()
async def pew_pew(ctx, targetGuy):
  await ctx.reply(targetGuy, "has been pew pew")

bbut when i try the command it say但是当我尝试它说的命令时

Ignoring exception in command pew_pew: Traceback (most recent call last): File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/ext/commands/bot.py", line 994, in invoke await ctx.command.invoke(ctx) File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/ext/commands/core.py", line 886, in invoke await self.prepare(ctx) File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/ext/commands/core.py", line 820, in prepare await self._parse_arguments(ctx) File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/ext/commands/core.py", line 726, in _parse_arguments transformed = await self.transform(ctx, param) File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/ext/commands/core.py", line 560, in transform raise MissingRequiredArgument(param) discord.ext.commands.errors.MissingRequiredArgument: targetGuy is a required argument that is missing.忽略命令 pew_pew 中的异常:回溯(最后一次调用):文件“/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/ext/commands/bot.py”,第 994 行,调用等待ctx.command.invoke(ctx) 文件“/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/ext/commands/core.py”,第 886 行,在调用中等待 self.prepare(ctx)文件“/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/ext/commands/core.py”,第 820 行,准备等待 self._parse_arguments(ctx) 文件“/opt/virtualenvs/python3 /lib/python3.8/site-packages/discord/ext/commands/core.py”,第 726 行,在 _parse_arguments 中转换 = await self.transform(ctx, param) 文件“/opt/virtualenvs/python3/lib/python3 .8/site-packages/discord/ext/commands/core.py",第 560 行,在转换中提高 MissingRequiredArgument(param) discord.ext.commands.errors.MissingRequiredArgument:targetGuy 是缺少的必需参数。

Looks like you're not setting the target when using that command.使用该命令时,您似乎没有设置目标。 Try using the command and using a specific user id or name.尝试使用该命令并使用特定的用户 ID 或名称。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM