I am recursively loading cog files (its just one for testing) and the cog file is reported as loaded, however the command does not show up in discord. Trying to add a command without cog makes it show up instantly.
@bot.event
async def on_ready():
# await bot.sync_commands(force=True, check_guilds=bot.debug_guilds)
print(f"[-] We have logged in as {bot.user}")
for guild in await bot.fetch_guilds(limit=150).flatten():
print(f"[-] {guild.name} ({guild.id})")
try:
ret = bot.load_extensions("cogs.enabled", recursive=True)
for cog in ret:
print(f"[✓] Loaded {cog}")
except Exception as e:
print(f"[x] Failed to load cogs")
print(f"[!] Error: {e}")
@bot.command() # this works
async def eeeerrr(self):
raise Exception("This is an error")
returns
PS D:\Slluxx\Documents\GitHub\YippyBot> py .\start.py
[-] We have logged in as yipy#4829
[-] Personal Hax4dayz Testing Server (864815355666890752)
[-] testingground (951238286834278450)
[✓] Loaded cogs.enabled.util.userinfo
the cog file contents is this example cog from pycord:
https://github.com/Pycord-Development/pycord/blob/master/examples/app_commands/slash_cog.py
GitHub
Pycord, a maintained fork of discord.py, is a python wrapper for the Discord API - pycord/slash_cog.py at master · Pycord-Development/pycord
