Im trying to export prefix from my "prefix.js" to "index.js" and I want it to return "?" becuse the prefix on the database is "?"
This is my code for "prefix.js"
const GuildConfig = require("../database/schemas/GuildConfig");
const { Client } = require("discord.js");
const client = new Client();
const prefix = () => {
if (message.author.bot) return;
const guildConfig = GuildConfig.findOne({
guildId: message.guild.id,
});
const prefix = guildConfig.get("prefix");Z
return prefix
};
exports.prefix = prefix
And this is some of the code from "index.js"
const prefix = require("./src/events/prefix")
console.log(prefix)
And this is what I get in the console
{ prefix: [Function: prefix] }