Pr0nBotDev / Pr0nBot

A NSFW Discord Bot written in Python
MIT License
32 stars 12 forks source link

This Error keeps on happening while running MainBot.py #2

Open RounakX opened 4 years ago

RounakX commented 4 years ago

==================== RESTART: D:\F2\Pr0nBot\MainBot.py ====================== Traceback (most recent call last): File "D:\Users\RDX\AppData\Local\Programs\Python\Python38-32\lib\site-packages\discord\ext\commands\bot.py", line 608, in _load_from_module_spec setup(self) File "D:\F2\Pr0nBot\PornHub.py", line 657, in setup bot.load_extension(PornHub(bot)) File "D:\Users\RDX\AppData\Local\Programs\Python\Python38-32\lib\site-packages\discord\ext\commands\bot.py", line 649, in load_extension spec = importlib.util.find_spec(name) File "D:\Users\RDX\AppData\Local\Programs\Python\Python38-32\lib\importlib\util.py", line 90, in find_spec fullname = resolve_name(name, package) if name.startswith('.') else name AttributeError: 'PornHub' object has no attribute 'startswith'

The above exception was the direct cause of the following exception:

Traceback (most recent call last): File "D:\F2\Pr0nBot\MainBot.py", line 42, in bot.load_extension("PornHub") File "D:\Users\RDX\AppData\Local\Programs\Python\Python38-32\lib\site-packages\discord\ext\commands\bot.py", line 653, in load_extension self._load_from_module_spec(spec, name) File "D:\Users\RDX\AppData\Local\Programs\Python\Python38-32\lib\site-packages\discord\ext\commands\bot.py", line 613, in _load_from_module_spec raise errors.ExtensionFailed(key, e) from e discord.ext.commands.errors.ExtensionFailed: Extension 'PornHub' raised an error: AttributeError: 'PornHub' object has no attribute 'startswith'

chicoze2 commented 3 years ago

did u fixed it?

chicoze2 commented 3 years ago

try using 'user_cog' instead of 'load_extension'

samalzpro49 commented 12 months ago

This bot is written in discord.js 1.0 so you have to update the script to discord.js to 2.0