set income

This commit is contained in:
SowinskiBraeden committed 2022-07-14 17:34:14 -07:00
1 parent 7d4a11f216
commit 9216774bde
2 files changed
+88 -2

No files matched your search

+6 -2
View File
@@ -122,7 +122,7 @@ class QuarksBot extends Client {
let serverID = GuildId;
let customChannelStatus, allowedChannels;
let actionChannel, tweetChannel;
let startingBalance;
let startingBalance, incomeRoles;
let guild = await this.dbo.collection("guilds").findOne({"server.serverID":GuildId}).then(guild => guild);
// If guild not found, generate guild default
@@ -135,6 +135,7 @@ class QuarksBot extends Client {
actionChannel: null,
tweetChannel: null,
startingBalance: 1000.00,
incomeRoles: [],
}
}
this.dbo.collection("guilds").insertOne(newGuild, function(err, res) {
@@ -145,12 +146,14 @@ class QuarksBot extends Client {
actionChannel = newGuild.server.actionChannel;
tweetChannel = newGuild.server.tweetChannel;
startingBalance = newGuild.server.startingBalance;
incomeRoles = newGuild.server.incomeRoles;
} else {
customChannelStatus = guild.server.hasCustomChannels;
allowedChannels = guild.server.allowedChannels;
actionChannel = guild.server.actionChannel;
tweetChannel = guild.server.tweetChannel;
startingBalance = guild.server.startingBalance;
incomeRoles = guild.server.incomeRoles;
}
let guildData = {
serverID: serverID,
@@ -158,7 +161,8 @@ class QuarksBot extends Client {
allowedChannels: allowedChannels,
actionChannel: actionChannel,
tweetChannel: tweetChannel,
startingBalance: startingBalance
startingBalance: startingBalance,
incomeRoles: incomeRoles,
}
return guildData;
}