refactor/support multiple discord guilds with 1 nitrado server each + better handling for NitradoAPI

This commit is contained in:
SowinskiBraeden committed 2024-04-04 20:11:48 -07:00
1 parent 71d03ffa72
commit 55c8a9ee7f
33 files changed
+888 -1028

No files matched your search

+8
View File
@@ -59,6 +59,14 @@ module.exports = {
*/
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)) {
const warnNitradoNotInitialized = new EmbedBuilder()
.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.");
return interaction.send({ embeds: [warnNitradoNotInitialized], flags: (1 << 6) });
}
let banking;
if (args[0].name == 'set' || args[0].name == 'pay') {
banking = await client.dbo.collection("users").findOne({"user.userID": interaction.member.user.id}).then(banking => banking);