CasuallyCalm / discord-pretty-help

An embed version of the built in help command for discord.py
MIT License
127 stars 32 forks source link

Unable to find 'discord.ext.commands.help' when using a fork of discord.py #63

Closed squigjess closed 2 years ago

squigjess commented 2 years ago

My project currently uses Nextcord, a fork of discord.py that works as a drop-in replacement for discord.py.

When importing and invoking discord-pretty-help ​like below...

import nextcord as discord
from nextcord.ext import commands
from pretty_help import PrettyHelp
...
client = commands.Bot(command_prefix=commands.command_prefix(config.COMMAND_PREFIX), help_command=PrettyHelp())

...Python throws a ModuleNotFoundError, with the reason No module named 'discord.ext.commands.help'. Full traceback is at the bottom of this issue.

Given that discord-pretty-help claims to (probably) support forks of discord.py on the PyPi page, I'm wondering if this is a bug or if I may have forgotten something.

Happy to help troubleshoot as needed!


Traceback (most recent call last):
  File "PROJECTDIRECTORY/bot.py", line 8, in <module>
    from pretty_help import PrettyHelp
  File "PROJECTDIRECTORY/venv/lib/python3.9/site-packages/pretty_help/__init__.py", line 2, in <module>
    from .pretty_help import *
  File "PROJECTDIRECTORY/venv/lib/python3.9/site-packages/pretty_help/pretty_help.py", line 9, in <module>
    from discord.ext.commands.help import HelpCommand
ModuleNotFoundError: No module named 'discord.ext.commands.help'
CasuallyCalm commented 2 years ago

Thanks for bringing this up. The error indicates a blatant oversight on my end, obviously discord is not installed when you're running nextcord or any other fork most likely so the import fails. You might be able to get away with installing discord.py in your project until I can fix this. So you would have both nextcord and discord installed, but your bot would still run on nextcord.

squigjess commented 2 years ago

That's absolutely valid. In lieu of Nextcord compatibility, I've ported this project over to nextcord-pretty-help to avoid having to implement and consider supporting both libraries (there are some minor yet code-breaking differences between Discord.py and Nextcord, one of which popped up here and prevented me from simply name-swapping import discord to import nextcord.

https://github.com/squigjess/nextcord-pretty-help

I'm keen to maintain this fork alongside discord-pretty-help, if it takes any load off your shoulders. I would really appreciate it if this is linked somewhere in the README for discord-pretty-help!