PythonistaGuild / Wavelink

A powerful Lavalink library for Discord.py.
https://wavelink.dev
MIT License
389 stars 179 forks source link

ModuleNotFoundError: No module named 'discord.enums' #223

Closed matis071209 closed 1 year ago

matis071209 commented 1 year ago

Hello. I'm programming a bot on discord.py. I tried to change to nextcord but it gave me an error. The error is this: Traceback (most recent call last): File "c:\Users\M y N\Desktop\onubot\main.py", line 3, in <module> import wavelink File "C:\Python311\Lib\site-packages\wavelink\__init__.py", line 30, in <module> from .enums import * File "C:\Python311\Lib\site-packages\wavelink\enums.py", line 24, in <module> from discord.enums import Enum ModuleNotFoundError: No module named 'discord.enums'

This happens to me since I switched to nextcord. I went back to discord.py but it still shows up.

My Os is Windows 11 Pro, is a 64 bits OS, I have 8 gigs of ram, an AMD A6-7310 APU with AMD Radeon R4 Graphics (is a HP laptop), and my python version is the last(Python 3.11.3). Thanks if you can help me

PD: Another thing, my code is this : `import discord import wavelink from discord.ext import commands bot = commands.Bot(command_prefix='.', intents=discord.Intents.all())

@bot.event async def on_ready(): await bot.tree.sync() print(f'Yo soy {bot.user}') bot.loop.create_task(on_node()) async def on_node():

node: wavelink.Node=wavelink.Node(uri='https://lavalink.devamop.in:443', password='DevamOP', secure=True)
await wavelink.NodePool.connect(client=bot, nodes=[node])
wavelink.Player.autoplay= True

@bot.tree.command(description="Reproduce una cancion") async def play(interaction: discord.Interaction, search:str): query = await wavelink.YouTubeTrack.search(search, return_first=True) destination = interaction.user.voice.channel

if not interaction.guild.voice_client:
    vc: wavelink.Player = await destination.connect(cls=wavelink.Player)

else:
    vc: wavelink.Player = interaction.guild.voice_client

if vc.queue.is_empty and not vc.is_playing():
    await vc.play(query)
    await interaction.response.send_message(f'Ahora reproduciendo {vc.current.title}')
else: 
    await vc.queue.put_wait(query)
    await interaction.response.send_message('La cancion fue añadida')

@bot.tree.command(description='Skipea a la siguiente cancion') async def skip(interaction:discord.Interaction): vc: wavelink.Player = interaction.guild.voice_client

await vc.stop()
await interaction.response.send_message('La cancion fue skipeada')

@bot.tree.command(description='Pausa la cancion') async def pause(interaction: discord.Interaction): vc: wavelink.Player = interaction.guild.voice_client

if vc.is_playing():
    await vc.pause()
    await interaction.response.send_message('La cancion fue pausada')
else:
    await interaction.response.send_message('La cancion fue pausada')

@bot.tree.command(description='Vuelve a reproducir la cancion') async def resume(interaction: discord.Interaction): vc: wavelink.Player = interaction.guild.voice_client

if vc.is_playing():
    await interaction.response.send_message('La cancion esta reproduciendose')
    await vc.resume()
else:
    await interaction.response.send_message('La cancion se va a reanudar')
    await vc.resume()

@bot.tree.command(description='Desconecta al bot') async def disconnect(interaction: discord.Interaction): vc: wavelink.Player = interaction.guild.voice_client

if vc.is_playing():
    await vc.disconnect()
    await interaction.response.send_message('Ya se desconecto el bot')

else:
    await interaction.response.send_message('El bot ya esta desconectado')
    await vc.disconnect`

Pd2: If I have a orthographic error, Sorry I use Google Translate

chillymosh commented 1 year ago

Wavelink does not support forks that have changed the namespace.

matis071209 commented 1 year ago

Wavelink does not support forks that have changed the namespace.

Ok but i already uninstalled nextcord and installed discord.py but i still get the error. Same thanks

matis071209 commented 1 year ago

I already solved it, it was just uninstalling wavelink and discord.py and reinstalling them