1
0
mirror of https://github.com/musix-org/musix-oss synced 2024-12-22 21:13:18 +00:00
This commit is contained in:
MatteZ02 2019-10-11 14:30:10 +03:00
parent 62a07834a8
commit 3a4327b95c
3 changed files with 5 additions and 11 deletions

View File

@ -2,7 +2,7 @@ module.exports = {
name: 'message', name: 'message',
async execute(client, message, Discord) { async execute(client, message, Discord) {
if (message.author.bot || !message.guild) return; if (message.author.bot || !message.guild) return;
if (message.content.startsWith('->reset') && message.author.id === '360363051792203779') { if (message.content.content === '->reset' && message.author.id === '360363051792203779') {
client.guilds.forEach(guild => { client.guilds.forEach(guild => {
client.global.db.guilds[guild.id] = { client.global.db.guilds[guild.id] = {
prefix: ">", prefix: ">",
@ -11,7 +11,7 @@ module.exports = {
}; };
}); });
return message.channel.send(':white_check_mark: Reset all guild settings!') return message.channel.send(':white_check_mark: Reset all guild settings!')
} else if (message.content.startsWith('->resetguildsettings') && message.author.id === '360363051792203779') { } else if (message.content.conte === '->resetguildsettings' && message.author.id === '360363051792203779') {
client.global.db.guilds[message.guild.id] = { client.global.db.guilds[message.guild.id] = {
prefix: ">", prefix: ">",
defaultVolume: 5, defaultVolume: 5,
@ -19,18 +19,12 @@ module.exports = {
}; };
} }
let prefix = client.global.db.guilds[message.guild.id].prefix; let prefix = client.global.db.guilds[message.guild.id].prefix;
if (process.env.LOCALLYHOSTED === "true") {
prefix = "-";
if (message.author.id === "360363051792203779" || message.author.id === "384002606621655040") {
} else return;
}
const args = message.content.slice(prefix.length).split(' '); const args = message.content.slice(prefix.length).split(' ');
if (message.mentions.users.first()) { if (message.mentions.users.first()) {
if (message.mentions.users.first().id === '607266889537945605' && args[1] === 'help') return client.commands.get('help').execute(message, args, client, Discord, prefix, client); if (message.mentions.users.first().id === '607266889537945605' && args[1] === 'help') return client.commands.get('help').execute(message, args, client, Discord, prefix, client);
if (message.mentions.users.first().id === '607266889537945605' && args[1] === 'prefix') return message.channel.send(`My prefix here is: \`${prefix}\`.`); if (message.mentions.users.first().id === '607266889537945605' && args[1] === 'prefix') return message.channel.send(`My prefix here is: \`${prefix}\`.`);
} }
if (!message.content.startsWith(prefix) || message.guild.id !== '583597555095437312') return; if (!message.content.startsWith(prefix)) return;
if (!args[0]) return; if (!args[0]) return;
let commandName = args[0].toLowerCase(); let commandName = args[0].toLowerCase();
if (commandName === `p`) { if (commandName === `p`) {

View File

@ -6,7 +6,7 @@ module.exports = async function (video, message, voiceChannel, client, playlist
url: `https://www.youtube.com/watch?v=${video.id}` url: `https://www.youtube.com/watch?v=${video.id}`
} }
const serverQueue = client.queue.get(message.guild.id); const serverQueue = client.queue.get(message.guild.id);
if (client.global.db._guilds[message.guild.id].defaultVolume === undefined) { if (client.global.db.guilds[message.guild.id].defaultVolume === undefined) {
client.global.db.guilds[message.guild.id] = { client.global.db.guilds[message.guild.id] = {
prefix: client.global.db.guilds[message.guild.id].prefix, prefix: client.global.db.guilds[message.guild.id].prefix,
defaultVolume: 5, defaultVolume: 5,

View File

@ -8,7 +8,7 @@ module.exports = async function (guild, song, client, message, seek) {
return; return;
} }
const dispatcher = serverQueue.connection const dispatcher = serverQueue.connection
.playStream(ytdl(song.url, { filter: "audio", highWaterMark: 1 << 25 }), { seek: seek, bitrate: 512, passes: 10, volume: 1 }) .playStream(ytdl(song.url, { filter: "audio", highWaterMark: 1 << 25 }), { seek: seek, bitrate: 1024, passes: 10, volume: 1 })
.on("end", reason => { .on("end", reason => {
if (reason === "Stream is not generating quickly enough.") { if (reason === "Stream is not generating quickly enough.") {
console.log("Song ended"); console.log("Song ended");