update formatting

This commit is contained in:
SowinskiBraeden committed 2025-02-05 13:54:11 -08:00
1 parent 265f0d3f38
commit 15d250eb76
3 files changed
+1232 -1232

No files matched your search

+1142 -1142
View File
File diff suppressed because it is too large. Load diff
+89 -89
View File
@@ -1,90 +1,90 @@
const { EmbedBuilder } = require('discord.js'); const { EmbedBuilder } = require('discord.js');
const CommandOptions = require('../util/CommandOptionTypes').CommandOptionTypes; const CommandOptions = require('../util/CommandOptionTypes').CommandOptionTypes;
module.exports = { module.exports = {
name: "lookup", name: "lookup",
debug: false, debug: false,
global: false, global: false,
description: "Search for a user's Discord or Gamertag", description: "Search for a user's Discord or Gamertag",
usage: "[option] [parameter]", usage: "[option] [parameter]",
permissions: { permissions: {
channel: ["VIEW_CHANNEL", "SEND_MESSAGES", "EMBED_LINKS"], channel: ["VIEW_CHANNEL", "SEND_MESSAGES", "EMBED_LINKS"],
member: [], member: [],
}, },
options: [{ options: [{
name: "discord", name: "discord",
description: "Find a Discord user from a Gamertag", description: "Find a Discord user from a Gamertag",
value: "discord", value: "discord",
type: CommandOptions.SubCommand, type: CommandOptions.SubCommand,
options: [{ options: [{
name: "gamertag", name: "gamertag",
description: "Gamertag of player", description: "Gamertag of player",
value: "gamertag", value: "gamertag",
type: CommandOptions.String, type: CommandOptions.String,
required: true, required: true,
}] }]
}, { }, {
name: "gamertag", name: "gamertag",
description: "Find a Gamertag from a Discord user", description: "Find a Gamertag from a Discord user",
value: "gamertag", value: "gamertag",
type: CommandOptions.SubCommand, type: CommandOptions.SubCommand,
options: [{ options: [{
name: "user", name: "user",
description: "Discord User", description: "Discord User",
value: "user", value: "user",
type: CommandOptions.User, type: CommandOptions.User,
required: true, required: true,
}] }]
}], }],
SlashCommand: { SlashCommand: {
/** /**
* *
* @param {require("../structures/DayzRBot")} client * @param {require("../structures/DayzRBot")} client
* @param {import("discord.js").Message} message * @param {import("discord.js").Message} message
* @param {string[]} args * @param {string[]} args
* @param {*} param3 * @param {*} param3
*/ */
run: async (client, interaction, args, { GuildDB }) => { run: async (client, interaction, args, { GuildDB }) => {
if (!client.exists(GuildDB.Nitrado) || !client.exists(GuildDB.Nitrado.ServerID) || !client.exists(GuildDB.Nitrado.UserID) || !client.exists(GuildDB.Nitrado.Auth)) { if (!client.exists(GuildDB.Nitrado) || !client.exists(GuildDB.Nitrado.ServerID) || !client.exists(GuildDB.Nitrado.UserID) || !client.exists(GuildDB.Nitrado.Auth)) {
const warnNitradoNotInitialized = new EmbedBuilder() const warnNitradoNotInitialized = new EmbedBuilder()
.setColor(client.config.Colors.Yellow) .setColor(client.config.Colors.Yellow)
.setDescription("**WARNING:** The DayZ Nitrado Server has not been configured for this guild yet. This command or feature is currently unavailable."); .setDescription("**WARNING:** The DayZ Nitrado Server has not been configured for this guild yet. This command or feature is currently unavailable.");
return interaction.send({ embeds: [warnNitradoNotInitialized], flags: (1 << 6) }); return interaction.send({ embeds: [warnNitradoNotInitialized], flags: (1 << 6) });
} }
if (args[0].name == 'discord') { if (args[0].name == 'discord') {
let playerStat = await client.dbo.collection("players").findOne({"gamertag": args[0].options[0].value}); let playerStat = await client.dbo.collection("players").findOne({"gamertag": args[0].options[0].value});
if (playerStat == undefined) return interaction.send({ embeds: [new EmbedBuilder().setColor(client.config.Colors.Yellow).setDescription(`**Not Found** This gamertag \` ${args[0].options[0].value} \` 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 gamertag \` ${args[0].options[0].value} \` cannot be found, the gamertag may be incorrect or this player has not logged onto the server before for at least \` 5 minutes \`.`)] });
if (client.exists(playerStat.discordID)) { if (client.exists(playerStat.discordID)) {
const found = new EmbedBuilder() const found = new EmbedBuilder()
.setColor(client.config.Colors.Yellow) .setColor(client.config.Colors.Yellow)
.setDescription(`**Record Found**\n> The gamertag \` ${playerStat.gamertag} \` is currently linked to <@${playerStat.discordID}>.`) .setDescription(`**Record Found**\n> The gamertag \` ${playerStat.gamertag} \` is currently linked to <@${playerStat.discordID}>.`)
return interaction.send({ embeds: [found] }); return interaction.send({ embeds: [found] });
} }
let notFound = new EmbedBuilder() let notFound = new EmbedBuilder()
.setColor(client.config.Colors.Default) .setColor(client.config.Colors.Default)
.setDescription(`**Record Not Found**\n The gamertag \` ${playerStat.gamertag} \` currently has no linked Discord account.`); .setDescription(`**Record Not Found**\n The gamertag \` ${playerStat.gamertag} \` currently has no linked Discord account.`);
return interaction.send({ embeds: [notFound] }) return interaction.send({ embeds: [notFound] })
} else if (args[0].name == 'gamertag') { } else if (args[0].name == 'gamertag') {
let playerStat = await client.dbo.collection("players").findOne({"discordID": args[0].options[0].value}); let playerStat = await client.dbo.collection("players").findOne({"discordID": args[0].options[0].value});
if (playerStat == undefined) return interaction.send({ embeds: [new EmbedBuilder().setColor(client.config.Colors.Yellow).setDescription(`**Not Found** The user <@${args[0].options[0].value}> has not linked a gamertag.`)] }); if (playerStat == undefined) return interaction.send({ embeds: [new EmbedBuilder().setColor(client.config.Colors.Yellow).setDescription(`**Not Found** The user <@${args[0].options[0].value}> has not linked a gamertag.`)] });
const found = new EmbedBuilder() const found = new EmbedBuilder()
.setColor(client.config.Colors.Yellow) .setColor(client.config.Colors.Yellow)
.setDescription(`**Record Found**\n> The user <@${playerStat.discordID}> has linked the gamertag \` ${playerStat.gamertag} \`.`) .setDescription(`**Record Found**\n> The user <@${playerStat.discordID}> has linked the gamertag \` ${playerStat.gamertag} \`.`)
return interaction.send({ embeds: [found] }); return interaction.send({ embeds: [found] });
} }
}, },
}, },
} }
+1 -1
View File
@@ -5,4 +5,4 @@ const manager = new ShardingManager('./bot.js', { token: config.Token });
manager.on('shardCreate', shard => console.log(`Launched shard ${shard.id}`)); manager.on('shardCreate', shard => console.log(`Launched shard ${shard.id}`));
manager.spawn(); manager.spawn();