Every one of my commands in my bot keeps raising this error. Here's the ping command code and the error...
@client.command()
async def ping(ctx):
start = time.perf_counter()
msg = await ctx.send("Timing...")
end = time.perf_counter()
duration = (end - start) * 1000
embed = Embed(
title=f"{client.user.name}'s Ping",
description=f"Ping, pong, ping, pong...",
color=0xeee657)
embed.add_field(
name="Web-socket Ping",
value=f"{round((client.latency*1000),2)}ms")
embed.add_field(
name="Message Ping",
value=f"{round(duration, 2)}ms")
await msg.edit(content=None, embed=embed)
Ignoring exception in command ping
Traceback (most recent call last):
File "/home/sha-pc/.local/lib/python3.6/site-packages/discord/ext/commands/bot.py", line 848, in process_commands
yield from command.invoke(ctx)
File "/home/sha-pc/.local/lib/python3.6/site-packages/discord/ext/commands/core.py", line 362, in invoke
yield from self.prepare(ctx)
File "/home/sha-pc/.local/lib/python3.6/site-packages/discord/ext/commands/core.py", line 340, in prepare
yield from self._parse_arguments(ctx)
File "/home/sha-pc/.local/lib/python3.6/site-packages/discord/ext/commands/core.py", line 299, in _parse_arguments
transformed = yield from self.transform(ctx, param)
File "/home/sha-pc/.local/lib/python3.6/site-packages/discord/ext/commands/core.py", line 207, in transform
raise MissingRequiredArgument('{0.name} is a required argument that is missing.'.format(param))
discord.ext.commands.errors.MissingRequiredArgument: ctx is a required argument that is missing.
What confuzes me is why this works on my windows 7 PC, but not this linux debian...
It looks like you are on the async branch with rewrite code.
To install the rewrite branch (which it looks like your code is), run pip install -U git+https://github.com/Rapptz/discord.py@rewrite#egg=discord.py
For future questions like this, you should join either the official discord.py server or the Discord API server for help, as the README recommends.
Wait what? I used the rewrite branch instalation... I'll use pip uninstall discord and retry...
Now it's breaking...
sha-pc@debian:~$ python3.6 -m pip install -U git+https://github.com/Rapptz/discord.py@rewrite#egg=discord.py[voice]
Collecting discord.py[voice] from git+https://github.com/Rapptz/discord.py@rewrite#egg=discord.py[voice]
Cloning https://github.com/Rapptz/discord.py (to rewrite) to /tmp/pip-build-m5lq60sa/discord.py
Error [Errno 2] No such file or directory: 'git': 'git' while executing command git clone -q https://github.com/Rapptz/discord.py /tmp/pip-build-m5lq60sa/discord.py
Cannot find command 'git'
You need to install Git and/or add it to PATH.
I'm on debian linux. I don't think there's a PATH on debian linux.
A cursory look into the shell manual or the numerous ways variables can shown, for examble by executing echo $PATH or just export in a shell will tell you otherwise.
If you don't already have git installed, sudo apt-get install git will probably install it.
I'm on debian linux. I don't think there's a PATH on debian linux.
your "home" folder is your path.
Most helpful comment
It looks like you are on the async branch with rewrite code.
To install the rewrite branch (which it looks like your code is), run
pip install -U git+https://github.com/Rapptz/discord.py@rewrite#egg=discord.pyFor future questions like this, you should join either the official discord.py server or the Discord API server for help, as the README recommends.