From abe3b9897c1825f6a53c83b432e0901c5ff734f4 Mon Sep 17 00:00:00 2001 From: AnxietyisReal <96593068+AnxietyisReal@users.noreply.github.com> Date: Fri, 7 Jul 2023 15:54:48 +1000 Subject: [PATCH] Automate the dailyMsgs backup --- src/index.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/index.ts b/src/index.ts index b14784d..2f15bcb 100644 --- a/src/index.ts +++ b/src/index.ts @@ -90,6 +90,7 @@ setInterval(async()=>{ dailyMsgs.push([formattedDate, total]); writeFileSync('./src/database/dailyMsgs.json', JSON.stringify(dailyMsgs)) console.log(client.logTime(), `Pushed [${formattedDate}, ${total}] to dailyMsgs`); - client.guilds.cache.get(client.config.mainServer.id).commands.fetch().then((commands)=>(client.channels.resolve(client.config.mainServer.channels.logs) as Discord.TextChannel).send(`:pencil: Pushed \`[${formattedDate}, ${total}]\` to x.name == 'rank').id}>`)) + client.guilds.cache.get(client.config.mainServer.id).commands.fetch().then(commands=>(client.channels.resolve(client.config.mainServer.channels.logs) as Discord.TextChannel).send(`:pencil: Pushed \`[${formattedDate}, ${total}]\` to x.name === 'rank').id}>`)); + (client.channels.resolve(client.config.mainServer.channels.thismeanswar) as Discord.TextChannel).send({files:['./database/dailyMsgs.json']}).catch(fileErr=>console.log(fileErr)) } }, 5000)