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