0

I have tried many different ways of trying to get the discord_slash import to work but I keep getting the same error over and over again

The error in my code says:

ModuleNotFoundError: No module named 'discord_slash'

This is my code:

import discord
from discord_slash.utils.manage_components import create_select, create_select_option, create_actionrow

select = create_select(
    options=[
        create_select_option("Test 1", value="Test 1", emoji=""),
        create_select_option("Test 2", value="Test 2", emoji=""),
        create_select_option("Test 3", value="test 3", emoji="")
    ],
    placeholder="Choose your option",
    min_values=1,
    max_values=2
)
action_row = create_actionrow(select)

client = discord.Client()

@client.event
async def on_message(message):
  if message.content.lower().startswith():
    await ctx.send(components=[action_row])
Dolphin
  • 11
  • 4

1 Answers1

0

Have you downloaded the discord_slash library ? If not run this line in terminal:

pip install -U discord-py-slash-command

If this still doesn't work make sure pip is installing the module in the correct directory for your chosen IDE to access. Here is more info on that: Pip Install not installing into correct directory?.

Dharman
  • 30,962
  • 25
  • 85
  • 135
x-1-x
  • 323
  • 2
  • 9