refactor/await UpdatePlayer then return

This commit is contained in:
SowinskiBraeden committed 2023-10-31 16:17:06 -07:00
1 parent ea60c4a459
commit 160979e6e7
3 files changed
+11 -6

No files matched your search

+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "dayzr-bot", "name": "dayzr-bot",
"version": "12.0.7", "version": "12.0.8",
"description": "A General Purpose Discord Bot for DayZ Nitrado Servers.", "description": "A General Purpose Discord Bot for DayZ Nitrado Servers.",
"main": "index.js", "main": "index.js",
"nodemonConfig": { "nodemonConfig": {
+4 -2
View File
@@ -63,7 +63,8 @@ module.exports = {
victimStat.lastDeathDate = newDt; victimStat.lastDeathDate = newDt;
return await UpdatePlayer(client, victimStat); await UpdatePlayer(client, victimStat);
return
}, },
HandleKillfeed: async (client, guild, line) => { HandleKillfeed: async (client, guild, line) => {
@@ -156,7 +157,8 @@ module.exports = {
.setDescription(`**Death Event** - <t:${unixTime}>\n**${info.victim}** ${killMessage} a **${cod}.**${coord}`); .setDescription(`**Death Event** - <t:${unixTime}>\n**${info.victim}** ${killMessage} a **${cod}.**${coord}`);
if (client.exists(channel)) await channel.send({ embeds: [killEvent] }); if (client.exists(channel)) await channel.send({ embeds: [killEvent] });
return await UpdatePlayer(client, victimStat); await UpdatePlayer(client, victimStat);
return
} }
KillInAlarm(client, guild.serverID, info); // check if kill happened in a no kill zone KillInAlarm(client, guild.serverID, info); // check if kill happened in a no kill zone
+6 -3
View File
@@ -59,7 +59,8 @@ module.exports = {
lastConnectionDate: null, lastConnectionDate: null,
}); });
return await UpdatePlayer(client, playerStat); await UpdatePlayer(client, playerStat);
return;
} }
if (line.includes(' disconnected')) { if (line.includes(' disconnected')) {
@@ -112,7 +113,8 @@ module.exports = {
}); });
} }
return await UpdatePlayer(client, playerStat); await UpdatePlayer(client, playerStat);
return;
} }
if (line.includes('pos=<') && !line.includes('hit by')) { if (line.includes('pos=<') && !line.includes('hit by')) {
@@ -171,7 +173,8 @@ module.exports = {
playerStat.lastDamageDate = await client.getDateEST(info.time); playerStat.lastDamageDate = await client.getDateEST(info.time);
playerStat.lastHitBy = info.attacker; playerStat.lastHitBy = info.attacker;
return await UpdatePlayer(client, playerStat); await UpdatePlayer(client, playerStat);
return;
} }
return; return;