welcome users, gamertag link, other general modifications
This commit is contained in:
15 files changed
+402
-48
No files matched your search
@@ -0,0 +1,54 @@
|
||||
const { EmbedBuilder } = require('discord.js');
|
||||
|
||||
module.exports = {
|
||||
name: "gamertag-link",
|
||||
debug: false,
|
||||
global: false,
|
||||
description: "Connect DayZ account to gain server access",
|
||||
usage: "[cmd] [opt]",
|
||||
permissions: {
|
||||
channel: ["VIEW_CHANNEL", "SEND_MESSAGES", "EMBED_LINKS"],
|
||||
member: [],
|
||||
},
|
||||
options: [{
|
||||
name: "gamertag",
|
||||
description: "Gamertag of player for bounty",
|
||||
value: "gamertag",
|
||||
type: 3,
|
||||
required: true,
|
||||
}],
|
||||
SlashCommand: {
|
||||
/**
|
||||
*
|
||||
* @param {require("../structures/QuarksBot")} client
|
||||
* @param {import("discord.js").Message} message
|
||||
* @param {string[]} args
|
||||
* @param {*} param3
|
||||
*/
|
||||
run: async (client, interaction, args, { GuildDB }) => {
|
||||
|
||||
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 `.')] });
|
||||
|
||||
playerStat.discordID = interaction.member.user.id;
|
||||
|
||||
let playerStatIndex = GuildDB.playerstats.indexOf(playerStat);
|
||||
let playerstats = GuildDB.playerstats;
|
||||
playerstats[playerStatIndex] = playerStatIndex;
|
||||
|
||||
client.dbo.collectin("guilds").updateOne({ 'server.serverID': GuildDB.serverID }, {
|
||||
$set: {
|
||||
'server.playerstats': playerstats,
|
||||
}
|
||||
})
|
||||
|
||||
const role = interaction.guild.roles.cache.get(GuildDB.linkedGamertagRole);
|
||||
const member = interaction.guild.members.cache.get(interaction.member.user.id);
|
||||
member.roles.add(role);
|
||||
|
||||
let connectedEmbed = new EmbedBuilder()
|
||||
.setColor(client.config.Colors.Default)
|
||||
.setDescription(``)
|
||||
},
|
||||
},
|
||||
}
|
||||
Reference in new issue
Block a user