debug bank.js NitradoAPI.js and change ReadLogs callback
This commit is contained in:
5 files changed
+9
-12
No files matched your search
+2
-2
@@ -236,9 +236,9 @@ module.exports = {
|
||||
}
|
||||
|
||||
// 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(
|
||||
{ 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 },
|
||||
|
||||
+1
-1
@@ -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();
|
||||
client.logsUpdateTimer();
|
||||
setInterval(client.logsUpdateTimer, client.timer);
|
||||
};
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "dayz-armbands",
|
||||
"version": "6.3.8",
|
||||
"version": "6.3.10",
|
||||
"description": "A General Purpose Discord Bot for DayZ Servers.",
|
||||
"main": "index.js",
|
||||
"nodemonConfig": {
|
||||
|
||||
@@ -165,20 +165,17 @@ class DayzArmbands extends Client {
|
||||
}
|
||||
|
||||
async logsUpdateTimer() {
|
||||
setTimeout(async () => {
|
||||
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++;
|
||||
|
||||
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 () => {
|
||||
this.log('Analyzed logs');
|
||||
this.log('...Analyzed logs...');
|
||||
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) {
|
||||
|
||||
+1
-1
@@ -16,7 +16,7 @@ module.exports = {
|
||||
).then(res => res);
|
||||
|
||||
const stream = fs.createWriteStream(outputDir);
|
||||
if (!res.data.token) {
|
||||
if (!res.data || !res.data.token) {
|
||||
client.error(`Error downloading File "${filename}":`);
|
||||
client.error(res);
|
||||
return;
|
||||
|
||||
Reference in new issue
Block a user