fix/player-list command + auto player list + refactors for issue #28
This commit is contained in:
6 files changed
+104
-82
No files matched your search
+10
-5
@@ -14,6 +14,7 @@ const { decrypt } = require('../util/Cryptic');
|
||||
|
||||
// Data structures imports
|
||||
const { getDefaultPlayer, UpdatePlayer } = require('../database/player');
|
||||
const { Missions } = require('../database/destinations');
|
||||
const { GetGuild } = require('../database/guild');
|
||||
|
||||
const path = require("path");
|
||||
@@ -23,11 +24,6 @@ const readline = require('readline');
|
||||
const minute = 60000; // 1 minute in milliseconds
|
||||
const arInterval = 600000; // Set auto-restart interval 10 minutes (600,000ms)
|
||||
|
||||
const Missions = {
|
||||
"dayzOffline.chernarusplus": "Chernarus",
|
||||
"dayzOffline.enoch": "Livonia",
|
||||
};
|
||||
|
||||
class DayzRBot extends Client {
|
||||
|
||||
constructor(options, config) {
|
||||
@@ -88,6 +84,15 @@ class DayzRBot extends Client {
|
||||
if (interaction.type == InteractionType.ApplicationCommand) {
|
||||
let GuildDB = await GetGuild(this, interaction.guild_id);
|
||||
|
||||
if (this.exists(GuildDB.Nitrado) && this.exists(GuildDB.Nitrado.Auth)) {
|
||||
GuildDB.Nitrado.Auth = decrypt(
|
||||
GuildDB.Nitrado.Auth,
|
||||
this.config.EncryptionMethod,
|
||||
this.key,
|
||||
this.encryptionIV
|
||||
);
|
||||
}
|
||||
|
||||
for (const [factionID, data] of Object.entries(GuildDB.factionArmbands)) {
|
||||
const guild = this.guilds.cache.get(GuildDB.serverID);
|
||||
const role = guild.roles.cache.find(role => role.id == factionID);
|
||||
|
||||
Reference in new issue
Block a user