only show inventory view to author

This commit is contained in:
SowinskiBraeden committed 2022-08-05 13:19:59 -07:00
1 parent 5c2fafbd5e
commit e6c47b704d
3 files changed
+6 -42

No files matched your search

+1 -1
View File
@@ -211,7 +211,7 @@ module.exports = {
if (args[0].name == 'view') {
// Display Inventory
let inventoryEmbed = new MessageEmbed()
.setColor(client.config.EmbedColor)
.setTitle('Your Inventory')
-36
View File
@@ -1,36 +0,0 @@
/**
*
* @param {require("../structures/QuarksBot")} client
* @param {require("discord.js").message} message
* @returns {void} or nothing if you didn't know
*/
module.exports = async (client, message) => {
if (message.guild.id === client.config.serverID) return;
if (message.author.bot || message.channel.type === "dm") return;
let GuildDB = await client.GetGuild(message.guild.id);
//Prefixes also have mention match
const prefixMention = new RegExp(`^<@!?${client.user.id}> `);
prefix = message.content.match(prefixMention);
if (message.content.indexOf(prefix) !== 0) return;
if (GuildDB.customChannelStatus==true&&!GuildDB.allowedChannels.includes(message.channel.id)) {
return message.channel.send(`You are not allowed to use the bot in this channel.`);
}
const args = message.content.slice(prefix.length).trim().split(/ +/g);
//Making the command lowerCase because our file name will be in lowerCase
const command = args.shift().toLowerCase();
//Searching a command
const cmd =
client.commands.get(command) ||
client.commands.find((x) => x.aliases && x.aliases.includes(command));
//Executing the codes when we get the command or aliases
if (cmd) cmd.run(client, message, args, { GuildDB });
else return;
};
+5 -5
View File
@@ -48,11 +48,11 @@ class QuarksBot extends Client {
type: 4,
data:
typeof message == "string"
? { content: message }
: message.type && message.type === "rich"
? { embeds: [message] }
: message,
},
? { content: message, ...(message.ephemeral && {flags: (1 << 6)}), }
: message.embeds[0] && message.embeds[0].type === "rich"
? { embeds: message.embeds, ...(message.ephemeral && {flags: (1 << 6)}), }
: { message, ...(message.ephemeral && {flags: (1 << 6)}), },
}
});
};
let cmd = client.commands.get(command);