refactor/commands support migrates player stats
This commit is contained in:
17 files changed
+169
-284
No files matched your search
+2
-2
@@ -471,8 +471,8 @@ module.exports = {
|
||||
let alarm = GuildDB.alarms.find(alarm => alarm.name == interaction.values[0]);
|
||||
let alarmIndex = GuildDB.alarms.indexOf(alarm);
|
||||
|
||||
let playerStat = GuildDB.playerstats.find(stat => stat.gamertag == interaction.customId.split('-')[2]);
|
||||
if (playerStat == undefined) return interaction.update({ embeds: [new EmbedBuilder().setColor(client.config.Colors.Yellow).setDescription('**Not Found** This player cannot be found, the gamertag may be incorrect or this player has not logged onto the server before.')], components: [] });
|
||||
let playerStat = await client.dbo.collection("players").findOne({"gamertag": interaction.customId.split('-')[2]});
|
||||
if (!client.exists(playerStat)) return interaction.update({ embeds: [new EmbedBuilder().setColor(client.config.Colors.Yellow).setDescription('**Not Found** This player cannot be found, the gamertag may be incorrect or this player has not logged onto the server before.')], components: [] });
|
||||
|
||||
let add = interaction.customId.split('-')[1] == 'add';
|
||||
|
||||
|
||||
Reference in new issue
Block a user