debug bank.js NitradoAPI.js and change ReadLogs callback

This commit is contained in:
SowinskiBraeden committed 2023-04-15 12:20:35 -07:00
1 parent d958793a00
commit aa0f08ce0e
5 files changed
+14 -17

No files matched your search

+2 -2
View File
@@ -236,9 +236,9 @@ module.exports = {
} }
// This lame line of code to get username without ping on discord // This lame line of code to get username without ping on discord
const User = client.users.cache.get(targetUserID); const DiscordUser = client.users.cache.get(targetUserID);
balanceEmbed.setTitle(`${User.tag}'s Bank Records`); balanceEmbed.setTitle(`${DiscordUser.tag.split("#")[0]}'s Bank Records`);
balanceEmbed.addFields( balanceEmbed.addFields(
{ name: '**Cash**', value: `$${targetUserBanking.guilds[GuildDB.serverID].bankAccount.cash.toLocaleString(undefined, {minimumFractionDigits: 2, maximumFractionDigits: 2})}`, inline: true }, { name: '**Cash**', value: `$${targetUserBanking.guilds[GuildDB.serverID].bankAccount.cash.toLocaleString(undefined, {minimumFractionDigits: 2, maximumFractionDigits: 2})}`, inline: true },
{ name: '**Bank**', value: `$${targetUserBanking.guilds[GuildDB.serverID].bankAccount.balance.toLocaleString(undefined, {minimumFractionDigits: 2, maximumFractionDigits: 2})}`, inline: true }, { name: '**Bank**', value: `$${targetUserBanking.guilds[GuildDB.serverID].bankAccount.balance.toLocaleString(undefined, {minimumFractionDigits: 2, maximumFractionDigits: 2})}`, inline: true },
+1 -1
View File
@@ -7,5 +7,5 @@ module.exports = async (client) => {
client.log(`Successfully Logged in as ${client.user.tag}`); 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.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(); client.RegisterSlashCommands();
client.logsUpdateTimer(); setInterval(client.logsUpdateTimer, client.timer);
}; };
+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "dayz-armbands", "name": "dayz-armbands",
"version": "6.3.8", "version": "6.3.10",
"description": "A General Purpose Discord Bot for DayZ Servers.", "description": "A General Purpose Discord Bot for DayZ Servers.",
"main": "index.js", "main": "index.js",
"nodemonConfig": { "nodemonConfig": {
+9 -12
View File
@@ -165,20 +165,17 @@ class DayzArmbands extends Client {
} }
async logsUpdateTimer() { async logsUpdateTimer() {
setTimeout(async () => { let t = new Date();
let t = new Date(); this.log(`...Logs Tick - ${t.getHours()}:${t.getMinutes()}:${t.getSeconds()}...`);
this.log(`Logs Tick - ${t.getHours()}:${t.getMinutes()}:${t.getSeconds()}`); this.activePlayersTick++;
this.activePlayersTick++;
await DownloadNitradoFile(this, `/games/${this.config.Nitrado.UserID}/noftp/dayzxb/config/DayZServer_X1_x64.ADM`, './logs/server-logs.ADM').then(async () => { 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'); this.log('...Downloaded logs...');
await this.readLogs(this.config.GuildID).then(async () => { await this.readLogs(this.config.GuildID).then(async () => {
this.log('Analyzed logs'); this.log('...Analyzed logs...');
if (this.activePlayersTick == 12) await HandleActivePlayersList(this, this.config.GuildID); if (this.activePlayersTick == 12) await HandleActivePlayersList(this, this.config.GuildID);
})
}) })
this.logsUpdateTimer(); // restart this function });
}, this.timer); // restart every 5 minutes during production
} }
async connectMongo(mongoURI, dbo) { async connectMongo(mongoURI, dbo) {
+1 -1
View File
@@ -16,7 +16,7 @@ module.exports = {
).then(res => res); ).then(res => res);
const stream = fs.createWriteStream(outputDir); const stream = fs.createWriteStream(outputDir);
if (!res.data.token) { if (!res.data || !res.data.token) {
client.error(`Error downloading File "${filename}":`); client.error(`Error downloading File "${filename}":`);
client.error(res); client.error(res);
return; return;