Skip to content

Commit

Permalink
fix: circular import in default help command (#2704)
Browse files Browse the repository at this point in the history
* 🚑 Fix circular import - oops

* fix: NameError

---------

Co-authored-by: Dorukyum <[email protected]>
  • Loading branch information
Paillat-dev and Dorukyum authored Feb 1, 2025
1 parent 869f666 commit 1b6d2bd
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions discord/ext/commands/help.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
from typing import TYPE_CHECKING, Any

import discord.utils
from discord.ext import bridge

from .core import Command, Group
from .errors import CommandError
Expand Down Expand Up @@ -1111,13 +1110,15 @@ async def send_group_help(self, group):
await self.send_pages()

async def send_cog_help(self, cog):
from discord.ext.bridge import BridgeExtCommand

if cog.description:
self.paginator.add_line(cog.description, empty=True)

filtered = await self.filter_commands(
cog.get_commands(),
sort=self.sort_commands,
exclude=(bridge.BridgeExtCommand,),
exclude=(BridgeExtCommand,),
)
self.add_indented_commands(filtered, heading=self.commands_heading)

Expand Down Expand Up @@ -1355,6 +1356,8 @@ def get_category(command, *, no_category=no_category):
await self.send_pages()

async def send_cog_help(self, cog):
from discord.ext.bridge import BridgeExtCommand

bot = self.context.bot
if bot.description:
self.paginator.add_line(bot.description, empty=True)
Expand All @@ -1369,7 +1372,7 @@ async def send_cog_help(self, cog):
filtered = await self.filter_commands(
cog.get_commands(),
sort=self.sort_commands,
exclude=(bridge.BridgeExtCommand,),
exclude=(BridgeExtCommand,),
)
if filtered:
self.paginator.add_line(f"**{cog.qualified_name} {self.commands_heading}**")
Expand Down

0 comments on commit 1b6d2bd

Please sign in to comment.