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 }) => {
|
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]);
|
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 `.')] });
|
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()
|
let connectedEmbed = new EmbedBuilder()
|
||||||
.setColor(client.config.Colors.Default)
|
.setColor(client.config.Colors.Default)
|
||||||
.setDescription(``)
|
.setDescription(`Successfully connected \` ${playerstats.gamertag} \` as your gamertag.`);
|
||||||
|
|
||||||
|
return interaction.send({ embeds: [connectedEmbed] })
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "dayz-armbands",
|
"name": "dayz-armbands",
|
||||||
"version": "5.7.0",
|
"version": "5.7.1",
|
||||||
"description": "A General Purpose Discord Bot for DayZ Servers.",
|
"description": "A General Purpose Discord Bot for DayZ Servers.",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"nodemonConfig": {
|
"nodemonConfig": {
|
||||||
|
|||||||
Reference in new issue
Block a user