Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Duplication in bridge command help #2415

Closed
Closed
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ These changes are available on the `master` branch, but have not yet been releas
([#2407](https://github.com/Pycord-Development/pycord/pull/2407))
- Fixed invalid data being passed to `Interaction._guild` in certain cases.
([#2411](https://github.com/Pycord-Development/pycord/pull/2411))
- Fixed duplication in bridge command help.
Blue-Robin-Taken marked this conversation as resolved.
Show resolved Hide resolved
([#2415](https://github.com/Pycord-Development/pycord/pull/2415))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Move changelog to new section


### Changed

Expand Down
11 changes: 7 additions & 4 deletions discord/ext/commands/help.py
Original file line number Diff line number Diff line change
Expand Up @@ -995,10 +995,13 @@ def add_indented_commands(self, commands, *, heading, max_size=None):
max_size = max_size or self.get_max_size(commands)

get_width = discord.utils._string_width
for command in commands:
name = command.name
width = max_size - (get_width(name) - len(name))
entry = f'{self.indent * " "}{name:<{width}} {command.short_doc}'
last_name = ""
for command_name, command in [(command.name, command) for command in commands]:
if last_name == command_name:
continue
Blue-Robin-Taken marked this conversation as resolved.
Show resolved Hide resolved
last_name = command_name
width = max_size - (get_width(command_name) - len(command_name))
entry = f'{self.indent * " "}{command_name:<{width}} {command.short_doc}'
self.paginator.add_line(self.shorten_text(entry))

async def send_pages(self):
Expand Down
Loading