question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

`guild` and `guilds` make no effect

See original GitHub issue

Summary

guild and guilds in add_cog function make no effect on commands in cog

Reproduction Steps

I was trying to understand how this kwargs works and found it.

Minimal Reproducible Code

# cog.py
class Cog(commands.Cog):
    @app_commands.command()
    async def ping(self, inter):
        ...

def setup(bot):
    bot.add_cog(Cog(), guild=discord.Object(GUILD_ID))

# main.py
bot.load_extension('cog')

Expected Results

bot.tree.get_commands(guild=discord.Object(GUILD_ID))  #  [<discord.app_commands.commands.Command ...>]
bot.tree.get_commands()  # None

Actual Results

bot.tree.get_commands(guild=discord.Object(GUILD_ID))  # None
bot.tree.get_commands()  #  [<discord.app_commands.commands.Command ...>]

Intents

default

System Information

  • Python v3.10.1-final
  • discord.py v2.0.0-alpha
    • discord.py pkg_resources: v2.0.0a3843+gd921a039
  • aiohttp v3.8.1
  • system info: Windows 10 10.0.22000

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 made a research and came to the conclusion that the root of the issue is here (ext/commands/bot.py#L608) and/or here (ext/commands/cog.py#L503)

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
Rapptzcommented, Mar 12, 2022

Right now, the guild and guilds keyword arguments only do anything if the cog is also a group. I figured the remaining uses of guild and guilds would be done via the decorators. I guess the fact this issue exists means that the behaviour is surprising, so I suppose I should make it so it applies regardless of whether the cog is a group or not.

0reactions
m1rayneecommented, Mar 12, 2022

Yes, but then they will no longer be “free”, so there is no such thing. Feel free to reopen the issue if there is.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Are guilds bad for Games? — Takeaways for Guilds & Devs
There's a notion about guilds being value extractors in blockchain-enabled game economies & how some may be detrimental to the sustainability of these...
Read more >
Adventurer Guilds Are Dumb : r/DnD - Reddit
Adventurer Guilds are dumb and make no sense outside of videogames where they're just a gameplay contrivance to efficiently facilitate the ...
Read more >
Are Guilds a waste of time? - General Discussion
Unless you plan to do high end raiding (mythic and the last bosses in heroic), yes, they are seemingly useless. You might run...
Read more >
Why your Guild is Failing - The Product Hub
Guilds need to focus on outcomes and not simply discussion. They need to measure outcomes by their impact on the guild's mission, their...
Read more >
the Adventurers Guild and listen to their report Genshin Impact ...
Go to the Adventurers Guild and listen to their report Genshin Impact Secret Pirate Treasure quest video. This video shows how to complete ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found