update/add logs and update prefix

This commit is contained in:
SowinskiBraeden committed 2022-03-08 13:27:23 -08:00
1 parent 0495577b3c
commit 2c1d15cfc4
9 files changed
+228 -31

No files matched your search

+5 -10
View File
@@ -1,6 +1,6 @@
/**
*
* @param {require("../LPS")} client
* @param {require("../structures/LinesPoliceCadBot")} client
* @param {require("discord.js").Message} message
* @returns {void} or nothing if you didn't know
*/
@@ -12,15 +12,6 @@ module.exports = async (client, message) => {
let GuildDB = await client.GetGuild(message.guild.id);
if (GuildDB && GuildDB.prefix) prefix = GuildDB.prefix;
//Initialize GuildDB
if (!GuildDB) {
await client.database.guild.set(message.guild.id, {
prefix: prefix,
DJ: null,
});
GuildDB = await client.GetGuild(message.guild.id);
}
//Prefixes also have mention match
const prefixMention = new RegExp(`^<@!?${client.user.id}> `);
prefix = message.content.match(prefixMention)
@@ -29,6 +20,10 @@ module.exports = async (client, message) => {
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();