Fixed mention prefix

This commit is contained in:
TheEssem 2021-03-16 15:45:10 -05:00
parent 74baa29684
commit 03ddf5c88c
2 changed files with 4 additions and 3 deletions

View File

@ -46,8 +46,9 @@ module.exports = async (message) => {
// separate commands and args
const content = message.cleanContent.substring(prefix.length).trim();
const rawContent = message.content.substring(prefix.length).trim();
const args = content.split(/ +/g);
const command = args.shift().toLowerCase();
const command = rawContent.split(/ +/g).shift().toLowerCase();
// don't run if message is in a disabled channel
if (message.channel.guild) {
@ -70,7 +71,7 @@ module.exports = async (message) => {
try {
await database.addCount(collections.aliases.has(command) ? collections.aliases.get(command) : command);
const startTime = new Date();
const result = await cmd(message, args, message.content.substring(prefix.length).trim().replace(command, "").trim()); // we also provide the message content as a parameter for cases where we need more accuracy
const result = await cmd(message, args, rawContent.replace(command, "").trim()); // we also provide the message content as a parameter for cases where we need more accuracy
const endTime = new Date();
if (typeof result === "string" || (typeof result === "object" && result.embed)) {
await client.createMessage(message.channel.id, result);

View File

@ -7,7 +7,7 @@ mongoose.connect(process.env.DB, {
poolSize: 10,
bufferMaxEntries: 0,
useNewUrlParser: true,
useUnifiedTopology: true,
useUnifiedTopology: true
});
const guildSchema = new mongoose.Schema({
id: String,