#Slash commands do not show up

1 messages · Page 1 of 1 (latest)

hexed harbor
#

.slashnoshow

patent krakenBOT
#

Checklist for Application Commands Not Showing Up:
• Does your bot have the application.commands scope?
• Are you loading cogs before on_ready and on_connect?
• Is on_connect not overridden?
• Did you update to the newest version of py-cord (tag: install)?
• Is User Settings > Accessibility > Chat Input > Use legacy chat input turned off?
• Did you share your code and errors?
• Do you still have libraries that conflict with the discord namespace (e.g. discord.py)?

nocturne dock
#

Closing this as the user seems to have left the server

tulip cradle
#

im using pycord 2.0.0rc1, for some reason no matter what i do the slash commands dont show up when i try to use them

import discord
from discord.ext import commands
from discord.commands import slash_command

class Test(commands.Cog):
    def __init__(self, bot):
        self.bot = bot

    @commands.Cog.listener()
    async def on_message(self, message):
        if message.author.id == 906318377432281088:
            await message.channel.send("working!")

    @slash_command(description="Test command")
    async def test(self, ctx):
        await ctx.send("test")


def setup(bot):
    bot.add_cog(Test(bot))

autumn flint
tulip cradle
#

ill try it

#

still nothing

autumn flint
#

when do you load your cogs

tulip cradle
#
class TestBot(commands.Bot):
    def __init__(self):
        super().__init__(intents=discord.Intents.all())

        self.bot = self
        self.debug_guilds = None # censored

        self.on_start()

    def on_start(self):
        for cog in [file.replace('.py', '') for file in listdir("cogs") if isfile(join('cogs', file))]:
            logger.info(f"Loading cog: {cog}")

            try:
                self.load_extension('cogs' + '.' + cog)
                logger.info(f"Successfully loaded {cog}")
            except Exception as e:
                logger.error(f"Failed to load {cog}")
                logger.error(f"Error: {e}")
#

in on_start

autumn flint
autumn flint
#

what does it show if you for loop bot.walk_application_commands()

tulip cradle
#
@commands.Cog.listener()
    async def on_ready(self):
        for command in self.bot.walk_application_commands():
            logger.info(command)
#

something like this?

#

nothing