Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
77 changes: 47 additions & 30 deletions commands/slash/247.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,42 +5,59 @@ const command = new SlashCommand()
.setName("247")
.setDescription("toggles 24/7")
.setRun(async (client, interaction, options) => {
let player = client.manager.players.get(interaction.guild.id);
if (!interaction.member.voice.channel) {
const joinEmbed = new MessageEmbed()
.setColor(client.config.embedColor)
.setDescription(
"❌ | **You need to join voice channel first before you can use this command.**"
);
return interaction.reply({ embeds: [joinEmbed], ephemeral: true });
}
let channel = await client.getChannel(client, interaction);
if (!channel) return;

let player;
if (client.manager)
player = client.manager.players.get(interaction.guild.id);
else
return interaction.reply({
embeds: [
new MessageEmbed()
.setColor("RED")
.setDescription("Lavalink node is not connected"),
],
});

if (
interaction.guild.me.voice.channel &&
!interaction.guild.me.voice.channel.equals(
interaction.member.voice.channel
)
) {
const sameEmbed = new MessageEmbed()
.setColor(client.config.embedColor)
.setDescription(
"❌ | **You must be in the same voice channel as me.**"
);
return interaction.reply({ embeds: [sameEmbed], ephemeral: true });
}
if (!player) {
return interaction.reply({
embeds: [client.ErrorEmbed("**There's nothing to play 24/7!**")],
embeds: [
new MessageEmbed()
.setColor("RED")
.setDescription("There's nothing to play 24/7."),
],
ephemeral: true,
});
} else if (player.twentyFourSeven) {
player.twentyFourSeven = false;
const embed = client.Embed(`✅ | **24/7 mode is now off.**`);
return interaction.reply({ embeds: [embed] });
}

let twentyFourSevenEmbed = new MessageEmbed().setColor(
client.config.embedColor
);
const twentyFourSeven = player.get("twentyFourSeven");

if (!player.twentyFourSeven || player.twentyFourSeven === false) {
player.set("twentyFourSeven", true);
} else {
player.twentyFourSeven = true;
const embed = client.Embed(`✅ | **24/7 mode is now on.**`);
return interaction.reply({ embeds: [embed] });
player.set("twentyFourSeven", false);
}

twentyFourSevenEmbed.setDescription(
`✅ | **24/7 mode is \`${!player.twentyFourSeven ? "ON" : "OFF"}**\``
);
client.warn(
`Player: ${player.options.guild} | [${colors.blue(
"24/7"
)}] has been [${colors.blue(
!twentyFourSeven ? "ENABLED" : "DISABLED"
)}] in ${
client.guilds.cache.get(player.options.guild)
? client.guilds.cache.get(player.options.guild).name
: "a guild"
}`
);

return interaction.reply({ embeds: [twentyFourSevenEmbed] });
});
module.exports = command;
// check above message, it is a little bit confusing. and erros are not handled. probably should be fixed.
Expand Down
79 changes: 0 additions & 79 deletions commands/slash/autoplay.js

This file was deleted.

58 changes: 58 additions & 0 deletions commands/slash/autoqueue.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
const colors = require("colors");
const { MessageEmbed } = require("discord.js");
const SlashCommand = require("../../lib/SlashCommand");

const command = new SlashCommand()
.setName("autoqueue")
.setDescription("Automatically add songs to the queue (toggle)")
.setRun(async (client, interaction) => {
let channel = await client.getChannel(client, interaction);
if (!channel) return;

let player;
if (client.manager)
player = client.manager.players.get(interaction.guild.id);
else
return interaction.reply({
embeds: [
new MessageEmbed()
.setColor("RED")
.setDescription("Lavalink node is not connected"),
],
});

if (!player) {
return interaction.reply({
embeds: [
new MessageEmbed()
.setColor("RED")
.setDescription("There's nothing playing in the queue"),
],
ephemeral: true,
});
}

let embed = new MessageEmbed().setColor(client.config.embedColor);
const autoQueue = player.get("autoQueue");
player.set("requester", interaction.guild.me);

if (!autoQueue || autoQueue === false) {
player.set("autoQueue", true);
} else {
player.set("autoQueue", false);
}
embed.setDescription(`Auto Queue is \`${!autoQueue ? "ON" : "OFF"}\``);
client.warn(
`Player: ${player.options.guild} | [${colors.blue(
"AUTOQUEUE"
)}] has been [${colors.blue(!autoQueue ? "ENABLED" : "DISABLED")}] in ${
client.guilds.cache.get(player.options.guild)
? client.guilds.cache.get(player.options.guild).name
: "a guild"
}`
);

return interaction.reply({ embeds: [embed] });
});

module.exports = command;
53 changes: 24 additions & 29 deletions commands/slash/clear.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,35 +5,30 @@ const command = new SlashCommand()
.setName("clear")
.setDescription("Clear all tracks from queue")
.setRun(async (client, interaction, options) => {
let player = client.manager.players.get(interaction.guild.id);
if (!player) {
const queueEmbed = new MessageEmbed()
.setColor(client.config.embedColor)
.setDescription("❌ | **Nothing is playing right now...**");
return interaction.reply({ embeds: [queueEmbed], ephemeral: true });
}

if (!interaction.member.voice.channel) {
const joinEmbed = new MessageEmbed()
.setColor(client.config.embedColor)
.setDescription(
"❌ | **You must be in a voice channel to use this command!**"
);
return interaction.reply({ embeds: [joinEmbed], ephemeral: true });
}
let channel = await client.getChannel(client, interaction);
if (!channel) return;

let player;
if (client.manager)
player = client.manager.players.get(interaction.guild.id);
else
return interaction.reply({
embeds: [
new MessageEmbed()
.setColor("RED")
.setDescription("Lavalink node is not connected"),
],
});

if (
interaction.guild.me.voice.channel &&
!interaction.guild.me.voice.channel.equals(
interaction.member.voice.channel
)
) {
const sameEmbed = new MessageEmbed()
.setColor(client.config.embedColor)
.setDescription(
"❌ | **You must be in the same voice channel as me to use this command!**"
);
return interaction.reply({ embeds: [sameEmbed], ephemeral: true });
if (!player) {
return interaction.reply({
embeds: [
new MessageEmbed()
.setColor("RED")
.setDescription("Nothing is playing right now."),
],
ephemeral: true,
});
}

if (!player.queue || !player.queue.length || player.queue.length === 0) {
Expand All @@ -53,4 +48,4 @@ const command = new SlashCommand()
return interaction.reply({ embeds: [clearembed] });
});

module.exports = command;
module.exports = command;
44 changes: 0 additions & 44 deletions commands/slash/disconnect.js

This file was deleted.

Loading