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

Command duplication in cog help #2306

Open
3 tasks done
solaluset opened this issue Jan 1, 2024 · 8 comments · May be fixed by #2415
Open
3 tasks done

Command duplication in cog help #2306

solaluset opened this issue Jan 1, 2024 · 8 comments · May be fixed by #2415
Labels
bug Something isn't working on hold priority: low Low Priority

Comments

@solaluset
Copy link
Contributor

Summary

Bridge commands are duplicated in cog help

Reproduction Steps

  1. Create a bridge command in a cog.
  2. Request help for that cog

Minimal Reproducible Code

from os import getenv

import discord
from discord.ext import bridge, commands


class MyCog(commands.Cog):
    @discord.command()
    async def slash_command(self, ctx):
        await ctx.respond("Hi")

    @commands.command()
    async def prefix_command(self, ctx):
        await ctx.respond("Hi")

    @bridge.bridge_command()
    async def bridge_command(self, ctx):
        await ctx.respond("Hi")


bot = bridge.Bot()
bot.add_cog(MyCog())

bot.run(getenv("TOKEN"))

Expected Results

Screenshot_20240101-134341782 (1)

Actual Results

Screenshot_20240101-133650329 (1)

Intents

None

System Information

/data/data/com.termux/files/home/tests/lib/python3.11/site-packages/discord/__main__.py:33: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html
  import pkg_resources
- Python v3.11.6-final
- py-cord v2.4.1-final
- aiohttp v3.9.1
- system info: Linux 4.14.232-QuicksilveR™-ReloadedOS-Edition #1 SMP PREEMPT Wed May 26 07:08:17 UTC 2021

Checklist

  • I have searched the open issues for duplicates.
  • I have shown the entire traceback, if possible.
  • I have removed my token from display, if visible.

Additional Context

I've made two attempts to fix it, I can open a PR if you find one of them satisfying:
https://github.com/Krutyi-4el/pycord/tree/help-fix-v1
https://github.com/Krutyi-4el/pycord/tree/help-fix-v2

@solaluset solaluset added the unconfirmed bug A bug report that needs triaging label Jan 1, 2024
@Lulalaby
Copy link
Member

Lulalaby commented Jan 1, 2024

Please check this bug with our git master version

@solaluset
Copy link
Contributor Author

I've already done this

@solaluset
Copy link
Contributor Author

This is still an issue.

@JustaSqu1d JustaSqu1d added bug Something isn't working priority: low Low Priority and removed unconfirmed bug A bug report that needs triaging labels Feb 10, 2024
@Blue-Robin-Taken
Copy link
Contributor

Looking at the code a bit more makes me think that this is only a problem with the help command itself

@Blue-Robin-Taken
Copy link
Contributor

Nvm I think this is already fixed
image

@solaluset
Copy link
Contributor Author

@Blue-Robin-Taken it's not. Try help MyCog.

@Blue-Robin-Taken
Copy link
Contributor

Blue-Robin-Taken commented Apr 3, 2024

Oh true

[<discord.ext.bridge.core.BridgeExtCommand object at 0x000001EED35FE490>, <discord.ext.bridge.core.BridgeCommand object at 0x000001EED35FFAD0>, <discord.ext.commands.core.Command object at 0x000001EED35FE850>]

is what's printed from def add_indented_commands(self, commands, *, heading, max_size=None): in help.py
I only have 2 commands & it dupes the bridge cause it's in text and in slash I think

@Blue-Robin-Taken
Copy link
Contributor

Ok I think I fixed it & I'm going to make a PR. If you don't print one of the types, it works.
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working on hold priority: low Low Priority
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants