pass client to readlogs

This commit is contained in:
SowinskiBraeden committed 2023-04-15 12:23:16 -07:00
1 parent aa0f08ce0e
commit ba18f99db0
3 files changed
+10 -10

No files matched your search

+1 -1
View File
@@ -7,5 +7,5 @@ module.exports = async (client) => {
client.log(`Successfully Logged in as ${client.user.tag}`);
client.log(`Ready to serve in ${client.channels.cache.size} channels on ${client.guilds.cache.size} servers, for a total of ${client.users.cache.size} users.`)
client.RegisterSlashCommands();
setInterval(client.logsUpdateTimer, client.timer);
setInterval(client.logsUpdateTimer, client.timer, client);
};
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "dayz-armbands",
"version": "6.3.10",
"version": "6.3.11",
"description": "A General Purpose Discord Bot for DayZ Servers.",
"main": "index.js",
"nodemonConfig": {
+8 -8
View File
@@ -164,16 +164,16 @@ class DayzArmbands extends Client {
await fs.writeFileSync(logHistoryDir, JSON.stringify(history));
}
async logsUpdateTimer() {
async logsUpdateTimer(c) {
let t = new Date();
this.log(`...Logs Tick - ${t.getHours()}:${t.getMinutes()}:${t.getSeconds()}...`);
this.activePlayersTick++;
c.log(`...Logs Tick - ${t.getHours()}:${t.getMinutes()}:${t.getSeconds()}...`);
c.activePlayersTick++;
await DownloadNitradoFile(this, `/games/${this.config.Nitrado.UserID}/noftp/dayzxb/config/DayZServer_X1_x64.ADM`, './logs/server-logs.ADM').then(async () => {
this.log('...Downloaded logs...');
await this.readLogs(this.config.GuildID).then(async () => {
this.log('...Analyzed logs...');
if (this.activePlayersTick == 12) await HandleActivePlayersList(this, this.config.GuildID);
await DownloadNitradoFile(c, `/games/${c.config.Nitrado.UserID}/noftp/dayzxb/config/DayZServer_X1_x64.ADM`, './logs/server-logs.ADM').then(async () => {
c.channels.log('...Downloaded logs...');
await c.readLogs(c.config.GuildID).then(async () => {
c.log('...Analyzed logs...');
if (c.activePlayersTick == 12) await HandleActivePlayersList(c, c.config.GuildID);
})
});
}