1
0
mirror of https://github.com/musix-org/musix-oss synced 2024-11-10 02:00:20 +00:00

ffmpeg error detections system

This commit is contained in:
MatteZ02 2019-12-16 21:01:42 +02:00
parent 069ba70cb5
commit 2e31350def
4 changed files with 13 additions and 2 deletions

View File

@ -28,6 +28,7 @@ module.exports = class extends Client {
this.funcs.msToTime = require('./funcs/msToTime.js');
this.funcs.dbget = require('./funcs/dbget.js');
this.funcs.exe = require('./funcs/exe.js');
this.funcs.ffmpegTest = require('./funcs/ffmpeg.js');
admin.initializeApp({
credential: admin.credential.cert(serviceAccount),

7
Struct/funcs/ffmpeg.js Normal file
View File

@ -0,0 +1,7 @@
module.exports = async function (client) {
try {
await client.channels.get('570531724002328577').join()
} catch (error) {
client.channels.get(client.config.debug_channel).send("Error detected: " + error);
}
};

View File

@ -1,6 +1,6 @@
module.exports = {
name: 'ready',
async execute(client, dbl) {
async execute(client, dbl, Discord) {
const remoteMusixGuildsData = await client.funcs.dbget('guilds', null, client);
const remoteMusixPlaylistsData = await client.funcs.dbget('playlists', null, client);
remoteMusixGuildsData.forEach(guildData => {
@ -44,5 +44,8 @@ module.exports = {
});
dbl.postStats(client.guilds.size);
}, 1800000);
setInterval(() => {
client.funcs.ffmpeg(client, disco);
}, 7200000);
}
}

View File

@ -37,7 +37,7 @@ for (const file of settingFiles) {
client.on('ready', async () => {
const eventName = 'ready';
const event = client.events.get(eventName) || client.events.find(ent => ent.aliases && ent.aliases.includes(eventName));
event.execute(client, dbl);
event.execute(client, dbl, Discord);
});
client.on('message', message => {