add more settings/revamp some settings

This commit is contained in:
SowinskiBraeden committed 2022-08-02 22:41:18 -07:00
1 parent 10df5324d0
commit 9d8350f569
2 files changed
+443 -127

No files matched your search

+414 -68
View File
@@ -86,6 +86,31 @@ module.exports = {
} }
] ]
}, },
{
name: "adverts_channel",
description: "Set the channel for users to send commercial adverts",
value: "adverts_channel",
type: 1,
options: [
{
name: "set_or_remove",
description: "Set/remove channel",
value: "set_or_remove",
type: 3,
required: true,
choices: [
{ name: "set", value: "set" }, { name: "remove", value: "remove" },
]
},
{
name: "channel",
description: "The channel to configure",
value: "channel",
type: 7,
required: true,
}
]
},
{ {
name: "starting_balance", name: "starting_balance",
description: "Set the starting balance", description: "Set the starting balance",
@@ -105,6 +130,16 @@ module.exports = {
value: "set_income_role", value: "set_income_role",
type: 1, type: 1,
options: [ options: [
{
name: "set_or_remove",
description: "Set/remove role",
value: "set_or_remove",
type: 3,
required: true,
choices: [
{ name: "set", value: "set" }, { name: "remove", value: "remove" },
]
},
{ {
name: "role", name: "role",
description: "Role for this income", description: "Role for this income",
@@ -117,24 +152,59 @@ module.exports = {
description: "The amount to earn in 1 day of work", description: "The amount to earn in 1 day of work",
value: 120.00, value: 120.00,
type: 10, type: 10,
required: true, required: false,
} }
], ],
}, },
{ {
name: "remove_income_role", name: "commercial_role",
description: "Remove a role from earning income", description: "Set/remove commercial role",
value: "remove_income_role", value: "commercial_role",
type: 1, type: 1,
options: [ options: [
{
name: "set_or_remove",
description: "Set/remove role",
value: "set_or_remove",
type: 3,
required: true,
choices: [
{ name: "set", value: "set" }, { name: "remove", value: "remove" },
]
},
{ {
name: "role", name: "role",
description: "Role to remove", description: "Role to set or remove",
value: "role", value: "role",
type: 8, type: 8,
required: true, required: true,
}, },
], ]
},
{
name: "officer_role",
description: "Set/remove officer role",
value: "officer_role",
type: 1,
options: [
{
name: "set_or_remove",
description: "Set/remove role",
value: "set_or_remove",
type: 3,
required: true,
choices: [
{ name: "set", value: "set" }, { name: "remove", value: "remove" },
]
},
{
name: "role",
description: "Role to set or remove",
value: "role",
type: 8,
required: true,
},
]
}, },
{ {
name: "view", name: "view",
@@ -360,7 +430,7 @@ module.exports = {
const successEmbed = new MessageEmbed() const successEmbed = new MessageEmbed()
.setColor("GREEN") .setColor("GREEN")
.setTitle(`Successfully set <#${channelid}> for actions.`) .setTitle(`Successfully set <#${channelid}> for tweets.`)
return interaction.send({ embeds: [successEmbed] }); return interaction.send({ embeds: [successEmbed] });
} else if (args[0].options[0].value == 'remove') { } else if (args[0].options[0].value == 'remove') {
@@ -415,6 +485,86 @@ module.exports = {
return; return;
} }
} else if (args[0].name == 'adverts_channel') {
const channelid = args[0].options[1].value;
if (args[0].options[0].value == 'set') {
const guild = await client.dbo.collection("guilds").findOne({"server.serverID":interaction.guild.id}).then(guild => guild);
const channelSetting = guild.server.tweetChannel;
const presetEmbed = new MessageEmbed()
.setColor(client.config.EmbedColor)
.setDescription(`The channel <#${channelid}> has already been set for advertisements.`)
if (channelSetting == channelid) return interaction.send({ embeds: [presetEmbed] });
client.dbo.collection("guilds").updateOne({"server.serverID":interaction.guild.id},{$set:{"server.advertsChannel":channelid}},function(err, res) {
if (err) {
client.log(err);
const embed = new MessageEmbed()
.setDescriptions(`**Internal Error:** ${err}\nContact the Developers\nhttps://discord.gg/YCXhvy9uZw`)
.setColor("RED")
return interaction.send({ embeds: [embed] });
}
});
const successEmbed = new MessageEmbed()
.setColor("GREEN")
.setTitle(`Successfully set <#${channelid}> for advertisements.`)
return interaction.send({ embeds: [successEmbed] });
} else if (args[0].options[0].value == 'remove') {
const prompt = new MessageEmbed()
.setTitle(`Are you sure you want to stop using this channel for advertisements?`)
.setColor(client.config.EmbedColor)
const opt = new MessageActionRow()
.addComponents(
new MessageButton()
.setCustomId(`yes-${interaction.member.user.id}`)
.setLabel("Yes")
.setStyle("DANGER"),
new MessageButton()
.setCustomId(`no-${interaction.member.user.id}`)
.setLabel("No")
.setStyle("SUCCESS")
)
interaction.send({ embeds: [prompt], components: [opt] });
client.on("interactionCreate", ButtonInteraction => {
if(!ButtonInteraction.isButton()) return;
const queryString = ButtonInteraction.customId;
if (!queryString.endsWith(ButtonInteraction.member.user.id)) {
return ButtonInteraction.reply({
content: "This button is not for you",
ephemeral: true
})
}
let action = '';
if (queryString==`yes-${interaction.member.user.id}`) {
action = 'removed';
client.dbo.collection("guilds").updateOne({"server.serverID":ButtonInteraction.guild.id},{$set:{"server.advertsChannel": null}},function(err, res) {
if (err) {
client.log(err);
const embed = new MessageEmbed()
.setDescriptions(`**Internal Error:** ${err}\nContact the Developers\nhttps://discord.gg/YCXhvy9uZw`)
.setColor("RED")
return interaction.send({ embeds: [embed] });
}
});
} else if (queryString==`no-${interaction.member.user.id}`) action = 'kept';
const successEmbed = new MessageEmbed()
.setColor("GREEN")
.setTitle(`Successfully ${action} channel.`)
return ButtonInteraction.update({ content: '', embeds: [successEmbed], components: [] });
});
return;
}
} else if (args[0].name == 'starting_balance') { } else if (args[0].name == 'starting_balance') {
client.dbo.collection("guilds").updateOne({"server.serverID": GuildDB.serverID}, {"server.startingBalance":args[0].options[0].value}, function(err, res) { client.dbo.collection("guilds").updateOne({"server.serverID": GuildDB.serverID}, {"server.startingBalance":args[0].options[0].value}, function(err, res) {
if (err) { if (err) {
@@ -434,88 +584,281 @@ module.exports = {
return interaction.send({ embeds: [successEmbed] }); return interaction.send({ embeds: [successEmbed] });
} else if (args[0].name == 'set_income_role') { } else if (args[0].name == 'set_income_role') {
if (args[0].options[1].value <= 0) { if (args[0].options[0].value == 'set') {
let embed = new MessageEmbed() if (!args[0].options[2]) {
.setDescriptions('**Error Notice:** Amount cannot be $0 or less than $0.') let embed = new MessageEmbed()
.setColor("RED"); .setDescriptions('**Error Notice:** Please provide an income amount.')
.setColor("RED");
return interaction.send({ embeds: [embed] });
} return interaction.send({ embeds: [embed] });
const searchIndex = GuildDB.incomeRoles.findIndex((role) => role.role==args[0].options[0].value);
if (searchIndex == -1) {
const newIncome = {
role: args[0].options[0].value,
income: args[0].options[1].value,
} }
client.dbo.collection("guilds").updateOne({"server.serverID":GuildDB.serverID}, {$push: {"server.incomeRoles":newIncome}}, function(err, res) { if (args[0].options[2].value <= 0) {
if (err) { let embed = new MessageEmbed()
client.log(err); .setDescriptions('**Error Notice:** Amount cannot be $0 or less than $0.')
const embed = new MessageEmbed() .setColor("RED");
.setDescriptions(`**Internal Error:** ${err}\nContact the Developers\nhttps://discord.gg/YCXhvy9uZw`)
.setColor("RED")
return interaction.send({ embeds: [embed] }); return interaction.send({ embeds: [embed] });
} }
});
} else {
client.dbo.collection("guilds").updateOne({"server.serverID":Guild.serverID, "server.incomeRoles.role": args[0].options[0].value},
{$set: {"server.incomeRoles.$.income": args[0].options[1].value}}, function(err, res) {
if (err) {
client.log(err);
const embed = new MessageEmbed()
.setDescriptions(`**Internal Error:** ${err}\nContact the Developers\nhttps://discord.gg/YCXhvy9uZw`)
.setColor("RED")
return interaction.send({ embeds: [embed] }); const searchIndex = GuildDB.incomeRoles.findIndex((role) => role.role==args[0].options[1].value);
if (searchIndex == -1) {
const newIncome = {
role: args[0].options[1].value,
income: args[0].options[2].value,
} }
});
} client.dbo.collection("guilds").updateOne({"server.serverID":GuildDB.serverID}, {$push: {"server.incomeRoles":newIncome}}, function(err, res) {
if (err) {
const successEmbed = new MessageEmbed() client.log(err);
.setDescription(`Successfully updated <@&${args[0].options[0].value}>'s income to $${args[0].options[1].value}`) const embed = new MessageEmbed()
.setColor('GREEN'); .setDescriptions(`**Internal Error:** ${err}\nContact the Developers\nhttps://discord.gg/YCXhvy9uZw`)
.setColor("RED")
return interaction.send({ embeds: [successEmbed] });
} else if (args[0].name == 'remove_income_role') { return interaction.send({ embeds: [embed] });
const searchIndex = GuildDB.incomeRoles.findIndex((role) => role.role==args[0].options[0].value); }
if (searchIndex == -1) { });
const errorEmbed = new MessageEmbed() } else {
.setDescription('**Error Notice:** Role not found') client.dbo.collection("guilds").updateOne({"server.serverID":Guild.serverID, "server.incomeRoles.role": args[0].options[1].value},
.setColor("RED"); {$set: {"server.incomeRoles.$.income": args[0].options[2].value}}, function(err, res) {
if (err) {
client.log(err);
const embed = new MessageEmbed()
.setDescriptions(`**Internal Error:** ${err}\nContact the Developers\nhttps://discord.gg/YCXhvy9uZw`)
.setColor("RED")
return interaction.send({ embeds: [embed] });
}
});
}
const perform = searchIndex = -1 ? 'set' : 'updated';
const successEmbed = new MessageEmbed()
.setDescription(`Successfully ${perform} <@&${args[0].options[1].value}>'s income to $${args[0].options[2].value}`)
.setColor('GREEN');
return interaction.send({ embeds: [successEmbed] });
return interaction.send({ embeds: [errorEmbed] }); } else if (args[0].options[0].value == 'remove') {
} else { const searchIndex = GuildDB.incomeRoles.findIndex((role) => role.role==args[0].options[1].value);
client.dbo.collection("guilds").updateOne({"server.serverID":Guild.serverID}, {$pull: {"server.incomeRoles": args[0].options[0].value}}, function(err, res) { if (searchIndex == -1) {
const errorEmbed = new MessageEmbed()
.setDescription('**Error Notice:** Role not found')
.setColor("RED");
return interaction.send({ embeds: [errorEmbed] });
} else {
const prompt = new MessageEmbed()
.setTitle(`Are you sure you want to remove this role as an income?`)
.setColor(client.config.EmbedColor)
const opt = new MessageActionRow()
.addComponents(
new MessageButton()
.setCustomId(`yes-${interaction.member.user.id}`)
.setLabel("Yes")
.setStyle("DANGER"),
new MessageButton()
.setCustomId(`no-${interaction.member.user.id}`)
.setLabel("No")
.setStyle("SUCCESS")
)
interaction.send({ embeds: [prompt], components: [opt] });
client.on("interactionCreate", ButtonInteraction => {
if(!ButtonInteraction.isButton()) return;
const queryString = ButtonInteraction.customId;
if (!queryString.endsWith(ButtonInteraction.member.user.id)) {
return ButtonInteraction.reply({
content: "This button is not for you",
ephemeral: true
})
}
let action = '';
if (queryString==`yes-${interaction.member.user.id}`) {
action = 'removed';
client.dbo.collection("guilds").updateOne({"server.serverID":Guild.serverID}, {$pull: {"server.incomeRoles": args[0].options[1].value}}, function(err, res) {
if (err) {
client.log(err);
let embed = new MessageEmbed()
.setTitle(err)
.setColor("RED");
return interaction.send({ embeds: [embed] });
}
});
} else if (queryString==`no-${interaction.member.user.id}`) action = 'kept';
const successEmbed = new MessageEmbed()
.setColor("GREEN")
.setTitle(`Successfully ${action} <@&${args[0].options[0].value}> from income roles.`)
return ButtonInteraction.update({ content: '', embeds: [successEmbed], components: [] });
});
return;
}
}
} else if (args[0].name == 'commercial_role') {
if (args[0].options[0].value == 'set') {
client.dbo.collection("guilds").updateOne({"server.serverID":Guild.serverID},{$set:{"server.commercialRole": args[0].options[1].value}}, function(err, res) {
if (err) { if (err) {
client.log(err); client.log(err);
let embed = new MessageEmbed() const embed = new MessageEmbed()
.setTitle(err) .setDescriptions(`**Internal Error:** ${err}\nContact the Developers\nhttps://discord.gg/YCXhvy9uZw`)
.setColor("RED"); .setColor("RED")
return interaction.send({ embeds: [embed] }); return interaction.send({ embeds: [embed] });
} }
}); });
const successEmbed = new MessageEmbed()
.setDescription(`Successfully set <@&${args[0].options[1].value}>'s as commercial role.\nUsers with this role can now create invoices and send advertisements.`)
.setColor('GREEN');
return interaction.send({ embeds: [successEmbed] });
} else if (args[0].options[0].value == 'remove') {
const prompt = new MessageEmbed()
.setTitle(`Are you sure you want to remove this role as commercial role?`)
.setColor(client.config.EmbedColor)
const opt = new MessageActionRow()
.addComponents(
new MessageButton()
.setCustomId(`yes-${interaction.member.user.id}`)
.setLabel("Yes")
.setStyle("DANGER"),
new MessageButton()
.setCustomId(`no-${interaction.member.user.id}`)
.setLabel("No")
.setStyle("SUCCESS")
)
interaction.send({ embeds: [prompt], components: [opt] });
client.on("interactionCreate", ButtonInteraction => {
if(!ButtonInteraction.isButton()) return;
const queryString = ButtonInteraction.customId;
if (!queryString.endsWith(ButtonInteraction.member.user.id)) {
return ButtonInteraction.reply({
content: "This button is not for you",
ephemeral: true
})
}
let action = '';
if (queryString==`yes-${interaction.member.user.id}`) {
action = 'removed';
client.dbo.collection("guilds").updateOne({"server.serverID":Guild.serverID}, {$set: {"server.commercialRole": null}}, function(err, res) {
if (err) {
client.log(err);
let embed = new MessageEmbed()
.setTitle(err)
.setColor("RED");
return interaction.send({ embeds: [embed] });
}
});
} else if (queryString==`no-${interaction.member.user.id}`) action = 'kept';
const successEmbed = new MessageEmbed()
.setColor("GREEN")
.setTitle(`Successfully ${action} <@&${args[0].options[0].value}> as commercial role.`)
return ButtonInteraction.update({ content: '', embeds: [successEmbed], components: [] });
});
return;
} }
let successEmbed = new MessageEmbed() } else if (args[0].name == 'officer_role') {
.setTitle('Success') if (args[0].options[0].value == 'set') {
.setDescription(`Successfully remoed <@&${args[0].options[0].value}> from income roles.`)
.setColor('GREEN');
return interaction.send({ embeds: [successEmbed] }); client.dbo.collection("guilds").updateOne({"server.serverID":Guild.serverID},{$set:{"server.officerRole": args[0].options[1].value}}, function(err, res) {
if (err) {
client.log(err);
const embed = new MessageEmbed()
.setDescriptions(`**Internal Error:** ${err}\nContact the Developers\nhttps://discord.gg/YCXhvy9uZw`)
.setColor("RED")
return interaction.send({ embeds: [embed] });
}
});
const successEmbed = new MessageEmbed()
.setDescription(`Successfully set <@&${args[0].options[1].value}>'s as officer role.\nUsers with this role can now fine other users.`)
.setColor('GREEN');
return interaction.send({ embeds: [successEmbed] });
} else if (args[0].options[0].value == 'remove') {
const prompt = new MessageEmbed()
.setTitle(`Are you sure you want to remove this role as officer role?`)
.setColor(client.config.EmbedColor)
const opt = new MessageActionRow()
.addComponents(
new MessageButton()
.setCustomId(`yes-${interaction.member.user.id}`)
.setLabel("Yes")
.setStyle("DANGER"),
new MessageButton()
.setCustomId(`no-${interaction.member.user.id}`)
.setLabel("No")
.setStyle("SUCCESS")
)
interaction.send({ embeds: [prompt], components: [opt] });
client.on("interactionCreate", ButtonInteraction => {
if(!ButtonInteraction.isButton()) return;
const queryString = ButtonInteraction.customId;
if (!queryString.endsWith(ButtonInteraction.member.user.id)) {
return ButtonInteraction.reply({
content: "This button is not for you",
ephemeral: true
})
}
let action = '';
if (queryString==`yes-${interaction.member.user.id}`) {
action = 'removed';
client.dbo.collection("guilds").updateOne({"server.serverID":Guild.serverID}, {$set: {"server.officerRole": null}}, function(err, res) {
if (err) {
client.log(err);
let embed = new MessageEmbed()
.setTitle(err)
.setColor("RED");
return interaction.send({ embeds: [embed] });
}
});
} else if (queryString==`no-${interaction.member.user.id}`) action = 'kept';
const successEmbed = new MessageEmbed()
.setColor("GREEN")
.setTitle(`Successfully ${action} <@&${args[0].options[0].value}> as officer role.`)
return ButtonInteraction.update({ content: '', embeds: [successEmbed], components: [] });
});
return;
}
} else if (args[0].name == 'view') { } else if (args[0].name == 'view') {
const tweetChannel = client.exists(GuildDB.tweetChannel) ? `\n╚➤ <#${GuildDB.tweetChannel}>` : ''; const tweetChannel = GuildDB.tweetChannel ? `\n╚➤ <#${GuildDB.tweetChannel}>` : '';
const tweetColor = client.exists(GuildDB.tweetChannel) ? '+ ' : '- '; const tweetColor = GuildDB.tweetChannel ? '+ ' : '- ';
const actionChannel = client.exists(GuildDB.actionChannel) ? `\n╚➤ <#${GuildDB.actionChannel}>` : ''; const actionChannel = GuildDB.actionChannel ? `\n╚➤ <#${GuildDB.actionChannel}>` : '';
const actionColor = client.exists(GuildDB.actionChannel) ? '+ ' : '- '; const actionColor = GuildDB.actionChannel ? '+ ' : '- ';
const advertsChannel = GuildDB.advertsChannel ? `\n╚➤ <#${GuildDB.advertsChannel}>` : ''
const advertsColor = GuildDB.advertsChannel ? '+ ' : '- ';
const channelsInfo = GuildDB.customChannelStatus ? '\n╚➤ \`/channels\` to view' : ''; const channelsInfo = GuildDB.customChannelStatus ? '\n╚➤ \`/channels\` to view' : '';
const channelColor = GuildDB.customChannelStatus ? '+ ' : '- '; const channelColor = GuildDB.customChannelStatus ? '+ ' : '- ';
const incomeInfo = GuildDB.incomeRoleStatus ? '\n╚➤ \`/work-roles\` to view' : ''; const incomeInfo = GuildDB.incomeRoleStatus ? '\n╚➤ \`/work-roles\` to view' : '';
const incomeColor = GuildDB.incomeRoleStatus ? '+ ' : '- '; const incomeColor = GuildDB.incomeRoleStatus ? '+ ' : '- ';
const commercialRole = GuildDB.commercialRole ? `\n╚➤ <@&${GuildDB.commercialRole}>` : '';
const commercialRoleColor = GuildDB.commercialRole ? '+ ' : '- ';
const officerRole = GuildDB.officerRole ? `\n╚➤ <@&${GuildDB.officerRole}>` : '';
const officerRoleColor = GuildDB.officerRole ? '+ ' : '- ';
const settingsEmbed = new MessageEmbed() const settingsEmbed = new MessageEmbed()
.setColor(client.config.EmbedColor) .setColor(client.config.EmbedColor)
.setTitle('Current Guild Configurations') .setTitle('Current Guild Configurations')
@@ -526,6 +869,9 @@ module.exports = {
{ name: 'Has Tweet Channel?', value: `\`\`\`diff\n${tweetColor}${client.exists(GuildDB.tweetChannel)}\`\`\`${tweetChannel}`, inline: true }, { name: 'Has Tweet Channel?', value: `\`\`\`diff\n${tweetColor}${client.exists(GuildDB.tweetChannel)}\`\`\`${tweetChannel}`, inline: true },
{ name: 'Has Action Channel?', value: `\`\`\`diff\n${actionColor}${client.exists(GuildDB.actionChannel)}\`\`\`${actionChannel}`, inline: true }, { name: 'Has Action Channel?', value: `\`\`\`diff\n${actionColor}${client.exists(GuildDB.actionChannel)}\`\`\`${actionChannel}`, inline: true },
{ name: 'Starting Balance', value: `\`\`\`arm\n$${GuildDB.startingBalance}\`\`\``, inline: true }, { name: 'Starting Balance', value: `\`\`\`arm\n$${GuildDB.startingBalance}\`\`\``, inline: true },
{ name: 'Has Adverts Channel?', value: `\`\`\`diff${advertsColor}${client.exists(GuildDB.advertsChannel)}\`\`\`${advertsChannel}`, inline: true },
{ name: 'Has Commercial Role?', value: `\`\`\`diff${commercialRoleColor}${client.exists(GuildDB.commercialRole)}\`\`\`${commercialRole}`, inline: true },
{ name: 'Has Officer Role?', value: `\`\`\`diff${officerRoleColor}${client.exists(GuildDB.officerRole)}\`\`\`${officerRole}`, inline: true },
); );
return interaction.send({ embeds: [settingsEmbed] }); return interaction.send({ embeds: [settingsEmbed] });
+29 -59
View File
@@ -136,74 +136,44 @@ class QuarksBot extends Client {
} }
async GetGuild(GuildId) { async GetGuild(GuildId) {
let serverID = GuildId;
let customChannelStatus, allowedChannels;
let actionChannel, tweetChannel;
let startingBalance, incomeRoles, incomeRoleStatus;
let guild = await this.dbo.collection("guilds").findOne({"server.serverID":GuildId}).then(guild => guild); let guild = await this.dbo.collection("guilds").findOne({"server.serverID":GuildId}).then(guild => guild);
// If guild not found, generate guild default // If guild not found, generate guild default
if (!guild) { if (!guild) {
let newGuild = { guild = {
server: { server: {
serverID: GuildId, serverID: GuildId,
hasCustomChannels: false, allowedChannels: [],
allowedChannels: [], actionChannel: null,
actionChannel: null, tweetChannel: null,
tweetChannel: null, advertsChannel: null,
startingBalance: 1000.00, startingBalance: 1000.00,
hasIncomeRoles: false, incomeRoles: [],
incomeRoles: [], commercialRole: null,
} officerRole: null,
} }
this.dbo.collection("guilds").insertOne(newGuild, function(err, res) {
if (err) throw err;
});
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.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;
} }
this.dbo.collection("guilds").insertOne(guild, function(err, res) {
if (err) throw err;
});
}
let guildData = { let guildData = {
serverID: serverID, serverID: GuildID,
customChannelStatus: customChannelStatus, customChannelStatus: guild.server.allowedChannels.length > 0 ? true : false,
allowedChannels: allowedChannels, allowedChannels: guild.server.allowedChannels,
actionChannel: actionChannel, actionChannel: guild.server.actionChannel,
tweetChannel: tweetChannel, tweetChannel: guild.server.tweetChannel,
startingBalance: startingBalance, advertsChannel: guild.server.advertsChannel,
incomeRoleStatus: incomeRoleStatus, startingBalance: guild.server.startingBalance,
incomeRoles: incomeRoles, incomeRoleStatus: guild.server.incomeRoles.length > 0 ? true : false,
incomeRoles: guild.server.incomeRoles,
commercialRole: guild.server.commercialRole,
officerRole: guild.server.officerRole,
} }
return guildData; return guildData;
} }
/*
This command is to verify a user
has the correct role to use a
command ie. has cop role to use
name-search
*/
async verifyUseCommand(serverID, rolesCache, isList) {
let { customRoleStatus } = await this.GetGuild(serverID)
if (customRoleStatus) {
let hasRole = await this.checkRoleStatus(rolesCache, serverID, isList);
if (hasRole) {
return true // User has role, can use command
} else return false // User does not have role, can't use command
} else return true // There is no role limits
}
log(Text) { log(Text) {
this.logger.log(Text); this.logger.log(Text);
} }