settings view

This commit is contained in:
SowinskiBraeden committed 2022-08-01 12:50:35 -07:00
1 parent 3653b4776b
commit be338ece36
2 files changed
+37 -4

No files matched your search

+7 -3
View File
@@ -125,7 +125,7 @@ class QuarksBot extends Client {
let serverID = GuildId;
let customChannelStatus, allowedChannels;
let actionChannel, tweetChannel;
let startingBalance, incomeRoles;
let startingBalance, incomeRoles, incomeRoleStatus;
let guild = await this.dbo.collection("guilds").findOne({"server.serverID":GuildId}).then(guild => guild);
// If guild not found, generate guild default
@@ -138,24 +138,27 @@ class QuarksBot extends Client {
actionChannel: null,
tweetChannel: null,
startingBalance: 1000.00,
hasIncomeRoles: false,
incomeRoles: [],
}
}
this.dbo.collection("guilds").insertOne(newGuild, function(err, res) {
if (err) throw err;
});
customChannelStatus = newGuild.server.hasCustomChannels;
customChannelStatus = false;
allowedChannels = newGuild.server.allowedChannels;
actionChannel = newGuild.server.actionChannel;
tweetChannel = newGuild.server.tweetChannel;
startingBalance = newGuild.server.startingBalance;
incomeRoleStatus = newGuild.server.hasIncomeRoles
incomeRoles = newGuild.server.incomeRoles;
} else {
customChannelStatus = guild.server.hasCustomChannels;
customChannelStatus = guild.server.allowedChannels.length > 0 ? true : false;
allowedChannels = guild.server.allowedChannels;
actionChannel = guild.server.actionChannel;
tweetChannel = guild.server.tweetChannel;
startingBalance = guild.server.startingBalance;
incomeRoleStatus = guild.server.incomeRoles.length > 0 ? true : false;
incomeRoles = guild.server.incomeRoles;
}
let guildData = {
@@ -165,6 +168,7 @@ class QuarksBot extends Client {
actionChannel: actionChannel,
tweetChannel: tweetChannel,
startingBalance: startingBalance,
incomeRoleStatus: incomeRoleStatus,
incomeRoles: incomeRoles,
}
return guildData;