#Vermium9649 make a thread and post more

1 messages · Page 1 of 1 (latest)

wintry scarab
#

I could post all levels of for example the view command

warm forge
#

show me your command handler

#

oh wait is this open sourced?

wintry scarab
#

Yes but this feature is not pushed yet

#

Or technicly it is

warm forge
#

well i think i see all i need

wintry scarab
#

View from this

#

And dev branch

warm forge
#
await client?.commands?.set(
          plugin?.default?.data?.name,
          plugin?.default
        );
```so you have this, right? you set the entire command as the value, right?
wintry scarab
#

Yea

#

But you could see here, I have each subcommand group and subcommand in their own file. So I need to pass all modules (subcommands) and all groups (subcommand groups) thru all levels of the command. https://github.com/VermiumSifell/xyter/blob/112def7c53c70b25b86fff44d0ec2c1b1645b3aa/src/plugins/counters/index.ts

GitHub

Earn credits while chatting! And more. Contribute to VermiumSifell/xyter development by creating an account on GitHub.

warm forge
#
  const currentCommand = client.commands.get(commandName);
```you have this, so `currentCommand.meta` should hold that value
#

you don't need/can't pass values discord doesn't take in and in the requests
you can work with what you have, that is the cached command objects

warm forge
#

what i mean is that you have commands stored and readily accessible to you
you don't need to send it through the api
you already have it

wintry scarab
#

Okay, so how to do then?

#

interaction.commandName?

warm forge
#
  const currentCommand = client.commands.get(commandName);

currentCommand.meta

wintry scarab
#

Let me test real quick

warm forge
#

like okay so let's say ts export const command = { name: "dummycommand" meta: {ephemeral: true}, execute(){} }

wintry scarab
#

The problem is that I pass them from subcommands not from the entire command "category"

warm forge
#

what do you mean

warm forge
#

oh so you split up the subcommands

wintry scarab
#

Yeah, because it would be a hell of code with some commands, and this makes it a lot more complex with the meta data

warm forge
#

hold on let me reread your question

#

and if the question is if you can somehow add them to the api, no
your approach of exporting modules and then checking that just works and it's probably what you should do

wintry scarab
#

Okay, it jsut seems like it will be confusing for new people contributing

warm forge
#

it sure is
it's very convoluted, do you really need everything to be inside a folder to have one file folders?

wintry scarab
warm forge
#

well glad i got the context, if it were buttons i'd recommend you to do the very cursed "add data to custom ids and parse them later on"

wintry scarab
#

☺️ Any ideas how to get all the files organized in a more logical way? 😅

warm forge
#

i still don't know what i'm looking at completely

wintry scarab
#

Okay, I call "commands" for plugins and subcommands for modules and subcommand groups for groups. Any way you would like to rename them to be easier to understnad?

warm forge
#

why not just commands and subcommands?

wintry scarab
#

Yea sure, how would you name subcommand groups then?

#

Or would you have them in the cmomands folder?

#

For etc

#

commands/settings/guild/credits/index.ts

Where.....
settings is the command
guild subcommand group
credits subcommand..?

#

and skip the whole folder for groups and folder for subcommands, and just have commands/settings/(either subcommand or subcommandgroup)/(index.ts or subcommand)?

#

Replace teh yellow with the above

warm forge
#

the first is better, where you have the subcommands inside the subcommands group and that inside a command

the thing i'd rather you change is if you changed the naming or documented it to say that plugins mean commands and modules mean subcommands
i know it still sounds convulated but people not to people who already worked with subcommand groups
but the naming can throw them off

wintry scarab
#

Which do you call the first one? the image?

wintry scarab
#

Yeah, so exactly like the image then?

warm forge
#

yeah it's fine, the modules folder is just not needed, what the other folders are can be inferred

wintry scarab
#

Yeah, one second, I will show you an examlpe of another meta data solution I came up with

#

is it okay if I mention you here when I'm ready to show. I need some time to make an example of it

warm forge
#

sure