debug management

This commit is contained in:
SowinskiBraeden committed 2022-07-25 21:58:13 -07:00
1 parent 74475e6549
commit 631a348717
22 files changed
+100 -24

No files matched your search

+2 -1
View File
@@ -1,7 +1,8 @@
const { MessageEmbed } = require('discord.js');
module.exports = {
name: "add-monet",
name: "add-money",
debug: false,
description: "change the starting balance for the server",
usage: "[user] [amount]",
permissions: {
+1
View File
@@ -2,6 +2,7 @@ const { MessageEmbed, Guild } = require('discord.js');
module.exports = {
name: "bal",
debug: false,
description: "View balance",
usage: "[user]",
permissions: {
+1
View File
@@ -2,6 +2,7 @@ const { MessageEmbed } = require('discord.js');
module.exports = {
name: "deposit",
debug: false,
description: "deposit cash to your balance",
usage: "[amount]",
permissions: {
+1
View File
@@ -3,6 +3,7 @@ const Inventory = require('../structures/inventory');
module.exports = {
name: "give",
debug: false,
description: "give user an amount of cash",
usage: "[amount]",
permissions: {
+4 -1
View File
@@ -2,6 +2,7 @@ const { MessageEmbed } = require("discord.js");
module.exports = {
name: "help",
debug: false,
description: "Get information on a specific command",
usage: "[command]",
permissions: {
@@ -30,7 +31,9 @@ module.exports = {
if (GuildDB.customChannelStatus==true&&!GuildDB.allowedChannels.includes(interaction.channel_id)) {
return interaction.send(`You are not allowed to use the bot in this channel.`);
}
let Commands = client.commands.map((cmd) =>
let Commands = client.commands.filter((cmd) => {
return !cmd.debug
}).map((cmd) =>
`\`/${cmd.name}${cmd.usage ? " " + cmd.usage : ""}\` - ${cmd.description}`
);
+1
View File
@@ -2,6 +2,7 @@ const { MessageEmbed } = require('discord.js');
module.exports = {
name: "id-set",
debug: false,
description: "set a value on your wallet ID",
usage: "[firstname/lastname/dob] [value]",
permissions: {
+1
View File
@@ -4,6 +4,7 @@ const action = ['pick up', 'grab', 'get', 'aquire', 'obtain', 'gain', 'take poss
module.exports = {
name: "inventory-add",
debug: false,
description: "add item to inventory",
usage: "[item]",
permissions: {
+1
View File
@@ -5,6 +5,7 @@ const action = ['ditch', 'drop', 'forget', 'throw out', 'leave', 'set down', 'le
module.exports = {
name: "inventory",
debug: false,
description: "Manage your inventory",
usage: "[command]",
permissions: {
+1
View File
@@ -2,6 +2,7 @@ const { MessageEmbed } = require('discord.js');
module.exports = {
name: "me",
debug: false,
description: "Send a message stating your characters action",
usage: "[action]",
permissions: {
+1
View File
@@ -2,6 +2,7 @@ const { MessageEmbed } = require('discord.js');
module.exports = {
name: "ping",
debug: true,
description: "Test bot activity",
usage: "",
permissions: {
+1
View File
@@ -2,6 +2,7 @@ const { MessageEmbed, MessageActionRow, MessageButton } = require('discord.js');
module.exports = {
name: "remove-channel",
debug: false,
description: "Remove channel",
usage: "[channel type]",
permissions: {
+1
View File
@@ -2,6 +2,7 @@ const { MessageEmbed, Guild } = require('discord.js');
module.exports = {
name: "remove-income",
debug: false,
description: "remove an income role",
usage: "[role] [amount daily]",
permissions: {
+1
View File
@@ -3,6 +3,7 @@ const Inventory = require('../structures/inventory');
module.exports = {
name: "search",
debug: false,
description: "Search a users inventory",
usage: "[user]",
permissions: {
+1
View File
@@ -2,6 +2,7 @@ const { MessageEmbed } = require('discord.js');
module.exports = {
name: "set-channel",
debug: false,
description: "set a channel",
usage: "[channel type] [channel]",
permissions: {
+1
View File
@@ -2,6 +2,7 @@ const { MessageEmbed, Guild } = require('discord.js');
module.exports = {
name: "set-income",
debug: false,
description: "set a role to recieve income when working",
usage: "[role] [amount daily]",
permissions: {
+1
View File
@@ -2,6 +2,7 @@ const { MessageEmbed } = require('discord.js');
module.exports = {
name: "set-starting-balance",
debug: false,
description: "change the starting balance for the server",
usage: "[amount]",
permissions: {
+44
View File
@@ -0,0 +1,44 @@
const { MessageEmbed } = require('discord.js');
module.exports = {
name: "stats",
debug: true,
description: "check bot statistics",
usage: "",
permissions: {
channel: ["VIEW_CHANNEL", "SEND_MESSAGES", "EMBED_LINKS"],
member: [],
},
SlashCommand: {
options: [],
/**
*
* @param {require("../structures/QuarksBot")} client
* @param {import("discord.js").MessageCreate} message
* @param {string[]} args
* @param {*} param3
*/
run: async (client, interaction, args, { GuildDB }) => {
if (GuildDB.customChannelStatus==true&&!GuildDB.allowedChannels.includes(interaction.channel_id)) {
return interaction.send(`You are not allowed to use the bot in this channel.`);
}
const data = `
\`\`\`
*******************************
* Channels *${client.padding(client.channels.cache.size)}*
*******************************
* Servers *${client.padding(client.guilds.cache.size)}*
*******************************
* Users *${client.padding(client.users.cache.size)}
* *****************************
\`\`\`
`
const stats = new MessageEmbed()
.setColor(client.config.EmbedColor)
.setTitle('Statistics')
.setDescription(data)
},
},
}
+1
View File
@@ -2,6 +2,7 @@ const { MessageEmbed } = require('discord.js');
module.exports = {
name: "tweet",
debug: false,
description: "Tweet your thoughts to the local twitter page",
usage: "[message]",
permissions: {
+1
View File
@@ -3,6 +3,7 @@ const inventory = require('./inventory');
module.exports = {
name: "withdraw",
debug: false,
description: "withdraw cash from balance",
usage: "[amount]",
permissions: {
+30
View File
@@ -0,0 +1,30 @@
const { MessageEmbed } = require('discord.js');
module.exports = {
name: "work",
debug: false,
description: "work to earn your income",
usage: "",
permissions: {
channel: ["VIEW_CHANNEL", "SEND_MESSAGES", "EMBED_LINKS"],
member: [],
},
SlashCommand: {
options: [],
/**
*
* @param {require("../structures/QuarksBot")} client
* @param {import("discord.js").MessageCreate} message
* @param {string[]} args
* @param {*} param3
*/
run: async (client, interaction, args, { GuildDB }) => {
if (GuildDB.customChannelStatus==true&&!GuildDB.allowedChannels.includes(interaction.channel_id)) {
return interaction.send(`You are not allowed to use the bot in this channel.`);
}
console.log(interaction.member)
return interaction.send('Debugging...')
},
},
}
+2 -22
View File
@@ -31,26 +31,6 @@ module.exports = async (client, message) => {
client.commands.find((x) => x.aliases && x.aliases.includes(command));
//Executing the codes when we get the command or aliases
if (cmd) {
if (
(cmd.permissions &&
cmd.permissions.channel &&
!message.channel
.permissionsFor(client.user)
.has(cmd.permissions.channel)) ||
(cmd.permissions &&
cmd.permissions.member &&
!message.channel
.permissionsFor(message.member)
.has(cmd.permissions.member))
)
return client.sendError(
message.channel,
"Missing Permissions!" + GuildDB.DJ
? " You need the correct role to access this command."
: ""
);
cmd.run(client, message, args, { GuildDB });
client.CommandsRan++;
} else return;
if (cmd) cmd.run(client, message, args, { GuildDB });
else return;
};
+2
View File
@@ -72,6 +72,8 @@ class QuarksBot extends Client {
exists(n) {return null != n && undefined != n && "" != n}
padding(data) {return (` ${data}` + " ".repeat((9-data.toString().length)))}
LoadCommands() {
let CommandsDir = path.join(__dirname, '..', 'commands');
fs.readdir(CommandsDir, (err, files) => {