diff --git a/Struct/Client.js b/Struct/Client.js index 6d937223..b2488aa6 100644 --- a/Struct/Client.js +++ b/Struct/Client.js @@ -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), diff --git a/Struct/funcs/ffmpeg.js b/Struct/funcs/ffmpeg.js new file mode 100644 index 00000000..d1a01e25 --- /dev/null +++ b/Struct/funcs/ffmpeg.js @@ -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); + } +}; \ No newline at end of file diff --git a/events/ready.js b/events/ready.js index adfc8980..64618694 100644 --- a/events/ready.js +++ b/events/ready.js @@ -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); } } diff --git a/index.js b/index.js index b3f0176f..7eee3cb6 100644 --- a/index.js +++ b/index.js @@ -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 => {