update/include debug command
This commit is contained in:
3 files changed
+43
-1
No files matched your search
@@ -4,7 +4,6 @@ node_modules/*
|
||||
# Testing/dev related
|
||||
*_test.js
|
||||
dev-*.js
|
||||
commands/debug.js
|
||||
|
||||
# Logs
|
||||
logs/*
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
const { EmbedBuilder, ActionRowBuilder, ButtonBuilder, ButtonStyle } = require('discord.js');
|
||||
const CommandOptions = require('../util/CommandOptionTypes').CommandOptionTypes;
|
||||
|
||||
module.exports = {
|
||||
name: "debug",
|
||||
debug: true,
|
||||
global: false,
|
||||
description: "debugging...",
|
||||
usage: "",
|
||||
permissions: {
|
||||
channel: ["VIEW_CHANNEL", "SEND_MESSAGES", "EMBED_LINKS"],
|
||||
member: [],
|
||||
},
|
||||
options: [{
|
||||
name: 'sync-logs',
|
||||
description: 'download the Nitrado logs and run checks now',
|
||||
value: 'sync-logs',
|
||||
type: CommandOptions.SubCommand,
|
||||
}],
|
||||
SlashCommand: {
|
||||
/**
|
||||
*
|
||||
* @param {require("../structures/QuarksBot")} client
|
||||
* @param {import("discord.js").Message} message
|
||||
* @param {string[]} args
|
||||
* @param {*} param3
|
||||
*/
|
||||
run: async (client, interaction, args, { GuildDB }) => {
|
||||
if (!client.config.Admins.includes(interaction.member.user.id)) return interaction.send({ content: 'Only developers can access this command.', flags: (1 << 6) })
|
||||
|
||||
if (args[0].name == 'sync-logs') {
|
||||
if (client.processingLogs) return interaction.send({ content: 'The Nitrado logs are already being processed at the moment...', flags: (1 << 6) });
|
||||
interaction.send({ content: 'Downloading and processing Nitrado logs now...', flags: (1 << 6) });
|
||||
return client.logsUpdateTimer(client);
|
||||
}
|
||||
},
|
||||
},
|
||||
Interactions: {}
|
||||
}
|
||||
@@ -42,6 +42,7 @@ class DayzRBot extends Client {
|
||||
this.arIntervalId; // Interval for auto-restart functions
|
||||
this.playerSessions = new Map();
|
||||
this.alarmPingQueue = {};
|
||||
this.processingLogs = false;
|
||||
this.autoRestartInit();
|
||||
this.LoadCommandsAndInteractionHandlers();
|
||||
this.LoadEvents();
|
||||
@@ -236,6 +237,8 @@ class DayzRBot extends Client {
|
||||
}
|
||||
|
||||
async logsUpdateTimer(c) {
|
||||
if (this.processingLogs) return; // Process is already running, wait till next scheduled time.
|
||||
this.processingLogs = true;
|
||||
let t = new Date();
|
||||
// c.log(`...Logs Tick - ${t.getHours()}:${t.getMinutes()}:${t.getSeconds()}...`);
|
||||
c.activePlayersTick++;
|
||||
@@ -250,6 +253,7 @@ class DayzRBot extends Client {
|
||||
if (c.activePlayersTick == 12) await HandleActivePlayersList(c, c.config.GuildID);
|
||||
})
|
||||
});
|
||||
this.processingLogs = false;
|
||||
}
|
||||
|
||||
async connectMongo(mongoURI, dbo) {
|
||||
|
||||
Reference in new issue
Block a user