// Start by initializing the discord.js client and importing djs-commands-control
// Let's say we have a function that fetches the prefix from our database
// The arguments has to be message and options, as described in the CustomizablePrefix Type
function fetchPrefix(message, options) {
return options.database.fetchPrefix(message.id); // This has to return a string
// Let's create a CustomizablePrefix Option
const customizablePrefix = {
callback: fetchPrefix, // The above function to run
options: { database } // The function requires the database object
// Now we initialize the Object
const commands = new Commands(
client, // Passing our Discord Client
"src/commands", // Lets pretens our commands are located in src/commands
{ // Finally passing the CommandOptions Object
prefix: process.env.PREFIX, // We have our prefix stored in the env variables
prefixOnMention: true, // Yes, we want to return the prefix if someone mentions the bot
customizablePrefix, // Finally, give it to the contructor