update help settings

This commit is contained in:
SowinskiBraeden committed 2022-08-28 13:02:33 -07:00
1 parent ef8bd15f34
commit c6bc65f233
5 files changed
+171 -78

No files matched your search

+31 -48
View File
@@ -1,4 +1,5 @@
const { EmbedBuilder } = require("discord.js");
const { EmbedBuilder, ActionRowBuilder, SelectMenuBuilder } = require("discord.js");
const settings = require('../config/settingsHelp');
module.exports = {
name: "help",
@@ -109,58 +110,40 @@ module.exports = {
return interaction.send(embed);
}
} else if (args[0].name == 'settings') {
const settingsHelp = new EmbedBuilder()
.setColor(client.config.Colors.Default)
.setTitle('Using settings command to configure your guild')
.setDescription(`Some features of QuarksBot require, or recommend settings.
**__1. Action Channel:__**
Optionally you can have a dedicated channel for the \`/me\` command, keeping your channels clean.
Use \`/settings action_channel set [channel]\` to configure this setting.
or...
let settingsMenu = new SelectMenuBuilder()
.setCustomId(`settingSelect-${interaction.member.user.id}`)
.setPlaceholder('Select Setting you require help with')
use \`/settings action_channel remove [channel]\` to remove your dedicated action channel.
settings.settings.map((setting) => {
settingsMenu.addOptions({
label: setting.name,
description: 'Get help with this setting',
value: setting.name,
})
})
const SelectSettings = new ActionRowBuilder().addComponents(settingsMenu);
**__2. Tweet Channel:__**
Optionally you can have a dedicated channel for the \`/tweet\` command, keeping your channels clean.
Use \`/settings tweet_channel set [channel]\` to configure this setting.
or ...
use \`/settings tweet_channel remove [channel]\` to remove your dedicated tweet channel.
**__3. Allowed Channels:__**
If you want to limit what channels people can use QuarksBot,
use \`/settings allowed_channels add [channel]\` to add a channel to a list of allowed channels.
or...
interaction.send({ components: [SelectSettings], flags: (1 << 6) });
use \`/settings allowed_channels remove [channel]\` to remove a channel from the list of allowed channels.
client.on("interactionCreate", async MenuInteraction => {
if(!MenuInteraction.isSelectMenu()) return;
if (!MenuInteraction.customId.endsWith(MenuInteraction.member.user.id)) {
return MenuInteraction.reply({
content: "This button is not for you",
flags: (1 << 6)
})
}
**__4. Starting Balance:__**
When a user joins your server, they get a starting balance. This can be configured,
use \`/settings starting_balance [amount]\` to set the starting balance.
**__5. Income Roles:__**
The \`/work\` command required a user to have a role that has a defined income.
Use \`/settings set_income_role [role] [amount]\` to add a role to the list of roles to earn income.
or...
use \`/settings remove_income_role [role]\` to remove a role from the list of roles to earn income.
**Note:**
- Users may only use \`/work\` command once every 24 hours.
- If a user has more than one role that can earn income, the bot will pay them for the role with the highest income.
- The amount you enter for a role to earn is the amount they will be paid when using the \`/work\` command. Be sure that the amount you choose is a daily income, not hourly, etc.
**__6. Viewing Settings:__**
If you are unsure of your current configured settings, use \`/settings view\` to get a detailed view of your configurations.`);
return interaction.send({ embeds: [settingsHelp] });
const setting = settings.settings.find(setting => setting.name === MenuInteraction.values[0]);
const settingEmbed = new EmbedBuilder()
.setColor(client.config.Colors.Default)
.setTitle(setting.name)
.setDescription(setting.description)
return MenuInteraction.update({ embeds: [settingEmbed], components: [] });
});
} else if (args[0].name == 'support') {
const supportEmbed = new EmbedBuilder()
.setColor(client.config.Colors.Default)
+6 -6
View File
@@ -235,7 +235,7 @@ module.exports = {
interaction.send({ components: [opt], flags: (1 << 6) })
client.once("interactionCreate", async MenuInteraction => {
client.on("interactionCreate", async MenuInteraction => {
if(!MenuInteraction.isSelectMenu()) return;
if (!MenuInteraction.customId.endsWith(MenuInteraction.member.user.id)) {
return MenuInteraction.reply({
@@ -294,7 +294,7 @@ module.exports = {
}
});
return;
} else if (args[0].name == 'wallet') {
// Display wallet
@@ -447,7 +447,7 @@ module.exports = {
interaction.send({ components: [opt], flags: (1 << 6) })
client.once("interactionCreate", async MenuInteraction => {
client.on("interactionCreate", async MenuInteraction => {
if(!MenuInteraction.isSelectMenu()) return;
if (!MenuInteraction.customId.endsWith(MenuInteraction.member.user.id)) {
return MenuInteraction.reply({
@@ -518,7 +518,7 @@ module.exports = {
return MenuInteraction.update({ embeds: [successEmbed], components: [] });
});
return;
} else if (args[0].name == 'clear') {
const prompt = new EmbedBuilder()
@@ -540,7 +540,7 @@ module.exports = {
interaction.send({ embeds: [prompt], components: [opt], flags: (1 << 6) });
client.once("interactionCreate", ButtonInteraction => {
client.on("interactionCreate", ButtonInteraction => {
if(!ButtonInteraction.isButton()) return;
const queryString = ButtonInteraction.customId;
if (!queryString.endsWith(ButtonInteraction.member.user.id)) {
@@ -571,7 +571,7 @@ module.exports = {
return ButtonInteraction.update({ embeds: [successEmbed], components: [] });
});
return;
}
},
},
+3 -3
View File
@@ -22,7 +22,7 @@ module.exports = {
/**
*
* @param {require("../structures/QuarksBot")} client
* @param {import("discord.js").MessageCreate} message
* @param {import("discord.js").Message} message
* @param {string[]} args
* @param {*} param3
*/
@@ -55,7 +55,7 @@ module.exports = {
interaction.send({ embeds: [prompt], components: [opt], flags: (1 << 6) });
client.once("interactionCreate", async (ButtonInteraction) => {
client.on("interactionCreate", async (ButtonInteraction) => {
if(!ButtonInteraction.isButton()) return;
const queryString = ButtonInteraction.customId;
if (!queryString.endsWith(ButtonInteraction.member.user.id)) {
@@ -115,7 +115,7 @@ module.exports = {
return ButtonInteraction.update({ embeds: [successEmbed], components: [] });
}
});
return;
},
},
}
+21 -21
View File
@@ -5,7 +5,7 @@ module.exports = {
name: "settings",
debug: false,
description: "Configure your server settings",
usage: "[opt], flags: (1 << 6) [action] [value]",
usage: "[opt] [action] [value]",
permissions: {
channel: ["VIEW_CHANNEL", "SEND_MESSAGES", "EMBED_LINKS"],
member: ["MANAGE_GUILD"],
@@ -409,7 +409,7 @@ module.exports = {
interaction.send({ embeds: [prompt], components: [opt], flags: (1 << 6) });
client.once("interactionCreate", ButtonInteraction => {
client.on("interactionCreate", ButtonInteraction => {
if(!ButtonInteraction.isButton()) return;
const queryString = ButtonInteraction.customId;
if (!queryString.endsWith(ButtonInteraction.member.user.id)) {
@@ -439,7 +439,7 @@ module.exports = {
return ButtonInteraction.update({ content: '', embeds: [successEmbed], components: [] });
});
return;
} else console.log('exception?');
} else if (args[0].name == 'action_channel') {
@@ -487,7 +487,7 @@ module.exports = {
interaction.send({ embeds: [prompt], components: [opt], flags: (1 << 6) });
client.once("interactionCreate", ButtonInteraction => {
client.on("interactionCreate", ButtonInteraction => {
if(!ButtonInteraction.isButton()) return;
const queryString = ButtonInteraction.customId;
if (!queryString.endsWith(ButtonInteraction.member.user.id)) {
@@ -517,7 +517,7 @@ module.exports = {
return ButtonInteraction.update({ content: '', embeds: [successEmbed], components: [] });
});
return;
}
} else if (args[0].name == 'tweet_channel') {
@@ -565,7 +565,7 @@ module.exports = {
interaction.send({ embeds: [prompt], components: [opt], flags: (1 << 6) });
client.once("interactionCreate", ButtonInteraction => {
client.on("interactionCreate", ButtonInteraction => {
if(!ButtonInteraction.isButton()) return;
const queryString = ButtonInteraction.customId;
if (!queryString.endsWith(ButtonInteraction.member.user.id)) {
@@ -595,7 +595,7 @@ module.exports = {
return ButtonInteraction.update({ content: '', embeds: [successEmbed], components: [] });
});
return;
}
} else if (args[0].name == 'adverts_channel') {
@@ -643,7 +643,7 @@ module.exports = {
interaction.send({ embeds: [prompt], components: [opt], flags: (1 << 6) });
client.once("interactionCreate", ButtonInteraction => {
client.on("interactionCreate", ButtonInteraction => {
if(!ButtonInteraction.isButton()) return;
const queryString = ButtonInteraction.customId;
if (!queryString.endsWith(ButtonInteraction.member.user.id)) {
@@ -673,7 +673,7 @@ module.exports = {
return ButtonInteraction.update({ content: '', embeds: [successEmbed], components: [] });
});
return;
}
} else if (args[0].name == 'dispatcher_channel') {
@@ -722,7 +722,7 @@ module.exports = {
interaction.send({ embeds: [prompt], components: [opt], flags: (1 << 6) });
client.once("interactionCreate", ButtonInteraction => {
client.on("interactionCreate", ButtonInteraction => {
if(!ButtonInteraction.isButton()) return;
const queryString = ButtonInteraction.customId;
if (!queryString.endsWith(ButtonInteraction.member.user.id)) {
@@ -752,7 +752,7 @@ module.exports = {
return ButtonInteraction.update({ content: '', embeds: [successEmbed], components: [] });
});
return;
}
} else if (args[0].name == 'starting_balance') {
@@ -850,7 +850,7 @@ module.exports = {
interaction.send({ embeds: [prompt], components: [opt], flags: (1 << 6) });
client.once("interactionCreate", ButtonInteraction => {
client.on("interactionCreate", ButtonInteraction => {
if(!ButtonInteraction.isButton()) return;
const queryString = ButtonInteraction.customId;
if (!queryString.endsWith(ButtonInteraction.member.user.id)) {
@@ -880,7 +880,7 @@ module.exports = {
return ButtonInteraction.update({ content: '', embeds: [successEmbed], components: [] });
});
return;
}
}
@@ -924,7 +924,7 @@ module.exports = {
interaction.send({ embeds: [prompt], components: [opt], flags: (1 << 6) });
client.once("interactionCreate", ButtonInteraction => {
client.on("interactionCreate", ButtonInteraction => {
if(!ButtonInteraction.isButton()) return;
const queryString = ButtonInteraction.customId;
if (!queryString.endsWith(ButtonInteraction.member.user.id)) {
@@ -954,7 +954,7 @@ module.exports = {
return ButtonInteraction.update({ content: '', embeds: [successEmbed], components: [] });
});
return;
}
} else if (args[0].name == 'officer_role') {
@@ -998,7 +998,7 @@ module.exports = {
interaction.send({ embeds: [prompt], components: [opt], flags: (1 << 6) });
client.once("interactionCreate", ButtonInteraction => {
client.on("interactionCreate", ButtonInteraction => {
if(!ButtonInteraction.isButton()) return;
const queryString = ButtonInteraction.customId;
if (!queryString.endsWith(ButtonInteraction.member.user.id)) {
@@ -1028,7 +1028,7 @@ module.exports = {
return ButtonInteraction.update({ content: '', embeds: [successEmbed], components: [] });
});
return;
}
} else if (args[0].name == 'dispatcher_role') {
@@ -1072,7 +1072,7 @@ module.exports = {
interaction.send({ embeds: [prompt], components: [opt], flags: (1 << 6) });
client.once("interactionCreate", ButtonInteraction => {
client.on("interactionCreate", ButtonInteraction => {
if(!ButtonInteraction.isButton()) return;
const queryString = ButtonInteraction.customId;
if (!queryString.endsWith(ButtonInteraction.member.user.id)) {
@@ -1103,7 +1103,7 @@ module.exports = {
return ButtonInteraction.update({ content: '', embeds: [successEmbed], components: [] });
});
}
return;
} else if (args[0].name == 'bot_admin_role') {
@@ -1146,7 +1146,7 @@ module.exports = {
interaction.send({ embeds: [prompt], components: [opt], flags: (1 << 6) });
client.once("interactionCreate", ButtonInteraction => {
client.on("interactionCreate", ButtonInteraction => {
if(!ButtonInteraction.isButton()) return;
const queryString = ButtonInteraction.customId;
if (!queryString.endsWith(ButtonInteraction.member.user.id)) {
@@ -1177,7 +1177,7 @@ module.exports = {
return ButtonInteraction.update({ content: '', embeds: [successEmbed], components: [] });
});
}
return;
} else if (args[0].name == 'only_officers_search') {
const setting = args[0].options[0];
client.dbo.collection("guilds").updateOne({"server.serverID":GuildDB.serverID}, {$set: {"server.onlyOfficersSearch": setting}}, function(err, res) {