#Vermium9649 make a thread and post more
1 messages · Page 1 of 1 (latest)
well i think i see all i need
View from this
And dev branch
await client?.commands?.set(
plugin?.default?.data?.name,
plugin?.default
);
```so you have this, right? you set the entire command as the value, right?
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
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
How do you mean, look at these 4 files.
https://github.com/VermiumSifell/xyter/blob/112def7c53c70b25b86fff44d0ec2c1b1645b3aa/src/plugins/counters/index.ts
https://github.com/VermiumSifell/xyter/blob/112def7c53c70b25b86fff44d0ec2c1b1645b3aa/src/plugins/counters/modules/index.ts
https://github.com/VermiumSifell/xyter/blob/a8af4582ade342580cbfb6e4492ada527e65d691/src/plugins/counters/modules/view/index.ts
How I get the meta value:
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
const currentCommand = client.commands.get(commandName);
currentCommand.meta
Let me test real quick
like okay so let's say ts export const command = { name: "dummycommand" meta: {ephemeral: true}, execute(){} }
The problem is that I pass them from subcommands not from the entire command "category"
what do you mean
Look at these files
oh so you split up the subcommands
Yeah, because it would be a hell of code with some commands, and this makes it a lot more complex with the meta data
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
Okay, it jsut seems like it will be confusing for new people contributing
it sure is
it's very convoluted, do you really need everything to be inside a folder to have one file folders?
I don't but I think it is easier to expand I don't know. And I could split command parts into mulitple files if file is being too long
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"
☺️ Any ideas how to get all the files organized in a more logical way? 😅
i still don't know what i'm looking at completely
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?
why not just commands and subcommands?
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
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
Which do you call the first one? the image?
this
Yeah, so exactly like the image then?
yeah it's fine, the modules folder is just not needed, what the other folders are can be inferred
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
sure