Comments (7)
This same error also appears when trying to add a user_command in a cog. It appeared for me on a cog reload
from pycord.
This error appears to always happen when using reload_extension. Not only does it give this error, it also disables all prefixed commands in cogs. Slash commands continue to work and the prefixed commands work after the bot is restarted.
from pycord.
In my case, all commands seem to work just fine, but the simple fact of having a slash/user/message command in a cog, makes this error to appear whenever one uses the cog.get_commands()
from pycord.
This error appears to always happen when using reload_extension. Not only does it give this error, it also disables all prefixed commands in cogs. Slash commands continue to work and the prefixed commands work after the bot is restarted.
this is likely because both get_command
and reload_extension
access all_commands
which appears to be the issue
from pycord.
could you add more to your minimal reproducable code? This isn't descriptive enough for me to test
from pycord.
could you add more to your minimal reproducable code? This isn't descriptive enough for me to test
This took me a while to figure out how to reproduce, but i got it.
Main file:
@bot.command(name = 'reload')
async def _reload(ctx):
bot.reload_extension('cogs.CogTest')
await ctx.send("reloaded cog")
for filename in os.listdir('./cogs'):
if filename.endswith('.py'):
bot.load_extension(f'cogs.{filename[:-3]}')
Cog:
from discord.ext import commands
from discord.app import commands as app
from discord import Option
class CogTest(commands.Cog):
def __init__(self, bot):
self.bot = bot
@app.slash_command(description = "I describe", guild_ids = [250507134876254208])
async def reply(self, ctx):
await ctx.respond(f"Hi")
@commands.command()
async def test(self, ctx):
await ctx.send("test")
The order that the commands are in inside of the cog is important. The error only occurs when a prefixed command is after a slash command.
from pycord.
I have implemented a fix for this on the restructure
branch that should work, let me know if there's something else wrong with it in your use case.
from pycord.
Related Issues (20)
- BridgeOption converts discord.Member wrong with ext command
- Unclosed client session, Unclosed connector HOT 3
- deprecate and replace with interaction_metadata HOT 5
- authorizing_integration_owners HOT 1
- Temporary disable slash_command in py-cord HOT 4
- Guild.search_members bug
- AttributeError: 'FFmpegPCMAudio' object has no attribute '_process' HOT 2
- Interaction Error on Shard Reconnection HOT 4
- Constant Shard Reconnection and ConnectionClosed Errors with AutoShardedBot HOT 1
- string returned for slash commands when using `Option/input_type` HOT 1
- Subcommand groups not showing up in the Slash Command channel HOT 4
- Slash commands interaction response doesnt give message HOT 1
- Error importing SlashCommandGroup, Page, ext.pages HOT 3
- audit_logs not fetching more than 100 logs HOT 4
- Paginator error upon failed interaction
- DeprecationWarning for BridgeOption raised at module level
- v2.7: Remove backwards support for Option in bridge commands.
- Add description attribute to ClientUser HOT 1
- Unclear exception when command is run without first creating bot in server HOT 1
- sync_commands doesnt raise error HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pycord.