#A question about commands.SubCommand.body
1 messages · Page 1 of 1 (latest)
disnake/ext/commands/slash_core.py lines 337 to 339
@property
def body(self) -> Option:
return self.option
it does make sense. as far as the discord api is concerned, a slash subcommand is an option on its parent
Here is the description of the property body of class commands.InvokableApplicationCommand (its parent)
wait really 
yep
See https://discord.com/developers/docs/interactions/application-commands#subcommands-and-subcommand-groups if interested
oh i see
This was fun working out for one of my projects. It's not difficult, though.
Just have to iterate and find the disnake.Option.type that is disnake.OptionType.sub_command
it's a bit confusing tho since there is no description about it on disnake API reference 😅
yeah, a decent amount of stuff on slash command objects (regrettably) isn't documented as it's mostly meant for internal use
honestly kinda surprised it is documented on InvokableSlashCommand
Honestly, my favorite feature of the docs is that most everything has a direct link to the source. It comes in handy so damn often.
it makes sense because ppl might need the SlashCommand object from it
i use it in my project but there appears a bug when I use that on SubCommand 
anyways thank you a lot 