Home > Software engineering >  discord.py bot not replying on command
discord.py bot not replying on command

Time:12-05

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.

CodePudding user response:

Looks like you're not setting the target when using that command. Try using the command and using a specific user id or name.

  • Related