Skip to content

Commit

Permalink
Development (SudhanPlayz#173)
Browse files Browse the repository at this point in the history
* 24/7 Stay in vc stuff

* edits and fixes (SudhanPlayz#168)

* add: YouTube Tutorial at readme

* Master branch to development (SudhanPlayz#171)

* Latest commits to fix stuff (SudhanPlayz#169)

* 24/7 Stay in vc stuff

* edits and fixes (SudhanPlayz#168)

Co-authored-by: Joseph <[email protected]>

* ;-; (SudhanPlayz#170)

* 24/7 Stay in vc stuff

* edits and fixes (SudhanPlayz#168)

* add: YouTube Tutorial at readme

Co-authored-by: Joseph <[email protected]>

Co-authored-by: Joseph <[email protected]>

* temporarily removed line (SudhanPlayz#172)

* edits and fixes

* temporarily removed line

Co-authored-by: Joseph <[email protected]>
  • Loading branch information
SudhanPlayz and joeyk710 authored May 3, 2021
1 parent ed1d348 commit e770157
Show file tree
Hide file tree
Showing 6 changed files with 112 additions and 114 deletions.
108 changes: 54 additions & 54 deletions commands/pause.js
Original file line number Diff line number Diff line change
@@ -1,54 +1,54 @@
const { MessageEmbed } = require("discord.js");
const { TrackUtils } = require("erela.js");

module.exports = {
name: "pause",
description: "To pause the current song",
usage: "",
permissions: {
channel: ["VIEW_CHANNEL", "SEND_MESSAGES", "EMBED_LINKS"],
member: [],
},
aliases: [],
/**
*
* @param {import("../structures/DiscordMusicBot")} client
* @param {import("discord.js").Message} message
* @param {string[]} args
* @param {*} param3
*/
run: async (client, message, args, { GuildDB }) => {
let player = await client.Manager.get(message.guild.id);
if (!player) return client.sendTime(message.channel, "❌ | **Nothing is playing right now...**");
if (!message.member.voice.channel) return client.sendTime(message.channel, "❌ | **You must be in a voice channel to play something!**");
else if(message.guild.me.voice && message.guild.me.voice.channel.id !== message.member.voice.channel.id)return client.sendTime(message.channel, `❌ | **You must be in ${guild.me.voice.channel} to use this command.**`);
if (player.paused) return message.channel.send("Music is already paused!");
player.pause(true);
let embed = new MessageEmbed().setAuthor(`Paused!`, client.config.IconURL).setColor("RANDOM").setDescription(`Type \`${GuildDB.prefix}resume\` to play!`);
await message.channel.send(embed);
await message.react("✅");
},

SlashCommand: {
/**
*
* @param {import("../structures/DiscordMusicBot")} client
* @param {import("discord.js").Message} message
* @param {string[]} args
* @param {*} param3
*/
run: async (client, interaction, args, { GuildDB }) => {
const guild = client.guilds.cache.get(interaction.guild_id);
const member = guild.members.cache.get(interaction.member.user.id);

if (!member.voice.channel) return client.sendTime(interaction, "❌ | **You must be in a voice channel to use this command.**");
if (guild.me.voice.channel && !guild.me.voice.channel.equals(member.voice.channel)) return client.sendTime(interaction, `❌ | **You must be in ${guild.me.voice.channel} to use this command.**`);

let player = await client.Manager.get(interaction.guild_id);
if (!player) return client.sendTime(interaction, "❌ | **Nothing is playing right now...**");
if (player.paused) return client.sendTime(interaction, "Music is already paused!");
player.pause(true);
client.sendTime(interaction, "**⏸ Paused!**");
},
},
};
const { MessageEmbed } = require("discord.js");
const { TrackUtils } = require("erela.js");

module.exports = {
name: "pause",
description: "To pause the current song",
usage: "",
permissions: {
channel: ["VIEW_CHANNEL", "SEND_MESSAGES", "EMBED_LINKS"],
member: [],
},
aliases: [],
/**
*
* @param {import("../structures/DiscordMusicBot")} client
* @param {import("discord.js").Message} message
* @param {string[]} args
* @param {*} param3
*/
run: async (client, message, args, { GuildDB }) => {
let player = await client.Manager.get(message.guild.id);
if (!player) return client.sendTime(message.channel, "❌ | **Nothing is playing right now...**");
if (!message.member.voice.channel) return client.sendTime(message.channel, "❌ | **You must be in a voice channel to play something!**");
//else if(message.guild.me.voice && message.guild.me.voice.channel.id !== message.member.voice.channel.id)return client.sendTime(message.channel, `❌ | **You must be in ${guild.me.voice.channel} to use this command.**`);
if (player.paused) return message.channel.send("Music is already paused!");
player.pause(true);
let embed = new MessageEmbed().setAuthor(`Paused!`, client.config.IconURL).setColor("RANDOM").setDescription(`Type \`${GuildDB.prefix}resume\` to play!`);
await message.channel.send(embed);
await message.react("✅");
},

SlashCommand: {
/**
*
* @param {import("../structures/DiscordMusicBot")} client
* @param {import("discord.js").Message} message
* @param {string[]} args
* @param {*} param3
*/
run: async (client, interaction, args, { GuildDB }) => {
const guild = client.guilds.cache.get(interaction.guild_id);
const member = guild.members.cache.get(interaction.member.user.id);

if (!member.voice.channel) return client.sendTime(interaction, "❌ | **You must be in a voice channel to use this command.**");
if (guild.me.voice.channel && !guild.me.voice.channel.equals(member.voice.channel)) return client.sendTime(interaction, `❌ | **You must be in ${guild.me.voice.channel} to use this command.**`);

let player = await client.Manager.get(interaction.guild_id);
if (!player) return client.sendTime(interaction, "❌ | **Nothing is playing right now...**");
if (player.paused) return client.sendTime(interaction, "Music is already paused!");
player.pause(true);
client.sendTime(interaction, "**⏸ Paused!**");
},
},
};
3 changes: 1 addition & 2 deletions commands/play.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@ module.exports = {
*/
run: async (client, message, args, { GuildDB }) => {
if (!message.member.voice.channel) return client.sendTime(message.channel, "❌ | **You must be in a voice channel to play something!**");
else if(message.guild.me.voice && message.guild.me.voice.channel.id !== message.member.voice.channel.id)return client.sendTime(message.channel, `❌ | **You must be in ${guild.me.voice.channel} to use this command.**`);

//else if(message.guild.me.voice && message.guild.me.voice.channel.id !== message.member.voice.channel.id)return client.sendTime(message.channel, "❌ | **You must be in same voice channel as the bot is in to play something!**");
let SearchString = args.join(" ");
if (!SearchString) return client.sendTime(message.channel, `**Usage - **\`${GuildDB.prefix}play [Song Name|Song URL]\``);

Expand Down
3 changes: 1 addition & 2 deletions commands/remove.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,8 @@ const { TrackUtils } = require("erela.js");
const song = player.queue.slice(args[0] - 1, 1);
if (!player) return client.sendTime(message.channel, "❌ | **Nothing is playing right now...**");
if (!message.member.voice.channel) return client.sendTime(message.channel, "❌ | **You must be in a voice channel to play something!**");
else if(message.guild.me.voice && message.guild.me.voice.channel.id !== message.member.voice.channel.id)return client.sendTime(message.channel, `❌ | **You must be in ${guild.me.voice.channel} to use this command.**`);
//else if(message.guild.me.voice && message.guild.me.voice.channel.id !== message.member.voice.channel.id)return client.sendTime(message.channel, `❌ | **You must be in ${guild.me.voice.channel} to use this command.**`);


if (!player.queue || !player.queue.length || player.queue.length === 0)
return message.channel.send("There is nothing in the queue to remove");
let rm = new MessageEmbed()
Expand Down
106 changes: 53 additions & 53 deletions commands/resume.js
Original file line number Diff line number Diff line change
@@ -1,53 +1,53 @@
const { MessageEmbed } = require("discord.js");
const { TrackUtils } = require("erela.js");

module.exports = {
name: "resume",
description: "To resume the current song",
usage: "",
permissions: {
channel: ["VIEW_CHANNEL", "SEND_MESSAGES", "EMBED_LINKS"],
member: [],
},
aliases: [],
/**
*
* @param {import("../structures/DiscordMusicBot")} client
* @param {import("discord.js").Message} message
* @param {string[]} args
* @param {*} param3
*/
run: async (client, message, args, { GuildDB }) => {
let player = await client.Manager.get(message.guild.id);
if (!player) return client.sendTime(message.channel, "❌ | **Nothing is playing right now...**");
if (!message.member.voice.channel) return client.sendTime(message.channel, "❌ | **You must be in a voice channel to play something!**");
else if(message.guild.me.voice && message.guild.me.voice.channel.id !== message.member.voice.channel.id)return client.sendTime(message.channel, `❌ | **You must be in ${guild.me.voice.channel} to use this command.**`);
if (player.playing) return message.channel.send("Music is already resumed!");
player.pause(false);
await message.react("✅");
},

SlashCommand: {
/**
*
* @param {import("../structures/DiscordMusicBot")} client
* @param {import("discord.js").Message} message
* @param {string[]} args
* @param {*} param3
*/
run: async (client, interaction, args, { GuildDB }) => {
const guild = client.guilds.cache.get(interaction.guild_id);
const member = guild.members.cache.get(interaction.member.user.id);

if (!member.voice.channel) return client.sendTime(interaction, "❌ | **You must be in a voice channel to use this command.**");
if (guild.me.voice.channel && !guild.me.voice.channel.equals(member.voice.channel)) return client.sendTime(interaction, `❌ | **You must be in ${guild.me.voice.channel} to use this command.**`);

let player = await client.Manager.get(interaction.guild_id);
if (!player) return client.sendTime(inter, "❌ | **Nothing is playing right now...**");
if (player.playing) return client.sendTime(interaction, "Music is already resumed!");
player.pause(false);
client.sendTime(interaction, "**⏯ Resumed!**");
},
},
};
const { MessageEmbed } = require("discord.js");
const { TrackUtils } = require("erela.js");

module.exports = {
name: "resume",
description: "To resume the current song",
usage: "",
permissions: {
channel: ["VIEW_CHANNEL", "SEND_MESSAGES", "EMBED_LINKS"],
member: [],
},
aliases: [],
/**
*
* @param {import("../structures/DiscordMusicBot")} client
* @param {import("discord.js").Message} message
* @param {string[]} args
* @param {*} param3
*/
run: async (client, message, args, { GuildDB }) => {
let player = await client.Manager.get(message.guild.id);
if (!player) return client.sendTime(message.channel, "❌ | **Nothing is playing right now...**");
if (!message.member.voice.channel) return client.sendTime(message.channel, "❌ | **You must be in a voice channel to play something!**");
//else if(message.guild.me.voice && message.guild.me.voice.channel.id !== message.member.voice.channel.id)return client.sendTime(message.channel, `❌ | **You must be in ${guild.me.voice.channel} to use this command.**`);

if (player.playing) return message.channel.send("Music is already resumed!");
player.pause(false);
await message.react("✅");
},

SlashCommand: {
/**
*
* @param {import("../structures/DiscordMusicBot")} client
* @param {import("discord.js").Message} message
* @param {string[]} args
* @param {*} param3
*/
run: async (client, interaction, args, { GuildDB }) => {
const guild = client.guilds.cache.get(interaction.guild_id);
const member = guild.members.cache.get(interaction.member.user.id);

if (!member.voice.channel) return client.sendTime(interaction, "❌ | **You must be in a voice channel to use this command.**");
if (guild.me.voice.channel && !guild.me.voice.channel.equals(member.voice.channel)) return client.sendTime(interaction, `❌ | **You must be in ${guild.me.voice.channel} to use this command.**`);

let player = await client.Manager.get(interaction.guild_id);
if (!player) return client.sendTime(inter, "❌ | **Nothing is playing right now...**");
if (player.playing) return client.sendTime(interaction, "Music is already resumed!");
player.pause(false);
client.sendTime(interaction, "**⏯ Resumed!**");
},
},
};
2 changes: 1 addition & 1 deletion commands/search.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ module.exports = {
*/
run: async (client, message, args, { GuildDB }) => {
if (!message.member.voice.channel) return client.sendTime(message.channel, "❌ | **You must be in a voice channel to play something!**");
else if(message.guild.me.voice && message.guild.me.voice.channel.id !== message.member.voice.channel.id)return client.sendTime(message.channel, `❌ | **You must be in ${guild.me.voice.channel} to use this command.**`);
//else if(message.guild.me.voice && message.guild.me.voice.channel.id !== message.member.voice.channel.id)return client.sendTime(message.channel, "❌ | **You must be in same voice channel as the bot is in to play something!**");

let SearchString = args.join(" ");
if (!SearchString) return client.sendTime(message.channel, `**Usage - **\`${GuildDB.prefix}search [Song Name|SongURL]\``);
Expand Down
4 changes: 2 additions & 2 deletions commands/skipto.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ module.exports = {

if (!player) return client.sendTime(message.channel, "❌ | **Nothing is playing right now...**");
if (!message.member.voice.channel) return client.sendTime(message.channel, "❌ | **You must be in a voice channel to play something!**");
else if(message.guild.me.voice && message.guild.me.voice.channel.id !== message.member.voice.channel.id)return client.sendTime(message.channel, `❌ | **You must be in ${guild.me.voice.channel} to use this command.**`);

//else if(message.guild.me.voice && message.guild.me.voice.channel.id !== message.member.voice.channel.id)return client.sendTime(message.channel, `❌ | **You must be in ${guild.me.voice.channel} to use this command.**`);
try {
if (!args[0])
return message.channel.send(new MessageEmbed()
Expand Down

0 comments on commit e770157

Please sign in to comment.