Upgrades
Upgraded command parser package Added aliases to commands Added global help flag
This commit is contained in:
parent
88c7c3fbde
commit
c3ca8bbee6
@ -20,7 +20,7 @@
|
|||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@discordjs/opus": "^0.9.0",
|
"@discordjs/opus": "^0.9.0",
|
||||||
"@discordjs/voice": "^0.16.1",
|
"@discordjs/voice": "^0.16.1",
|
||||||
"@navy.gif/commandparser": "^1.6.6",
|
"@navy.gif/commandparser": "^1.6.7",
|
||||||
"@navy.gif/logger": "^2.5.4",
|
"@navy.gif/logger": "^2.5.4",
|
||||||
"@navy.gif/timestring": "^6.0.6",
|
"@navy.gif/timestring": "^6.0.6",
|
||||||
"@types/node": "^20.11.30",
|
"@types/node": "^20.11.30",
|
||||||
|
@ -319,7 +319,7 @@ class MusicPlayer implements Initialisable
|
|||||||
|
|
||||||
get queue ()
|
get queue ()
|
||||||
{
|
{
|
||||||
return Object.freeze(this.#queue);
|
return this.#queue;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -9,6 +9,7 @@ class QueueCommand extends Command
|
|||||||
{
|
{
|
||||||
super(client, {
|
super(client, {
|
||||||
name: 'queue',
|
name: 'queue',
|
||||||
|
aliases: [ 'q' ],
|
||||||
options: [{
|
options: [{
|
||||||
name: 'artist',
|
name: 'artist',
|
||||||
flag: true
|
flag: true
|
||||||
|
@ -11,6 +11,7 @@ class RequestCommand extends Command
|
|||||||
{
|
{
|
||||||
super(client, {
|
super(client, {
|
||||||
name: 'request',
|
name: 'request',
|
||||||
|
aliases: [ 'r', 'req' ],
|
||||||
guildOnly: true,
|
guildOnly: true,
|
||||||
sameVc: true,
|
sameVc: true,
|
||||||
showUsage: true,
|
showUsage: true,
|
||||||
|
@ -9,6 +9,7 @@ class SearchCommand extends Command
|
|||||||
{
|
{
|
||||||
super(client, {
|
super(client, {
|
||||||
name: 'search',
|
name: 'search',
|
||||||
|
aliases: [ 's' ],
|
||||||
showUsage: true,
|
showUsage: true,
|
||||||
options: [{
|
options: [{
|
||||||
name: 'keyword',
|
name: 'keyword',
|
||||||
|
@ -9,6 +9,7 @@ class VolumeCommand extends Command
|
|||||||
{
|
{
|
||||||
super(client, {
|
super(client, {
|
||||||
name: 'volume',
|
name: 'volume',
|
||||||
|
aliases: [ 'v', 'vol' ],
|
||||||
options: [
|
options: [
|
||||||
{
|
{
|
||||||
name: 'volume',
|
name: 'volume',
|
||||||
|
@ -30,6 +30,13 @@ class CommandHandler extends Observer
|
|||||||
commands: this.client.commands.values(),
|
commands: this.client.commands.values(),
|
||||||
prefix: client.prefix,
|
prefix: client.prefix,
|
||||||
resolver: client.resolver,
|
resolver: client.resolver,
|
||||||
|
globalFlags: [{
|
||||||
|
name: 'help',
|
||||||
|
flag: true,
|
||||||
|
valueOptional: true,
|
||||||
|
defaultValue: true,
|
||||||
|
type: OptionType.BOOLEAN
|
||||||
|
}],
|
||||||
debug: false
|
debug: false
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -120,6 +127,9 @@ class CommandHandler extends Observer
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (rest.globalFlags.help)
|
||||||
|
return this.#showUsage(message, command as Command);
|
||||||
|
|
||||||
if ((command as Command).showUsage && !Object.keys(rest.args).length && !rest.subcommand && !rest.subcommandGroup)
|
if ((command as Command).showUsage && !Object.keys(rest.args).length && !rest.subcommand && !rest.subcommandGroup)
|
||||||
return this.#showUsage(message, command as Command);
|
return this.#showUsage(message, command as Command);
|
||||||
|
|
||||||
|
10
yarn.lock
10
yarn.lock
@ -1628,10 +1628,10 @@ __metadata:
|
|||||||
languageName: node
|
languageName: node
|
||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
"@navy.gif/commandparser@npm:^1.6.6":
|
"@navy.gif/commandparser@npm:^1.6.7":
|
||||||
version: 1.6.6
|
version: 1.6.7
|
||||||
resolution: "@navy.gif/commandparser@npm:1.6.6"
|
resolution: "@navy.gif/commandparser@npm:1.6.7"
|
||||||
checksum: 10/1020ef32bd3b2b2e75dbbbf4814829765ec354ccac1c980978b49ebf2a6bc94cc7031691d2aa275ad98781027aa5cabe7bede8aecbd2d5a3bf8a48440b8befdf
|
checksum: 10/2f3ac85ca0d7168af96fd5d03ff85e00949e8f02ff7ac409e01f492c9712442723df536103897bed7d3c3091066525e78254e36591e49d1a9cade16f472383e9
|
||||||
languageName: node
|
languageName: node
|
||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
@ -3577,7 +3577,7 @@ __metadata:
|
|||||||
"@babel/preset-typescript": "npm:^7.24.1"
|
"@babel/preset-typescript": "npm:^7.24.1"
|
||||||
"@discordjs/opus": "npm:^0.9.0"
|
"@discordjs/opus": "npm:^0.9.0"
|
||||||
"@discordjs/voice": "npm:^0.16.1"
|
"@discordjs/voice": "npm:^0.16.1"
|
||||||
"@navy.gif/commandparser": "npm:^1.6.6"
|
"@navy.gif/commandparser": "npm:^1.6.7"
|
||||||
"@navy.gif/logger": "npm:^2.5.4"
|
"@navy.gif/logger": "npm:^2.5.4"
|
||||||
"@navy.gif/timestring": "npm:^6.0.6"
|
"@navy.gif/timestring": "npm:^6.0.6"
|
||||||
"@types/babel__core": "npm:^7"
|
"@types/babel__core": "npm:^7"
|
||||||
|
Loading…
Reference in New Issue
Block a user