LAD
LAD

Reputation: 101

discord py bot has no attribute slash_command

That is all of the imports I have, it works on my pc however when I tried to run it on my pi4 I got the error saying no attribute slash_command, I installed all the packages I thought I needed which was, py-cord, discord.py. Any help would be appreciated. Imports error bot line

Upvotes: 1

Views: 9278

Answers (2)

LAD
LAD

Reputation: 101

I figured it out I had to install py-cord through this command:

pip install -U git+https://github.com/Pycord-Development/pycord

Upvotes: 4

Trent112232
Trent112232

Reputation: 175

It isn't commands.Bot, it's discord.Bot

Try this:

bot = discord.Bot(intents=intents)

bot.slash_command(description="Test")
async def test(ctx):
    ctx.respond("This is a test!")

commands.Bot doesn't support slash commands.

Upvotes: 0

Related Questions