Closed NanderTGA closed 1 year ago
Possibly, as a spin on the current Nightly msgroom:
client.commands.ping = new Command(
{
description: "Lorem ipsum dolor sit amet",
aliases: [],
created: "2023-07-03", // for example
// ... etc ...
},
() => {
return "Pong";
}
)
Interesting. On one side this is the solution because I wouldn't need to worry about breaking changes, but on another side this feels weird since the command class is actually just a utility class incase you don't want to take the other approach, which looks like this:
client.commands.ping = {
description: "Lorem ipsum dolor sit amet",
aliases: [],
handler: () => "Pong",
}
This feels weird because it would look a lot like that approach, and I might as well remove the Command class then, since it would only make a small difference. Combine this with the import issue and the Command class doesn't seem worth it anymore for me. Do we keep it or remove it?
Removing it does seem like the best way to go, as it would just lead to your code breaking everytime an update occurs.
:tada: This issue has been resolved in version 2.0.0 :tada:
The release is available on:
Your semantic-release bot :package::rocket:
We need some way to be able to tell users more about a command. My current idea is to put an object where you'd put a function (command handler) now. This object can contain aliases for a command, the handler and a description. The way to detect this is simple: from the moment a property called
handler
is defined, it's considered a command. I think we should also provide a class the user can instantiate for better code readability.