mirror of
https://github.com/musix-org/musix-oss
synced 2024-12-22 18:03:17 +00:00
Debug channel conflict resolved
This commit is contained in:
parent
a06f616a98
commit
a47ffd1012
5
index.js
5
index.js
@ -1,6 +1,7 @@
|
||||
const config = require("./src/struct/config/config.ts");
|
||||
|
||||
if (config.devMode) {
|
||||
console.log('- dev mode- ');
|
||||
config.token = config.devToken;
|
||||
config.shards = 1;
|
||||
}
|
||||
@ -8,6 +9,6 @@ if (config.devMode) {
|
||||
const { ShardingManager } = require('discord.js');
|
||||
const manager = new ShardingManager('./src/bot.ts', { token: config.token, respawn: config.respawn, totalShards: config.shards });
|
||||
|
||||
console.log('Launching shards...');
|
||||
console.log('- Launching shards -');
|
||||
manager.spawn(config.shards, config.shardDelay, config.shardTimeout);
|
||||
manager.on('shardCreate', shard => console.log(`Launched shard ${shard.id}`));
|
||||
manager.on('shardCreate', shard => console.log(`- Launched shard ${shard.id} -`));
|
824
package-lock.json
generated
824
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
11
package.json
11
package.json
@ -19,11 +19,11 @@
|
||||
"dependencies": {
|
||||
"@discordjs/opus": "^0.1.0",
|
||||
"dblapi.js": "^2.4.0",
|
||||
"discord.js": "^12.0.2",
|
||||
"discord.js": "^12.1.1",
|
||||
"dotenv": "^8.2.0",
|
||||
"ffmpeg": "0.0.4",
|
||||
"firebase": "^7.10.0",
|
||||
"firebase-admin": "^8.9.2",
|
||||
"firebase": "^7.13.1",
|
||||
"firebase-admin": "^8.10.0",
|
||||
"fs": "0.0.1-security",
|
||||
"he": "^1.2.0",
|
||||
"ms": "^2.1.2",
|
||||
@ -32,7 +32,6 @@
|
||||
"simple-youtube-api": "^5.2.1",
|
||||
"video-thumbnail-url": "^1.0.1",
|
||||
"yt-search": "^1.1.2",
|
||||
"ytdl-core": "^1.0.9",
|
||||
"ytdl-core-discord": "^1.1.0"
|
||||
"ytdl-core": "^1.0.9"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -17,7 +17,7 @@ module.exports = {
|
||||
msg.channel.send(`${client.messages.joined} ${voiceChannel.name}!`);
|
||||
} catch (error) {
|
||||
client.queue.delete(msg.guild.id);
|
||||
client.channels.get(client.config.debug_channel).send(client.messages.errorConnecting + error);
|
||||
client.users.cache.get(client.config.devId).send(client.messages.errorConnecting + error);
|
||||
return msg.channel.send(client.messages.error);
|
||||
}
|
||||
}
|
||||
|
@ -16,7 +16,7 @@ module.exports = {
|
||||
msg.channel.send(message);
|
||||
} else {
|
||||
queue.songLooping = false;
|
||||
msg.channel.send(message);
|
||||
msg.channel.send(client.messages.noLoopingSong);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -11,7 +11,6 @@ module.exports = {
|
||||
category: 'music',
|
||||
async execute(msg, args, client, Discord, command) {
|
||||
const searchString = args.slice(1).join(" ");
|
||||
const url = args[1] ? args[1].replace(/<(.+)>/g, "$1") : "";
|
||||
const queue = client.queue.get(msg.guild.id);
|
||||
const voiceChannel = msg.member.voice.channel;
|
||||
if (!queue) {
|
||||
|
@ -35,7 +35,7 @@ module.exports = {
|
||||
.setDescription(error.stack.replace(/at /g, '**at **'))
|
||||
.setColor(client.config.embedColor);
|
||||
client.fetchUser(client.config.devId).then(user => user.send(embed)).catch(console.error);
|
||||
client.channels.get(client.config.debug_channel).send(embed);
|
||||
client.users.cache.get(client.config.devId).send(embed);
|
||||
}
|
||||
} else {
|
||||
return msg.channel.send(embed);
|
||||
|
@ -42,9 +42,9 @@ function vote(queue, msg, client) {
|
||||
queue.voters = [];
|
||||
queue.votes = 0;
|
||||
queue.votesNeeded = null;
|
||||
return skipSong(queue, msg);
|
||||
return skipSong(queue, msg, client);
|
||||
} else return msg.channel.send(`${client.messages.notEnoughVotes} ${queue.votes} / ${queue.votesNeeded}!`);
|
||||
} else {
|
||||
return skipSong(queue, msg);
|
||||
return skipSong(queue, msg, client);
|
||||
}
|
||||
};
|
||||
|
@ -9,7 +9,10 @@ module.exports = {
|
||||
if (msg.mentions.users.first()) {
|
||||
if (msg.mentions.users.first().id === client.user.id) {
|
||||
if (!args[1]) return;
|
||||
if (args[1] === 'prefix') return msg.channel.send(`${client.messages.prefixHere}\`${prefix}\`.`);
|
||||
if (args[1] === 'prefix') {
|
||||
if (!args[2]) return msg.channel.send(`${client.messages.prefixHere}\`${prefix}\`.`);
|
||||
if (args[2] === "=" && args[3]) return prefix = args[3];
|
||||
}
|
||||
if (args[1] === 'help') {
|
||||
const command = client.commands.get("help");
|
||||
return client.funcs.exe(msg, args, client, Discord, prefix, command);
|
||||
|
@ -3,14 +3,11 @@ const DBL = require("dblapi.js");
|
||||
module.exports = {
|
||||
name: 'ready',
|
||||
async execute(client, Discord) {
|
||||
const debugChannel = await client.channels.fetch(client.config.debug_channel);
|
||||
client.debug_channel = debugChannel
|
||||
const remoteMusixGuildsData = await client.funcs.dbget('guilds', null, client);
|
||||
remoteMusixGuildsData.forEach(guildData => {
|
||||
client.global.db.guilds[guildData.id] = guildData.d;
|
||||
});
|
||||
if (client.config.devMode) {
|
||||
console.log('dev mode');
|
||||
client.guilds.cache.forEach(guild => {
|
||||
client.global.db.guilds[guild.id] = {
|
||||
prefix: client.config.prefix,
|
||||
|
@ -6,7 +6,7 @@ module.exports = async function (client, error, guild) {
|
||||
queue.connection.dispatcher.end();
|
||||
return queue.textChannel.send(client.messages.songBlockedWMG);
|
||||
}*/
|
||||
client.debug_channel.send(client.messages.dispatcherError + error);
|
||||
client.users.cache.get(client.config.devId).send(client.messages.dispatcherError + error);
|
||||
queue.voiceChannel.leave();
|
||||
client.queue.delete(guild.id);
|
||||
return queue.textChannel.send(client.messages.errorDispatcher);
|
||||
|
@ -6,15 +6,14 @@ module.exports = {
|
||||
dblKey: process.env.DBLKEY,
|
||||
api_key: process.env.GOOGLE_API_KEY,
|
||||
testServer: "489111553321336832",
|
||||
debug_channel: "634718645188034560",
|
||||
primary_test_channel: "617633098296721409",
|
||||
secondary_test_channel: "570531724002328577",
|
||||
devId: "360363051792203779",
|
||||
embedColor: "#b50002",
|
||||
invite: "https://discordapp.com/oauth2/authorize?client_id=607266889537945605&permissions=3427328&scope=bot",
|
||||
supportServer: "https://discord.gg/rvHuJtB",
|
||||
devMode: false,
|
||||
dblApi: false,
|
||||
devMode: true,
|
||||
api: false,
|
||||
saveDB: true,
|
||||
respawn: true,
|
||||
shards: 10,
|
||||
|
@ -18,7 +18,7 @@ module.exports = function (client, msg, command) {
|
||||
} else return true;
|
||||
} else if (!permissions.has(command.permission)) {
|
||||
let message
|
||||
message = client.messages.noPerms.replace("%PERMS%", commands.permissions);
|
||||
message = client.messages.noPerms.replace("%PERMS%", command.permissions);
|
||||
msg.channel.send(message);
|
||||
return false;
|
||||
} else return true;
|
||||
|
@ -13,7 +13,7 @@ module.exports = function (msg, args, client, Discord, command) {
|
||||
.setDescription(error.stack.replace(/at /g, '**at **'))
|
||||
.setFooter(`guild: ${msg.guild.id} (${msg.guild.name}), user: ${msg.member.id} (${msg.member.displayName}), channel: ${msg.channel.id} (${msg.channel.name}), date: ${date}, Shard: ${client.shard.ids}`)
|
||||
.setColor('#b50002');
|
||||
client.debug_channel.send(embed);
|
||||
client.users.cache.get(client.devId).send(embed);
|
||||
console.error(error);
|
||||
}
|
||||
};
|
||||
|
@ -4,6 +4,6 @@ module.exports = async function (client) {
|
||||
await client.channels.fetch(client.config.secondary_test_channel)
|
||||
.then(x => x.join());
|
||||
} catch (error) {
|
||||
client.debug_channel.send(client.messages.errorDetected + error);
|
||||
client.users.cache.get(client.config.devId).send(client.messages.errorDetected + error);
|
||||
}
|
||||
};
|
@ -33,7 +33,7 @@ module.exports = async function (video, msg, voiceChannel, client, playlist = fa
|
||||
client.funcs.play(msg.guild, construct.songs[0], client, 0, true);
|
||||
} catch (error) {
|
||||
client.queue.delete(msg.guild.id);
|
||||
client.debug_channel.send(client.messages.errorConnecting + error);
|
||||
client.users.cache.get(client.config.devId).send(client.messages.errorConnecting + error);
|
||||
return msg.channel.send(client.messages.error);
|
||||
}
|
||||
return;
|
||||
|
Loading…
Reference in New Issue
Block a user