Hello, i used the examplecode but then i get an nonetype error that i dont know how to solve:
Failed to load extension music.py
Traceback (most recent call last):
File "D:\Downloads\Python\python 3.8.7\lib\site-packages\discord\ext\commands\bot.py", line 618, in _load_from_module_spec
setup(self)
File "D:\my_python_projects\MongoDB Test\Cogs\music.py", line 175, in setup
bot.add_cog(Music(bot))
File "D:\my_python_projects\MongoDB Test\Cogs\music.py", line 22, in __init__
bot.lavalink = lavalink.Client(bot.user.id)
AttributeError: 'NoneType' object has no attribute 'id'
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "D:/my_python_projects/MongoDB Test/mongosetup.py", line 145, in <module>
bot.load_extension(f"Cogs.{filename[:-3]}")
File "D:\Downloads\Python\python 3.8.7\lib\site-packages\discord\ext\commands\bot.py", line 678, in load_extension
self._load_from_module_spec(spec, name)
File "D:\Downloads\Python\python 3.8.7\lib\site-packages\discord\ext\commands\bot.py", line 623, in _load_from_module_spec
raise errors.ExtensionFailed(key, e) from e
discord.ext.commands.errors.ExtensionFailed: Extension 'Cogs.music' raised an error: AttributeError: 'NoneType' object has no attribute 'id'
Hello, i used the examplecode but then i get an nonetype error that i dont know how to solve: