Skip to content

Commit

Permalink
[Fix] various fixes and updates to the commands
Browse files Browse the repository at this point in the history
  • Loading branch information
naseif committed Oct 4, 2021
1 parent a0fa318 commit 3c97bcf
Show file tree
Hide file tree
Showing 6 changed files with 94 additions and 11 deletions.
10 changes: 5 additions & 5 deletions commands/Misc/help.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,23 +89,23 @@ module.exports = {
fields: [
{
name: "Aliases",
value: "`" + `${command.aliases.join(", ")}` + "`",
value: "`" + `${command?.aliases.join(", ")}` + "`",
},
{
name: "Requires arguments?",
value: `${command.args ? "Yes" : "No"}`,
value: `${command?.args ? "Yes" : "No"}`,
},
{
name: "Category",
value: `${command?.category}`,
value: `${command.category}`,
},
{
name: "Description",
value: `${command?.description}`,
value: `${command.description}`,
},
{
name: "Usage",
value: "`" + `${prefix}${command.usage}` + "`",
value: "`" + `${prefix}${command?.usage}` + "`",
},
],
timestamp: new Date(),
Expand Down
4 changes: 2 additions & 2 deletions commands/Music/247.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const playdl = require("play-dl");
module.exports = {
name: "247",
args: true,
description: "Sets the bot to 24/7 mode",
description: "Sets 24/7 Mode for the bot",
usage: "247 <on> || <off>",
async run(message, args, client) {
const queue = client.player.getQueue(message.guild);
Expand Down Expand Up @@ -94,7 +94,7 @@ module.exports = {
},
data: new SlashCommandBuilder()
.setName("247")
.setDescription("24/7 Mode for the bot")
.setDescription("Sets 24/7 Mode for the bot")
.addStringOption((option) =>
option
.setName("status")
Expand Down
2 changes: 1 addition & 1 deletion commands/Music/8D.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ module.exports = {
},
data: new SlashCommandBuilder()
.setName("8d")
.setDescription("8D Audio Filter")
.setDescription("Sets 8D audio filter to your music")
.addStringOption((option) =>
option
.setName("mode")
Expand Down
4 changes: 2 additions & 2 deletions commands/Music/bassboost.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ module.exports = {
aliases: ["bass"],
args: true,
description: "Sets bassboost audio filter to your music",
usage: "bassboost <on> || <off>",
usage: "bass <low> || <medium> || high || off",
async run(message, args, client) {
const queue = client.player.getQueue(message.guild);

Expand Down Expand Up @@ -75,7 +75,7 @@ module.exports = {
},
data: new SlashCommandBuilder()
.setName("bassboost")
.setDescription("bassboost Audio Filter")
.setDescription("Sets bassboost audio filter to your music")
.addStringOption((option) =>
option
.setName("mode")
Expand Down
43 changes: 43 additions & 0 deletions commands/Music/clear.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,49 @@ const { SlashCommandBuilder } = require("@discordjs/builders");
const { embedMessage } = require("../../modules/embedSimple");

module.exports = {
name: "clear",
aliases: ["cl"],
args: false,
description: "Clears the Music Queue",
usage: "cl || clear",
async run(message, args, client) {
const queue = client.player.getQueue(message.guild);

if (!queue) {
return await message.channel.send({
embeds: [
embedMessage(
"#9dcc37",
`❌ | No Queue has been created for this guild`
),
],
});
}

try {
if (queue) {
await queue.clear();
await message.channel.send({
embeds: [
embedMessage(
"#9dcc37",
`✅ Queue Cleared! [${message.member.toString()}]`
),
],
});
}
} catch (err) {
client.logger(err.message, "error");
await message.channel.send({
embeds: [
embedMessage(
"#9dcc37",
"Could not clear the queue, maybe there is no queue"
),
],
});
}
},
data: new SlashCommandBuilder()
.setName("clear")
.setDescription("clears the music queue"),
Expand Down
42 changes: 41 additions & 1 deletion commands/Music/disconnect.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,49 @@ const { SlashCommandBuilder } = require("@discordjs/builders");
const { embedMessage } = require("../../modules/embedSimple");

module.exports = {
name: "disconnect",
aliases: ["dc"],
args: false,
description: "disconnects the bot from the voice channel",
usage: "dc || disconnect",
async run(message, args, client) {
const queue = client.player.getQueue(message.guild);

if (!queue) {
return await message.channel.send({
embeds: [
embedMessage("#9dcc37", `❌ I am not connected to a voice channel!`),
],
});
}

try {
if (queue) {
await queue.destroy(true);
await message.channel.send({
embeds: [
embedMessage(
"#9dcc37",
`✅ **${client.user.username}** disconnected from [<#${message.member.voice.channelId}>]`
),
],
});
}
} catch (err) {
client.logger(err.message, "error");
await message.channel.send({
embeds: [
embedMessage(
"#9dcc37",
"Could not disconnect the bot, Maybe you do not have permission ?"
),
],
});
}
},
data: new SlashCommandBuilder()
.setName("disconnect")
.setDescription("disconnects from the channel"),
.setDescription("disconnects the bot from the voice channel"),

async execute(interaction, client) {
await interaction.deferReply();
Expand Down

0 comments on commit 3c97bcf

Please sign in to comment.