So, I'm writing a hack command for a Discord Bot (obviously a joke) and I'm getting a weird error. It's saying I've given something that only takes 1 positional argument was given 2 arguments, even though it clearly was not.
@client.command()
async def hack(message, member:discord.Member):
message = await message.reply("**It's info yoinking time!**\nHacking "+member.name+"\n\n**This command is currently only proof-of-concept and does not work past finding password. Slend is working on a fix.**")
await asyncio.sleep(3)
await message.edit(content="**1/5** | Finding e-mail address...")
await asyncio.sleep(3)
await message.edit(content="**1/5** | E-mail address found: `"+member.name+"@discord.com`")
await asyncio.sleep(2)
await message.edit(content="**2/5** | Finding password to Discord Account...")
await asyncio.sleep(3)
await message.edit(content="**2/5** | Discord Account password found: `me("+member.name+")iscool"+member.discriminator+"`")
await asyncio.sleep(2)
await message.edit("**3/5** | Logging in to Discord Account...")
And this is my error:
Ignoring exception in command hack:
Traceback (most recent call last):
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/ext/commands/core.py", line 85, in wrapped
ret = await coro(*args, **kwargs)
File "main.py", line 107, in hack
await message.edit("**3/5** | Logging in to Discord Account...")
TypeError: edit() takes 1 positional argument but 2 were given
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/ext/commands/bot.py", line 939, in invoke
await ctx.command.invoke(ctx)
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/ext/commands/core.py", line 863, in invoke
await injected(*ctx.args, **ctx.kwargs)
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/ext/commands/core.py", line 94, in wrapped
raise CommandInvokeError(exc) from exc
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: TypeError: edit() takes 1 positional argument but 2 were given
I'm not sure why it's saying that, as you can see I've indeed only given it one argument.
If this helps, it throws this error when tying to edit from **2/5** | Discord Account password found: `me("+member.name+")iscool"+member.discriminator+"
to **3/5** | Logging in to Discord Account...
Thanks for any help! :D