Better command arguments
This commit is contained in:
parent
26c36c8b0c
commit
2005fffa96
@ -11,6 +11,7 @@ module.exports = [
|
||||
arguments: ["any"],
|
||||
description: "Check how fast bot will reply!"
|
||||
},
|
||||
|
||||
{
|
||||
name: "help",
|
||||
run: (ctx, args) => {
|
||||
|
7
index.js
7
index.js
@ -114,11 +114,8 @@ client.on("messageCreate", (message) => {
|
||||
}
|
||||
|
||||
// Run command
|
||||
if (realCommand.arguments == ["any"] || realCommand.arguments == ["none"]) {
|
||||
realCommand.run(message, args)
|
||||
} else {
|
||||
realCommand.run(message, ...args) // Example in extra.js
|
||||
}
|
||||
realCommand.run(message, ...args)
|
||||
//...args passes it as separate args rather than an Array
|
||||
})
|
||||
|
||||
// After getting the command list we can export it
|
||||
|
Loading…
x
Reference in New Issue
Block a user