#App cmds resync
1 messages · Page 1 of 1 (latest)
self.bot.reload_extension(cog)
await self.bot.sync_all_application_commands()```
im guessing await self.bot.sync_all_application_commands() could be the cause?
maybe you have to await self.bot.reload_extension(cog) ??
idk surely because i've only used that one time
but maybe you could try it
reload is not async
oh alr
await self.bot.sync_application_commands(guild_ids = [your_guild_ids/guild_id variables) maybe you could try something like this?
it works for me
That's not how it works
????
A Python wrapper for the Discord API forked from discord.py - nextcord/nextcord
Wait
Wrong one
Okay I can't get the line url but it's in there
The guild IDs are automatic
Guild_ids is not a parameter first off
guild_id exist but that's for syncing specific guilds
Do they even show about that specific function
Yes they do
Show me
I didn't encounter any errors
It syncs fine
But integration types and contexts are ignored
First answer
Their situation is different
Well yeah
Their issue does not have anything to do with mine
Well the problem is the guild_ids or the actual thing?
Well maybe there's something in the integrations? Not sure what they are due to language barrier
Integration types and contexts are used to make app cmds show/hide from specific places
For example, you can hide them from DMs
These commands aren't supposed to show in dms (which is what I mean by integration types and contexts)
Weird because I load commands normally as I showed above with no specifications and I don't think they show up in dms
Ye they dont
I'm talking about reloading tho
Not loading
Obviously when I load them for the first time, the integration types and contexts are there
Oh bruh so when you reload, dm commands are set to true?
It's also other stuff too
Dms was an example
Not all of the commands should show up for user app cmds
Weird
Can u send it through streamable or smth
Idk why it's showing a black screen
ill upload it to youtube
wait 1 min
damn.
@wintry patio https://youtu.be/Fcsyq72-rBs
No not permissions
Unless the missing permissions mean that the slash cmd isn't meant to be listed due to cache
yes
exactly
dm_permission is basically "is it viewable and usable in dms"
and when i reload discord, after changing it to false, command disappears
The thing is, I didn't change the slash cmds at all when I relaoded
so how does it supposed to know if its usable in dms or not?
i dont quite understand what you trynna do
When I startup the bot, the commands syncs fine but reloading it ignores the contexts and integration types of each command which results in showing every command
I'm using the GitHub version
And slash cmds have the contexts and integration_types parameter
show me another example
Yea give me a sec
by integration types you mean type of data in slash option?
Could not find anything. Sorry.
give me an example of command with those params
Alr
@slash_command(name="hello", integration_types=[nextcord.IntegrationType.guild_install], contexts=[nextcord.InteractionContextType.guild]) # This should show in guilds only and not in dms or guilds that the bot isn't in
async def hello(self, interaction):
pass```
and when you reload that command, it ignores integration_types and shows in dms?
Integration_types and contexts
are cogs different in v3?
Cause in v3, u still can't sync app cmds with the reload extension function, so you'd have to do the syncing urself
just in case, you want to reload only command or cog?
Both
because if i reload cog, integration_types and context is not ignored, and everything works fine
and command is not showing up in dms
no, just bot.reload_extension
Since when does reload extension syncs the cmds now
if i make any change to command and reload the cog, it will sync
i can demo my screen if you want
Alento told me that reload_extension in the GitHub version doesn't sync the commands
hm
i guess it works 
I'll check it out once I'm on pc
can you watch demo rn?
I did not expect reload_extension to actually reload app cmds
Wdym
my screen in voice chat
I'm on mobile but sure
Yep
Wait
I only see ur discord rn
Now I see it
Wait what happens if u put the sync_app_cmds below ur reload extension function
Ik it's not needed
But
I wanna see what happens from ur side
Yea
so just like this?
Usually I do reload_extension instead of unloading and then loading
yeah the .reload_extension doesnt work
only this method ig
Yea I'm confused why it doesn't do that
Funny thing is, v2 has the same issue too
no
.reload works in v2
.unload_extension
self._remove_module_references(lib.__name__)
self._call_module_finalizers(lib, name)
.load_extension
self._load_from_module_spec(spec, name, extras=extras)
.reload_extension
self._remove_module_references(lib.__name__)
self._call_module_finalizers(lib, name)
self.load_extension(name, extras=extras)
Please avoid codeblocks for code. Posted to -> https://paste.nextcord.dev/?id=1734685381248756&language=python
i think they forgot to change something from v2
self.load_extension(name, extras=extras)
oh
no
im wrong, everything is good in the code
Hm
Lmao
why do you even use v3?