hotfix gamertag
This commit is contained in:
2 files changed
+15
-2
No files matched your search
@@ -27,6 +27,17 @@ module.exports = {
|
||||
*/
|
||||
run: async (client, interaction, args, { GuildDB }) => {
|
||||
|
||||
if (!client.exists(GuildDB.playerstats)) {
|
||||
GuildDB.playerstats = [];
|
||||
this.dbo.collection("guilds").updateOne({ "server.serverID": guild.serverID }, {
|
||||
$set: {
|
||||
"server.playerstats": []
|
||||
}
|
||||
}, function (err, res) {
|
||||
if (err && this.exists(channel)) return this.sendInternalError(channel, err);
|
||||
});
|
||||
}
|
||||
|
||||
let playerStat = GuildDB.playerstats.find(stat => stat.player == args[0].value[0]);
|
||||
if (playerStat == undefined) return interaction.send({ 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 for at least ` 5 minutes `.')] });
|
||||
|
||||
@@ -48,7 +59,9 @@ module.exports = {
|
||||
|
||||
let connectedEmbed = new EmbedBuilder()
|
||||
.setColor(client.config.Colors.Default)
|
||||
.setDescription(``)
|
||||
.setDescription(`Successfully connected \` ${playerstats.gamertag} \` as your gamertag.`);
|
||||
|
||||
return interaction.send({ embeds: [connectedEmbed] })
|
||||
},
|
||||
},
|
||||
}
|
||||
Reference in new issue
Block a user