auto clean whitespace
This commit is contained in:
38 files changed
+1446
-1446
No files matched your search
@@ -8,7 +8,7 @@ module.exports = {
|
||||
if (!client.exists(guild.connectionLogsChannel)) return;
|
||||
const channel = client.GetChannel(guild.connectionLogsChannel);
|
||||
if (!channel) return;
|
||||
|
||||
|
||||
let newDt = await client.getDateEST(data.time);
|
||||
let unixTime = Math.floor(newDt.getTime() / 1000);
|
||||
|
||||
@@ -48,7 +48,7 @@ module.exports = {
|
||||
// If lastHitBy (attacker) died after shooting this player
|
||||
// then it does not count as combat logging, (the combat ended due to death)
|
||||
let attacker = await client.dbo.collection("players").findOne({"gamertag": data.lastHitBy});
|
||||
if (attacker.lastDeathDate > data.lastDamageDate) return;
|
||||
if (attacker.lastDeathDate > data.lastDamageDate) return;
|
||||
|
||||
let unixTime = Math.floor(newDt.getTime() / 1000);
|
||||
const destination = nearest(data.pos, guild.Nitrado.Mission);
|
||||
@@ -59,7 +59,7 @@ module.exports = {
|
||||
|
||||
const NAME = "DayZ.R Admin Logs";
|
||||
const webhook = await GetWebhook(client, NAME, guild.connectionLogsChannel);
|
||||
|
||||
|
||||
let content = { embeds: [combatLog] };
|
||||
if (client.exists(guild.adminRole)) content.content = `<@&${guild.adminRole}>`;
|
||||
WebhookSend(client, webhook, content);
|
||||
|
||||
+10
-10
@@ -96,7 +96,7 @@ module.exports = {
|
||||
.setDescription(`**Zone Ping - <t:${unixTime}>**\n**${data.player}** was located within **${distance} meters** of the Zone **${alarm.name}**`)
|
||||
.addFields({ name: '**Location**', value: `**[${data.pos[0]}, ${data.pos[1]}](https://www.izurvive.com/chernarusplussatmap/#location=${data.pos[0]};${data.pos[1]})**`, inline: false })
|
||||
);
|
||||
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -116,7 +116,7 @@ module.exports = {
|
||||
let uavEmbed = new EmbedBuilder()
|
||||
.setColor(client.config.Colors.Default)
|
||||
.setDescription(`**UAV Detection - <t:${unixTime}>**\n**${data.player}** was spotted in the UAV zone at **[${data.pos[0]}, ${data.pos[1]}](https://www.izurvive.com/chernarusplussatmap/#location=${data.pos[0]};${data.pos[1]})\n${destination}**`)
|
||||
|
||||
|
||||
client.users.fetch(uav.owner, false).then((user) => {
|
||||
user.send({ embeds: [uavEmbed] });
|
||||
});
|
||||
@@ -133,9 +133,9 @@ module.exports = {
|
||||
|
||||
let now = new Date();
|
||||
let diff = Math.round((now.getTime() - uav.creationDate.getTime()) / 1000 / 60); // diff minutes
|
||||
|
||||
|
||||
if (diff <= 30) continue;
|
||||
|
||||
|
||||
uavs.splice(i, 1);
|
||||
update = true;
|
||||
|
||||
@@ -154,9 +154,9 @@ module.exports = {
|
||||
},
|
||||
|
||||
KillInAlarm: async (client, guildId, data) => {
|
||||
|
||||
|
||||
let guild = await GetGuild(client, guildId);
|
||||
|
||||
|
||||
for (let i = 0; i < guild.alarms.length; i++) {
|
||||
let alarm = guild.alarms[i];
|
||||
if (alarm.disabled || !alarm.rules.includes('ban_on_kill')) continue; // ignore if alarm is disabled or not ban on kill;
|
||||
@@ -176,10 +176,10 @@ module.exports = {
|
||||
.setColor(client.config.Colors.Default)
|
||||
.setDescription(`**Zone Ping - <t:${unixTime}>**\n**${data.killer}** was located within **${distance} meters** of the Zone **${alarm.name}** __and has been banned for killing **${data.victim}**.__`)
|
||||
.addFields({ name: '**Location**', value: `**[${data.killerPOS[0]}, ${data.killerPOS[1]}](https://www.izurvive.com/chernarusplussatmap/#location=${data.killerPOS[0]};${data.killerPOS[1]})**`, inline: false })
|
||||
|
||||
|
||||
const NAME = "DayZ.R Zone Alert";
|
||||
const webhook = await GetWebhook(client, NAME, alarm.channel);
|
||||
|
||||
|
||||
let content = { content: `<@&${alarm.role}>`, embeds: [alarmEmbed] };
|
||||
WebhookSend(client, webhook, content);
|
||||
|
||||
@@ -224,10 +224,10 @@ module.exports = {
|
||||
.setColor(client.config.Colors.Default)
|
||||
.setDescription(`**Zone Ping - <t:${unixTime}>**\n**${info.player}** was located within **${distance} meters** of the Zone **${alarm.name}** __and has been banned for **placing a fireplace**.__`)
|
||||
.addFields({ name: '**Location**', value: `**[${info.playerPOS[0]}, ${info.playerPOS[1]}](https://www.izurvive.com/chernarusplussatmap/#location=${info.playerPOS[0]};${info.playerPOS[1]})**`, inline: false })
|
||||
|
||||
|
||||
const NAME = "DayZ.R Zone Alert";
|
||||
const webhook = await GetWebhook(client, NAME, alarm.channel);
|
||||
|
||||
|
||||
let content = { content: `<@&${alarm.role}>`, embeds: [alarmEmbed] };
|
||||
WebhookSend(client, webhook, content);
|
||||
|
||||
|
||||
@@ -12,4 +12,4 @@ module.exports = {
|
||||
Float: 10, // AKA Number in Discord's Documentation
|
||||
Attachment: 11,
|
||||
}
|
||||
};
|
||||
};
|
||||
+1
-1
@@ -16,4 +16,4 @@ module.exports = {
|
||||
decipher.final('utf8')
|
||||
) // Decrypts data and converts to utf8
|
||||
}
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -35,4 +35,4 @@ class Logger {
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = Logger;
|
||||
module.exports = Logger;
|
||||
@@ -8,7 +8,7 @@ const { REST } = require('@discordjs/rest');
|
||||
* @param {require("../structures/DayzRBot")} client
|
||||
*/
|
||||
module.exports = {
|
||||
// Register guild commands
|
||||
// Register guild commands
|
||||
RegisterGuildCommands: async (client, guild) => {
|
||||
const commands = [];
|
||||
const commandFiles = fs.readdirSync(path.join(__dirname, "..", "commands")).filter(file => file.endsWith('.js'));
|
||||
@@ -50,7 +50,7 @@ module.exports = {
|
||||
if (command.global) commands.push(command);
|
||||
}
|
||||
|
||||
const rest = new REST({ version: '10' }).setToken(client.config.Token);
|
||||
const rest = new REST({ version: '10' }).setToken(client.config.Token);
|
||||
|
||||
try {
|
||||
client.log('[global] Started refreshing global (/) commands.');
|
||||
@@ -65,4 +65,4 @@ module.exports = {
|
||||
client.error(error);
|
||||
}
|
||||
}
|
||||
};
|
||||
};
|
||||
+3
-3
@@ -6,7 +6,7 @@ module.exports = {
|
||||
let theta = (thetat < 0) ? (360 + thetat) : thetat;
|
||||
let compass = ["S", "SW", "W", "NW", "N", "NE", "E", "SE", "S"];
|
||||
let dir = compass[Math.round(theta / 45)];
|
||||
|
||||
|
||||
return {distance, theta, dir}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user