1
0
mirror of https://github.com/musix-org/musix-oss synced 2024-11-14 03:30:18 +00:00

Chore update 3.8

This commit is contained in:
MatteZ02 2020-07-04 22:17:20 +03:00
parent ba3d17bb2a
commit 5a77443df6
11 changed files with 66 additions and 74 deletions

View File

@ -1,6 +1,6 @@
{ {
"name": "musix", "name": "musix",
"version": "3.7.2", "version": "3.8.0",
"description": "V3 for Musix the discord music bot", "description": "V3 for Musix the discord music bot",
"main": "./index.js", "main": "./index.js",
"scripts": { "scripts": {

View File

@ -12,6 +12,5 @@ module.exports = {
.setURL(client.config.invite) .setURL(client.config.invite)
.setColor(client.config.embedColor) .setColor(client.config.embedColor)
msg.channel.send(embed); msg.channel.send(embed);
msg.channel.send(client.messages.joinSupport + client.config.supportServer);
} }
}; };

View File

@ -49,6 +49,7 @@ module.exports = {
const playlistId = url.split("/playlist/")[1].split("?")[0]; const playlistId = url.split("/playlist/")[1].split("?")[0];
spotify.getPlaylist(playlistId).then( spotify.getPlaylist(playlistId).then(
async function (data) { async function (data) {
console.log(data.body)
searchPlaylist(data, client, msg, voiceChannel); searchPlaylist(data, client, msg, voiceChannel);
}, },
function (err) { function (err) {
@ -115,8 +116,7 @@ module.exports = {
return lmsg.edit(message); return lmsg.edit(message);
} else { } else {
ytsr( ytsr(
searchString, searchString, {
{
limit: 5, limit: 5,
}, },
function (err, res) { function (err, res) {
@ -154,24 +154,21 @@ async function searchPlaylist(data, client, msg, voiceChannel) {
const track = await data.body.tracks.items[i].track; const track = await data.body.tracks.items[i].track;
await client.funcs.sleep(250); await client.funcs.sleep(250);
ytsr( ytsr(
`${track.artists[0].name} ${track.name} audio`, `${track.artists[0].name} ${track.name} audio`, {
{
limit: 5, limit: 5,
}, },
async function (err, res) { async function (err, res) {
if (err) return console.log(err); if (err) return console.log(err);
if (!res.items[0]) { if (!res.items[0]) {
ytsr( ytsr(
`${track.artists[0].name} ${track.name} lyrics`, `${track.artists[0].name} ${track.name} lyrics`, {
{
limit: 5, limit: 5,
}, },
async function (err, res) { async function (err, res) {
if (err) return console.log(err); if (err) return console.log(err);
if (!res.items[0]) { if (!res.items[0]) {
ytsr( ytsr(
`${track.artists[0].name} ${track.name}`, `${track.artists[0].name} ${track.name}`, {
{
limit: 5, limit: 5,
}, },
async function (err, res) { async function (err, res) {
@ -244,24 +241,21 @@ async function searchAlbum(data, client, msg, voiceChannel) {
const track = await data.body.items[i]; const track = await data.body.items[i];
await client.funcs.sleep(250); await client.funcs.sleep(250);
ytsr( ytsr(
`${track.artists[0].name} ${track.name} audio`, `${track.artists[0].name} ${track.name} audio`, {
{
limit: 5, limit: 5,
}, },
async function (err, res) { async function (err, res) {
if (err) return console.log(err); if (err) return console.log(err);
if (!res.items[0]) { if (!res.items[0]) {
ytsr( ytsr(
`${track.artists[0].name} ${track.name} lyrics`, `${track.artists[0].name} ${track.name} lyrics`, {
{
limit: 5, limit: 5,
}, },
async function (err, res) { async function (err, res) {
if (err) return console.log(err); if (err) return console.log(err);
if (!res.items[0]) { if (!res.items[0]) {
ytsr( ytsr(
`${track.artists[0].name} ${track.name}`, `${track.artists[0].name} ${track.name}`, {
{
limit: 5, limit: 5,
}, },
async function (err, res) { async function (err, res) {
@ -337,24 +331,21 @@ async function searchSong(data, client, msg, voiceChannel) {
const track = await data.body.tracks.items[i].track; const track = await data.body.tracks.items[i].track;
await client.funcs.sleep(250); await client.funcs.sleep(250);
ytsr( ytsr(
`${track.artists[0].name} ${track.name} audio`, `${track.artists[0].name} ${track.name} audio`, {
{
limit: 5, limit: 5,
}, },
async function (err, res) { async function (err, res) {
if (err) return console.log(err); if (err) return console.log(err);
if (!res.items[0]) { if (!res.items[0]) {
ytsr( ytsr(
`${track.artists[0].name} ${track.name} lyrics`, `${track.artists[0].name} ${track.name} lyrics`, {
{
limit: 5, limit: 5,
}, },
async function (err, res) { async function (err, res) {
if (err) return console.log(err); if (err) return console.log(err);
if (!res.items[0]) { if (!res.items[0]) {
ytsr( ytsr(
`${track.artists[0].name} ${track.name}`, `${track.artists[0].name} ${track.name}`, {
{
limit: 5, limit: 5,
}, },
async function (err, res) { async function (err, res) {

View File

@ -11,7 +11,7 @@ module.exports = {
if (client.funcs.check(client, msg, command)) { if (client.funcs.check(client, msg, command)) {
if (!queue.paused) return msg.channel.send(client.messages.notPaused); if (!queue.paused) return msg.channel.send(client.messages.notPaused);
queue.paused = false; queue.paused = false;
queue.connection.dispatcher.resume(true); queue.connection.dispatcher.resume();
return msg.channel.send(client.messages.resumed); return msg.channel.send(client.messages.resumed);
} }
} }

View File

@ -15,7 +15,7 @@ module.exports = {
queue.exists = false; queue.exists = false;
} }
if (msg.guild.voice.channel) msg.guild.voice.channel.leave(); if (msg.guild.voice.channel) msg.guild.voice.channel.leave();
client.queue.delete(guild.id); client.queue.delete(msg.guild.id);
return msg.channel.send(client.messages.stop); return msg.channel.send(client.messages.stop);
} }
queue.songs = []; queue.songs = [];

View File

@ -6,6 +6,9 @@ module.exports = function (client) {
require(`./msg.js`).execute(client, msg, Discord); require(`./msg.js`).execute(client, msg, Discord);
}).on('guildCreate', (guild) => { }).on('guildCreate', (guild) => {
require(`./guildCreate.js`).execute(client, guild); require(`./guildCreate.js`).execute(client, guild);
})
.on('guildDelete', (guild) => {
require(`./guildDelete.js`).execute(client, guild);
}).on('voiceStateUpdate', (oldState, newState) => { }).on('voiceStateUpdate', (oldState, newState) => {
require(`./voiceStateUpdate.js`).execute(client, oldState, newState); require(`./voiceStateUpdate.js`).execute(client, oldState, newState);
}).on('error', (error) => { }).on('error', (error) => {

View File

@ -53,6 +53,7 @@ function findSimilar(client, queue, prevSongs, guild) {
youtubeAPIKey: client.config.api_key, youtubeAPIKey: client.config.api_key,
}, },
async function (err, songs) { async function (err, songs) {
console.log(songs)
if (err) { if (err) {
console.log(err.message); console.log(err.message);
return queue.textChannel.send(client.messages.error); return queue.textChannel.send(client.messages.error);

View File

@ -29,7 +29,6 @@ module.exports = class extends Client {
credential: admin.credential.cert(serviceAccount), credential: admin.credential.cert(serviceAccount),
}); });
this.commands = new Collection(); this.commands = new Collection();
this.commandAliases = new Collection();
this.settingCmd = new Collection(); this.settingCmd = new Collection();
this.queue = new Map(); this.queue = new Map();
this.funcs = {}; this.funcs = {};
@ -56,7 +55,6 @@ module.exports = class extends Client {
const command = require(`../commands/${file}`); const command = require(`../commands/${file}`);
command.uses = 0; command.uses = 0;
this.commands.set(command.name, command); this.commands.set(command.name, command);
this.commandAliases.set(command.alias, command);
} }
const settingFiles = fs const settingFiles = fs
.readdirSync(path.join(path.dirname(__dirname), "commands/settings")) .readdirSync(path.join(path.dirname(__dirname), "commands/settings"))

View File

@ -22,8 +22,8 @@ module.exports = {
secondary_test_channel: "570531724002328577", secondary_test_channel: "570531724002328577",
devId: "360363051792203779", devId: "360363051792203779",
embedColor: "#b50002", embedColor: "#b50002",
invite: "https://discordapp.com/oauth2/authorize?client_id=607266889537945605&permissions=3427328&scope=bot", invite: "https://musix-web.herokuapp.com/releases",
supportServer: "https://discord.gg/rvHuJtB", supportServer: "https://musix-web.herokuapp.com/discord",
devMode: false, devMode: false,
api: false, api: false,
saveDB: true, saveDB: true,
@ -40,7 +40,7 @@ module.exports = {
djrole: null, djrole: null,
startPlaying: true, startPlaying: true,
bass: 1, bass: 1,
autoPlay: false, autoPlay: true,
}; };
module.exports.streamConfig = { module.exports.streamConfig = {

View File

@ -69,7 +69,7 @@ module.exports = {
idOrMentionChannel: emojis.redx + "Please provide a channel id or mention a channel!", idOrMentionChannel: emojis.redx + "Please provide a channel id or mention a channel!",
invalidGuild: emojis.redx + "Invalid guild id!", invalidGuild: emojis.redx + "Invalid guild id!",
invalidSpotifyUrl: emojis.redx + "That url cannot be played! If you believe this is a mistake please contact support!", invalidSpotifyUrl: emojis.redx + "That url cannot be played! If you believe this is a mistake please contact support!",
inviteTitle: "Invite Musix to your Discord server!", inviteTitle: "Invite a release of Musix to your discord server!",
joined: emojis.green_check_mark + "Joined", joined: emojis.green_check_mark + "Joined",
joinSupport: "Join the musix support server: ", joinSupport: "Join the musix support server: ",
keySet: emojis.green_check_mark + "Key set!", keySet: emojis.green_check_mark + "Key set!",

View File

@ -3,7 +3,7 @@ module.exports = function (msg, args, client, Discord, command) {
if (!permissions.has("EMBED_LINKS")) if (!permissions.has("EMBED_LINKS"))
return msg.channel.send(client.messages.noPermsEmbed); return msg.channel.send(client.messages.noPermsEmbed);
if (!permissions.has("USE_EXTERNAL_EMOJIS")) if (!permissions.has("USE_EXTERNAL_EMOJIS"))
return msg.channel.send(client.noPermsUseExternalEmojis); return msg.channel.send(client.messages.noPermsUseExternalEmojis);
if ( if (
command.category === "music" && command.category === "music" &&
client.global.db.guilds[msg.guild.id].blacklist.includes(msg.channel.id) client.global.db.guilds[msg.guild.id].blacklist.includes(msg.channel.id)