1
0
mirror of https://github.com/musix-org/musix-oss synced 2024-12-22 21:13:18 +00:00

Merge pull request #16 from cwchristerw/changes

Changes
This commit is contained in:
Matte 2019-11-01 10:56:22 +02:00 committed by GitHub
commit ac96a99e1c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
16 changed files with 30 additions and 31 deletions

View File

@ -9,7 +9,7 @@ module.exports = {
if (serverQueue) {
let data = await Promise.resolve(ytdl.getInfo(serverQueue.songs[0].url));
}
if (message.author.id !== client.global.devId) return message.channel.send(':x: You are not allowed to do that!');
if (message.author.id !== client.config.devId) return message.channel.send(':x: You are not allowed to do that!');
const input = message.content.slice(prefix.length + 4);
let output;
try {

View File

@ -4,7 +4,7 @@ module.exports = {
alias: 'fs',
cooldown: 5,
execute(message, args, client, Discord, prefix) {
if (message.author.id !== client.global.devId) return message.channel.send(':x: You are not allowed to do that!')
if (message.author.id !== client.config.devId) return message.channel.send(':x: You are not allowed to do that!')
client.queue.delete(message.guild.id);
message.channel.send('queue deleted')
}

View File

@ -8,7 +8,7 @@ module.exports = {
const permissions = message.channel.permissionsFor(message.author);
const { voiceChannel } = message.member;
if (serverQueue) {
if (message.author.id !== client.global.devId) {
if (message.author.id !== client.config.devId) {
if (voiceChannel !== serverQueue.voiceChannel) return message.channel.send(':x: I\'m sorry but you need to be in the same voice channel as Musix to loop the queue!');
if (client.global.db.guilds[message.guild.id].permissions === true) {
if (client.global.db.guilds[message.guild.id].dj) {

View File

@ -9,7 +9,7 @@ module.exports = {
const { voiceChannel } = message.member;
if (serverQueue && serverQueue.playing === true) {
if (voiceChannel !== serverQueue.voiceChannel) return message.channel.send(':x: I\'m sorry but you need to be in the same voice channel as Musix to pause the music!');
if (message.author.id !== client.global.devId) {
if (message.author.id !== client.config.devId) {
if (client.global.db.guilds[message.guild.id].permissions === true) {
if (client.global.db.guilds[message.guild.id].dj) {
if (!message.member.roles.has(client.global.db.guilds[message.guild.id].djrole)) return message.channel.send(':x: You need the `DJ` role to pause the music!');

View File

@ -19,7 +19,7 @@ module.exports = {
.setAuthor(client.user.username, client.user.displayAvatarURL)
.setColor('#b50002')
const permissions = message.channel.permissionsFor(message.author);
if (message.author.id !== client.global.devId) {
if (message.author.id !== client.config.devId) {
if (client.global.db.guilds[message.guild.id].dj) {
if (!message.member.roles.has(client.global.db.guilds[message.guild.id].djrole)) return message.channel.send(':x: You need the `DJ` role to modify or play the playlist!');
} else if (!permissions.has('MANAGE_GUILD')) return message.channel.send(':x: You need the `MANAGE_SERVER` permission to modify the playlist!');
@ -38,7 +38,7 @@ module.exports = {
.setDescription(error.stack.replace(/at /g, '**at **'))
.setColor('#b50002');
client.fetchUser(client.config.devId).then(user => user.send(embed)).catch(console.error);
client.channels.get('634718645188034560').send(embed);
client.channels.get(client.config.debug_channel).send(embed);
console.log(error);
}
} else {

View File

@ -13,7 +13,7 @@ module.exports = {
if (isNaN(pos)) return message.channel.send(':x: You need to enter a number!');
if (pos === 0) return message.channel.send(':x: You can not remove the currently playing song!');
if (pos > serverQueue.songs.size) return message.channel.send(`:x: There is only ${serverQueue.songs.size} amount of songs in the queue!`);
if (message.author.id !== client.global.devId) {
if (message.author.id !== client.config.devId) {
if (voiceChannel !== serverQueue.voiceChannel) return message.channel.send(':x: I\'m sorry but you need to be in the same voice channel as Musix to remove songs!');
if (client.global.db.guilds[message.guild.id].dj) {
if (serverQueue.songs[pos].author !== message.author) {

View File

@ -8,7 +8,7 @@ module.exports = {
const permissions = message.channel.permissionsFor(message.author);
const { voiceChannel } = message.member;
if (serverQueue && !serverQueue.playing) {
if (message.author.id !== client.global.devId) {
if (message.author.id !== client.config.devId) {
if (voiceChannel !== serverQueue.voiceChannel) return message.channel.send(':x: I\'m sorry but you need to be in the same voice channel as Musix to loop the queue!');
if (client.global.db.guilds[message.guild.id].permissions === true) {
if (client.global.db.guilds[message.guild.id].dj) {

View File

@ -10,7 +10,7 @@ module.exports = {
const { voiceChannel } = message.member;
let data = await Promise.resolve(ytdl.getInfo(serverQueue.songs[0].url));
if (serverQueue) {
if (message.author.id !== client.global.devId) {
if (message.author.id !== client.config.devId) {
return message.channel.send(':x: This command is currently disabled!');
if (voiceChannel !== serverQueue.voiceChannel) return message.channel.send(':x: I\'m sorry but you need to be in the same voice channel as Musix to seek the song!');
if (client.global.db.guilds[message.guild.id].permissions === true) {

View File

@ -32,7 +32,7 @@ module.exports = {
.setDescription(error.stack.replace(/at /g, '**at **'))
.setColor('#b50002');
client.fetchUser(client.config.devId).then(user => user.send(embed)).catch(console.error);
client.channels.get('634718645188034560').send(embed);
client.channels.get(client.config.debug_channel).send(embed);
}
} else {
return message.channel.send(embed);

View File

@ -2,7 +2,7 @@ module.exports = {
name: 'guildcreate',
async execute(client, guild) {
client.db.collection('guilds').doc(guild.id).set({
prefix: '>',
prefix: client.config.prefix,
defaultVolume: 5,
permissions: false,
premium: false,
@ -11,7 +11,7 @@ module.exports = {
startPlaying: true
});
client.global.db.guilds[guild.id] = {
prefix: ">",
prefix: client.config.prefix,
defaultVolume: 5,
permissions: false,
premium: false,

View File

@ -2,7 +2,7 @@ module.exports = {
name: 'message',
async execute(client, message, Discord) {
if (message.author.bot || !message.guild) return;
if (message.content === '->reset' && message.author.id === client.global.devId) {
if (message.content === '->reset' && message.author.id === client.config.devId) {
client.guilds.forEach(guild => {
client.global.db.guilds[guild.id] = {
prefix: client.config.prefix,
@ -15,7 +15,7 @@ module.exports = {
return message.channel.send(':white_check_mark: Reset all guild settings for __all__ guilds!');
});
return message.channel.send(':white_check_mark: Reset all guild settings!')
} else if (message.content === '->resetguildsettings' && message.author.id === client.global.devId) {
} else if (message.content === '->resetguildsettings' && message.author.id === client.config.devId) {
client.global.db.guilds[message.guild.id] = {
prefix: client.config.prefix,
defaultVolume: 5,
@ -30,7 +30,7 @@ module.exports = {
const args = message.content.slice(prefix.length).split(' ');
let commandName;
if (message.mentions.users.first()) {
if (message.mentions.users.first().id === client.config.botId) {
if (message.mentions.users.first().id === client.user.id) {
if (!args[1]) return;
if (args[1] === 'prefix') return message.channel.send(`My prefix here is: \`${prefix}\`.`);
commandName = args[1].toLowerCase();

View File

@ -10,7 +10,7 @@ module.exports = {
client.global.db.playlists[guildData.id] = guildData.d;
});
console.log('- DB Set -');
client.user.setActivity(`@musix help | 🎶`, { type: 'LISTENING' });
client.user.setActivity(`@${client.user.username} help | 🎶`, { type: 'LISTENING' });
client.user.setStatus('dnd');
dbl.postStats(client.guilds.size);
console.log('- Activated -');
@ -18,7 +18,7 @@ module.exports = {
client.guilds.forEach(guild => {
users += guild.memberCount;
})
let status = [`${users} users on ${client.guilds.size} guilds!`, '@musix help | 🎶'];
let status = [`${users} users on ${client.guilds.size} guilds!`, `@${client.user.username} help | 🎶`];
let i = 0;
setInterval(() => {
if (i == status.length) {

View File

@ -9,7 +9,7 @@ module.exports = function (message, args, client, Discord, prefix, command) {
.setTitle(`Musix ${error.toString()}`)
.setDescription(error.stack.replace(/at /g, '**at **'))
.setColor('#b50002');
client.fetchUser(client.global.devId).then(user => user.send(embed)).catch(console.error);
client.channels.get('634718645188034560').send(embed);
client.fetchUser(client.config.devId).then(user => user.send(embed)).catch(console.error);
client.channels.get(client.config.debug_channel).send(embed);
}
};

View File

@ -32,7 +32,7 @@ module.exports = async function (video, message, voiceChannel, client, playlist
client.funcs.play(message.guild, construct.songs[0], client, message, 0, true);
} catch (error) {
client.queue.delete(message.guild.id);
client.channels.get('634718645188034560').send("Error with connecting to voice channel: " + error);
client.channels.get(client.config.debug_channel).send("Error with connecting to voice channel: " + error);
return message.channel.send(`:x: An error occured: ${error}`);
}
} else {

View File

@ -1,7 +1,7 @@
const Discord = require('discord.js');
const client = new Discord.Client({ disableEveryone: true, disabledEvents: ['TYPING_START'] });
const DBL = require("dblapi.js");
const dbl = new DBL(process.env.DBLTOKEN, client);
const dbl = new DBL(process.env.DBL_TOKEN, client);
const fs = require('fs');
const dotenv = require('dotenv');
const firebase = require('firebase/app');
@ -38,11 +38,11 @@ client.funcs.dbget = require('./funcs/dbget.js');
client.funcs.exe = require('./funcs/exe.js');
client.config = {
token: process.env.TOKEN,
apikey: process.env.API_KEY,
botId: "607266889537945605",
devId: "360363051792203779",
prefix: '>',
token: process.env.DISCORD_TOKEN,
debug_channel: process.env.DISCORD_DEBUG_CHANNEL_ID,
apikey: process.env.YOUTUBE_KEY,
devId: process.env.DISCORD_DEV_UID,
prefix: process.env.PREFIX
};
const commandFiles = fs.readdirSync('./commands/').filter(f => f.endsWith('.js'));

View File

@ -18,7 +18,6 @@
"dblapi.js": "^2.3.0",
"discord.js": "^11.5.1",
"dotenv": "^8.2.0",
"ffmpeg-binaries": "^4.0.0",
"firebase": "^6.6.2",
"firebase-admin": "^8.6.1",
"fs": "0.0.1-security",