cogs #552
Replies: 18 comments
-
ask for help here https://discord.gg/disnake |
Beta Was this translation helpful? Give feedback.
-
so you're saying that's not a bug? |
Beta Was this translation helpful? Give feedback.
-
I'm sorry, I don't have telepathy, I can't see your code. |
Beta Was this translation helpful? Give feedback.
-
We need code to help you also please use discussions or join the discord server for help |
Beta Was this translation helpful? Give feedback.
-
it's not about my code. Cuz it used to fine but here is my code👍: for x in os.listdir("./cogs"):
if x.endswith(".py"):
try:
bot.load_extension(f"cogs.{x[:-3]}")
except Exception:
pass
for i in os.listdir("./antinuke"):
if i.endswith(".py"):
try:
bot.load_extension(f"antinuke.{i[:-3]}")
except Exception:
pass
if __name__ == "__main__":
bot.run(token) | cogs class SlashCommands(commands.Cog):
def __init__(self, bot):
self.bot = bot
@commands.slash_command(guild_ids = [849658396675276841])
@commands.is_owner()
async def add(self, ctx, *, guild : int):
premium = await cl.find_one({"_id": 849658396675276841})
if guild in premium["list"]:
await ctx.send("already in the premium list", ephemeral=True)
return
info = self.bot.get_guild(guild)
try:
await cl.update_one({"_id" : 849658396675276841},{"$push" : {"list" : guild}})
await ctx.send(f"<:zeroon1yes:866375654751338516> {info.name} added to the list.")
except Exception as e:
await ctx.send(f"Error: ``{e}``", ephemeral=True)
@add.error
async def add_error(self, ctx, error):
if isinstance(error, commands.NotOwner):
await ctx.send("<:zeroon1no:866375710130044968> You can't use this.", ephemeral=True)
def setup(bot):
bot.add_cog(SlashCommands(bot)) |
Beta Was this translation helpful? Give feedback.
-
What is the error in console ? |
Beta Was this translation helpful? Give feedback.
-
change to except Exception as e:
print(e)
|
Beta Was this translation helpful? Give feedback.
-
Thats not the issue doe |
Beta Was this translation helpful? Give feedback.
-
Just do it and send the issue |
Beta Was this translation helpful? Give feedback.
-
it will print "cogs.slashcommands is already loaded/not loaded" |
Beta Was this translation helpful? Give feedback.
-
do you even know what my issue is
|
Beta Was this translation helpful? Give feedback.
-
i read the issue your error states you are loading the same cog more than once do you know by any chance where you are doing so in your code |
Beta Was this translation helpful? Give feedback.
-
check #help-disnake channel |
Beta Was this translation helpful? Give feedback.
-
@add.error
async def add_error(self, ctx, error):
if isinstance(error, commands.NotOwner):
await ctx.send("<:zeroon1no:866375710130044968> You can't use this.", ephemeral=True)``` add a else @add.error
async def add_error(self, ctx, error):
if isinstance(error, commands.NotOwner):
await ctx.send("<:zeroon1no:866375710130044968> You can't use this.", ephemeral=True)
else:
print(error) |
Beta Was this translation helpful? Give feedback.
-
omg thats not the issue |
Beta Was this translation helpful? Give feedback.
-
read this amazing guide |
Beta Was this translation helpful? Give feedback.
-
omg, you don't see any error when you're trying to use this command,. bruh |
Beta Was this translation helpful? Give feedback.
-
Anyways Thank yall!! |
Beta Was this translation helpful? Give feedback.
-
Summary
The slash commands in cogs dont work. It used to work fine
Reproduction Steps
just loading the cogs
Minimal Reproducible Code
No response
Expected Results
shows the slash commands in the (test_guilds)
Actual Results
The commands work fine but slash commands dont even show up in the specific guild (test_guilds)
Intents
members
System Information
Checklist
Additional Context
No response
Beta Was this translation helpful? Give feedback.
All reactions