-
-
Notifications
You must be signed in to change notification settings - Fork 499
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
22 changed files
with
526 additions
and
30 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
import { Command, type Context, type Lavamusic } from "../../structures/index.js"; | ||
|
||
export default class Pitch extends Command { | ||
constructor(client: Lavamusic) { | ||
super(client, { | ||
name: "pitch", | ||
description: { | ||
content: "cmd.pitch.description", | ||
examples: ["pitch 1", "pitch 1.5", "pitch 1,5"], | ||
usage: "pitch <number>", | ||
}, | ||
category: "filters", | ||
aliases: ["ph"], | ||
cooldown: 3, | ||
args: true, | ||
vote: false, | ||
player: { | ||
voice: true, | ||
dj: true, | ||
active: true, | ||
djPerm: null, | ||
}, | ||
permissions: { | ||
dev: false, | ||
client: ["SendMessages", "ReadMessageHistory", "ViewChannel", "EmbedLinks"], | ||
user: [], | ||
}, | ||
slashCommand: true, | ||
options: [ | ||
{ | ||
name: "pitch", | ||
description: "cmd.pitch.options.pitch", | ||
type: 3, | ||
required: true, | ||
}, | ||
], | ||
}); | ||
} | ||
|
||
public async run(client: Lavamusic, ctx: Context, args: string[]): Promise<any> { | ||
const player = client.manager.getPlayer(ctx.guild!.id); | ||
const pitchString = args[0].replace(",", "."); | ||
const isValidNumber = /^[0-9]*\.?[0-9]+$/.test(pitchString); | ||
const pitch = parseFloat(pitchString); | ||
|
||
if (!isValidNumber || isNaN(pitch) || pitch < 0.5 || pitch > 5) { | ||
await ctx.sendMessage({ | ||
embeds: [ | ||
{ | ||
description: ctx.locale("cmd.pitch.errors.invalid_number"), | ||
color: this.client.color.red, | ||
}, | ||
], | ||
}); | ||
return; | ||
} | ||
|
||
await player.filterManager.setPitch(pitch); | ||
return await ctx.sendMessage({ | ||
embeds: [ | ||
{ | ||
description: ctx.locale("cmd.pitch.messages.pitch_set", { | ||
pitch, | ||
}), | ||
color: this.client.color.main, | ||
}, | ||
], | ||
}); | ||
} | ||
} | ||
|
||
/** | ||
* Project: lavamusic | ||
* Author: Appu | ||
* Main Contributor: LucasB25 | ||
* Company: Coders | ||
* Copyright (c) 2024. All rights reserved. | ||
* This code is the property of Coder and may not be reproduced or | ||
* modified without permission. For more information, contact us at | ||
* https://discord.gg/ns8CTk9J3e | ||
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
import { Command, type Context, type Lavamusic } from "../../structures/index.js"; | ||
|
||
export default class Rate extends Command { | ||
constructor(client: Lavamusic) { | ||
super(client, { | ||
name: "rate", | ||
description: { | ||
content: "cmd.rate.description", | ||
examples: ["rate 1", "rate 1.5", "rate 1,5"], | ||
usage: "rate <number>", | ||
}, | ||
category: "filters", | ||
aliases: ["rt"], | ||
cooldown: 3, | ||
args: true, | ||
vote: false, | ||
player: { | ||
voice: true, | ||
dj: true, | ||
active: true, | ||
djPerm: null, | ||
}, | ||
permissions: { | ||
dev: false, | ||
client: ["SendMessages", "ReadMessageHistory", "ViewChannel", "EmbedLinks"], | ||
user: [], | ||
}, | ||
slashCommand: true, | ||
options: [ | ||
{ | ||
name: "rate", | ||
description: "cmd.rate.options.rate", | ||
type: 3, | ||
required: true, | ||
}, | ||
], | ||
}); | ||
} | ||
|
||
public async run(client: Lavamusic, ctx: Context, args: string[]): Promise<any> { | ||
const player = client.manager.getPlayer(ctx.guild!.id); | ||
const rateString = args[0].replace(",", "."); | ||
const isValidNumber = /^[0-9]*\.?[0-9]+$/.test(rateString); | ||
const rate = parseFloat(rateString); | ||
|
||
if (!isValidNumber || isNaN(rate) || rate < 0.5 || rate > 5) { | ||
await ctx.sendMessage({ | ||
embeds: [ | ||
{ | ||
description: ctx.locale("cmd.rate.errors.invalid_number"), | ||
color: this.client.color.red, | ||
}, | ||
], | ||
}); | ||
return; | ||
} | ||
|
||
await player.filterManager.setRate(rate); | ||
await ctx.sendMessage({ | ||
embeds: [ | ||
{ | ||
description: ctx.locale("cmd.rate.messages.rate_set", { | ||
rate, | ||
}), | ||
color: this.client.color.main, | ||
}, | ||
], | ||
}); | ||
} | ||
} | ||
|
||
/** | ||
* Project: lavamusic | ||
* Author: Appu | ||
* Main Contributor: LucasB25 | ||
* Company: Coders | ||
* Copyright (c) 2024. All rights reserved. | ||
* This code is the property of Coder and may not be reproduced or | ||
* modified without permission. For more information, contact us at | ||
* https://discord.gg/ns8CTk9J3e | ||
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
import { Command, type Context, type Lavamusic } from "../../structures/index.js"; | ||
|
||
export default class Reset extends Command { | ||
constructor(client: Lavamusic) { | ||
super(client, { | ||
name: "reset", | ||
description: { | ||
content: "cmd.reset.description", | ||
examples: ["reset"], | ||
usage: "reset", | ||
}, | ||
category: "filters", | ||
aliases: ["rs"], | ||
cooldown: 3, | ||
args: false, | ||
vote: false, | ||
player: { | ||
voice: true, | ||
dj: true, | ||
active: false, | ||
djPerm: null, | ||
}, | ||
permissions: { | ||
dev: false, | ||
client: ["SendMessages", "ReadMessageHistory", "ViewChannel", "EmbedLinks"], | ||
user: [], | ||
}, | ||
slashCommand: true, | ||
options: [], | ||
}); | ||
} | ||
|
||
public async run(client: Lavamusic, ctx: Context): Promise<any> { | ||
const player = client.manager.getPlayer(ctx.guild!.id); | ||
player.filterManager.resetFilters(); | ||
player.filterManager.clearEQ(); | ||
await ctx.sendMessage({ | ||
embeds: [ | ||
{ | ||
description: ctx.locale("cmd.reset.messages.filters_reset"), | ||
color: this.client.color.main, | ||
}, | ||
], | ||
}); | ||
} | ||
} | ||
|
||
/** | ||
* Project: lavamusic | ||
* Author: Appu | ||
* Main Contributor: LucasB25 | ||
* Company: Coders | ||
* Copyright (c) 2024. All rights reserved. | ||
* This code is the property of Coder and may not be reproduced or | ||
* modified without permission. For more information, contact us at | ||
* https://discord.gg/ns8CTk9J3e | ||
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
import { Command, type Context, type Lavamusic } from "../../structures/index.js"; | ||
|
||
export default class Rotation extends Command { | ||
constructor(client: Lavamusic) { | ||
super(client, { | ||
name: "rotation", | ||
description: { | ||
content: "cmd.rotation.description", | ||
examples: ["rotation"], | ||
usage: "rotation", | ||
}, | ||
category: "filters", | ||
aliases: ["rt"], | ||
cooldown: 3, | ||
args: false, | ||
vote: false, | ||
player: { | ||
voice: true, | ||
dj: true, | ||
active: true, | ||
djPerm: null, | ||
}, | ||
permissions: { | ||
dev: false, | ||
client: ["SendMessages", "ReadMessageHistory", "ViewChannel", "EmbedLinks"], | ||
user: [], | ||
}, | ||
slashCommand: true, | ||
options: [], | ||
}); | ||
} | ||
|
||
public async run(client: Lavamusic, ctx: Context): Promise<any> { | ||
const player = client.manager.getPlayer(ctx.guild!.id); | ||
if (player.filterManager.filters.rotation) { | ||
player.filterManager.toggleRotation(); | ||
await ctx.sendMessage({ | ||
embeds: [ | ||
{ | ||
description: ctx.locale("cmd.rotation.messages.disabled"), | ||
color: this.client.color.main, | ||
}, | ||
], | ||
}); | ||
} else { | ||
player.filterManager.toggleRotation(); | ||
await ctx.sendMessage({ | ||
embeds: [ | ||
{ | ||
description: ctx.locale("cmd.rotation.messages.enabled"), | ||
color: this.client.color.main, | ||
}, | ||
], | ||
}); | ||
} | ||
} | ||
} | ||
|
||
/** | ||
* Project: lavamusic | ||
* Author: Appu | ||
* Main Contributor: LucasB25 | ||
* Company: Coders | ||
* Copyright (c) 2024. All rights reserved. | ||
* This code is the property of Coder and may not be reproduced or | ||
* modified without permission. For more information, contact us at | ||
* https://discord.gg/ns8CTk9J3e | ||
*/ |
Oops, something went wrong.