Skip to content
This repository was archived by the owner on Nov 30, 2022. It is now read-only.

MGalaCyber/OUTDATED-Discord.js-v14-Command-Handler

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

12 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation


Discord server

Trakteer Saya


Discord.js v14 Handler Template

I suggest downloading the template handler in the Release's column, to avoid bugs

I suggest read wiki the template handler in the Wiki's for start configuration the handler


βš™ Configuration

  • ⚠ Never share your tokens or api keys publicly
  • Create and Modify .env and fill out the values:
TOKEN="discord-bot-token"
MONGO_URI="your-mongoose-databases"
  • And then config other variables in settings/config.json

Structures Configuration of the Command, Handler, and Event

Message Command Structures Example
//=====================================| Import the Module |=====================================\\

const { errorCmdLogsMsg } = require(`../../../Structures/Functions/errorCmdLogs.js`);
const Settings = require(`../../../Structures/Settings/settings.json`);
const Config = require(`../../../Structures/Settings/config.json`);
const Emoji = require(`../../../Structures/Settings/emojis.json`);
const Embed = require(`../../../Structures/Settings/embed.json`);
const { author, version } = require(`../../../package.json`);
const { EmbedBuilder } = require('discord.js');

//=====================================| Code |=====================================\\

module.exports = {
    name: '', // Input the Name of the command
    usage: '', // Fill the main name command
    aliases: [], // Input the Aliases of the command
    cooldown: 15, // Input the Cooldowns of the command
    category: '', // Input the Category of the command
    description: '', // Input the type of the command
    //========| Options Settings |========\\
    ownerOnly: false, // Choose true/false. Can only be used by owners registered with bots who can use this command
    guildOnly: false, // Choose true/false. Can only be used on servers registered by bots that can use this command
    toggleOff: false, // Choose true/false. For disable this command
    voiceOnly: false, // Choose true/false. Can only be used on voice channels that can use this command
    nsfwOnly: false, // Choose true/false. Can only be used on nsfw channels that can use this command
    maintenanceCmd: false, // Choose true/false. For can't be used this command
    //========| Permissions Settings |========\\
    botPerms: [], // Input the bot permissions of the command
    userPerms: [], // Input the user permissions of the command

    async execute(message, args, client, prefix) {
        try {
        // Fill your code here
        
        } catch (error) {
            errorCmdLogsMsg(client, message, error);
        }
    }
}

/**
/////////////////////////////////////////////////////////////////////
////                                                             ////
\\\\               Handlers Coded by GalaXd#9165                 \\\\
////                                                             ////
\\\\   Work for MGalaCyber Development | https://galacyber.xyz   \\\\
////                                                             ////
\\\\                    All Right Reserved!                      \\\\
////                                                             ////
/////////////////////////////////////////////////////////////////////
 */
Slash Command Structures Example
//=====================================| Import the Module |=====================================\

const { errorCmdLogsInt } = require(`../../../Structures/Functions/errorCmdLogs.js`);
const Settings = require(`../../../Structures/Settings/settings.json`);
const Config = require(`../../../Structures/Settings/config.json`);
const Emoji = require(`../../../Structures/Settings/emojis.json`);
const Embed = require(`../../../Structures/Settings/embed.json`);
const { author, version } = require(`../../../package.json`);
const { EmbedBuilder } = require('discord.js');

//=====================================| Code |=====================================\

module.exports = {
    name: '', // Input the Name of the command
    cooldown: 15, // Input the Cooldowns of the command
    category: '', // Input the Category of the command
    description: '', // Input the description of the command
    type: '', // Input the type of the command
    //========| Options Settings |========\\
    ownerOnly: false, // Choose true/false. Can only be used by owners registered with bots who can use this command
    guildOnly: false, // Choose true/false. Can only be used on servers registered by bots that can use this command
    toggleOff: false, // Choose true/false. Can only be used on nsfw channels that can use this command
    voiceOnly: false, // Choose true/false. Can only be used on nsfw channels that can use this command
    nsfwOnly: false, // Choose true/false. Can only be used on nsfw channels that can use this command
    maintenanceCmd: false, // Choose true/false. Can't be used on nsfw channels that can use this command
    //========| Permissions Settings |========\\
    botPerms: [], // Input the bot permissions of the command
    userPerms: [], // Input the user permissions of the command
    //========| Options Settings |========\\
    options: [],

    async execute(client, interaction, args, prefix) {
        try {
        // Fill your code here

        } catch (error) {
            errorCmdLogsInt(client, interaction, error);
        }
    },
};

/**
/////////////////////////////////////////////////////////////////////
////                                                             ////
\\\\               Handlers Coded by GalaXd#9165                 \\\\
////                                                             ////
\\\\   Work for MGalaCyber Development | https://galacyber.xyz   \\\\
////                                                             ////
\\\\                    All Right Reserved!                      \\\\
////                                                             ////
/////////////////////////////////////////////////////////////////////
 */
Button Menu Structures Example
//=====================================| Import the Module |=====================================\

const { errorCmdLogsInt } = require(`../../../Structures/Functions/errorCmdLogs.js`);
const Settings = require(`../../../Structures/Settings/settings.json`);
const Config = require(`../../../Structures/Settings/config.json`);
const Emoji = require(`../../../Structures/Settings/emojis.json`);
const Embed = require(`../../../Structures/Settings/embed.json`);
const { author, version } = require(`../../../package.json`);
const { EmbedBuilder } = require('discord.js');

//=====================================| Code |=====================================\

module.exports = {
    name: '', // Input the Name of the command
    category: '', // Input the Category of the command
    //========| Options Settings |========\\
    authorOnly: false, // Choose true/false. Can only be used by author can use this command

    async execute(client, interaction, prefix) {
        try {
        // Fill your code here

        } catch (error) {
            errorCmdLogsInt(client, interaction, error);
        }
    }
}

/**
/////////////////////////////////////////////////////////////////////
////                                                             ////
\\\\               Handlers Coded by GalaXd#9165                 \\\\
////                                                             ////
\\\\   Work for MGalaCyber Development | https://galacyber.xyz   \\\\
////                                                             ////
\\\\                    All Right Reserved!                      \\\\
////                                                             ////
/////////////////////////////////////////////////////////////////////
 */
Select Menu Structures Example
//=====================================| Import the Module |=====================================\

const { errorCmdLogsInt } = require(`../../../Structures/Functions/errorCmdLogs.js`);
const Settings = require(`../../../Structures/Settings/settings.json`);
const Config = require(`../../../Structures/Settings/config.json`);
const Emoji = require(`../../../Structures/Settings/emojis.json`);
const Embed = require(`../../../Structures/Settings/embed.json`);
const { author, version } = require(`../../../package.json`);
const { EmbedBuilder } = require('discord.js');

//=====================================| Code |=====================================\

module.exports = {
    name: '', // Input the Name of the command
    category: '', // Input the Category of the command
    //========| Options Settings |========\\
    authorOnly: false, // Choose true/false. Can only be used by author can use this command

    async execute(client, interaction, prefix) {
        try {
        // Fill your code here

        } catch (error) {
            errorCmdLogsInt(client, interaction, error);
        }
    }
}

/**
/////////////////////////////////////////////////////////////////////
////                                                             ////
\\\\               Handlers Coded by GalaXd#9165                 \\\\
////                                                             ////
\\\\   Work for MGalaCyber Development | https://galacyber.xyz   \\\\
////                                                             ////
\\\\                    All Right Reserved!                      \\\\
////                                                             ////
/////////////////////////////////////////////////////////////////////
 */
Modal Menu Structures Example
//=====================================| Import the Module |=====================================\

const { errorCmdLogsInt } = require(`../../../Structures/Functions/errorCmdLogs.js`);
const Settings = require(`../../../Structures/Settings/settings.json`);
const Config = require(`../../../Structures/Settings/config.json`);
const Emoji = require(`../../../Structures/Settings/emojis.json`);
const Embed = require(`../../../Structures/Settings/embed.json`);
const { author, version } = require(`../../../package.json`);
const { EmbedBuilder } = require('discord.js');

//=====================================| Code |=====================================\

module.exports = {
    name: '', // Input the Name of the command
    category: '', // Input the Category of the command

    async execute(client, interaction, prefix) {
        try {
        // Fill your code here

        } catch (error) {
            errorCmdLogsInt(client, interaction, error);
        }
    }
}

/**
/////////////////////////////////////////////////////////////////////
////                                                             ////
\\\\               Handlers Coded by GalaXd#9165                 \\\\
////                                                             ////
\\\\   Work for MGalaCyber Development | https://galacyber.xyz   \\\\
////                                                             ////
\\\\                    All Right Reserved!                      \\\\
////                                                             ////
/////////////////////////////////////////////////////////////////////
 */
Event Structures Example
//=====================================| Import the Module |=====================================\\

const Settings = require(`../../Structures/Settings/settings.json`);
const Config = require(`../../Structures//Settings/config.json`);
const Emoji = require(`../../Structures//Settings/emojis.json`);
const Embed = require(`../../Structures//Settings/embed.json`);
const { author, version } = require(`../../package.json`);
const { EmbedBuilder } = require('discord.js');

//=====================================| Code |=====================================\\

module.exports = {
  name: '', // Input the Name of the event
  once: false, // Choose true/false or delete this script for the event

async execute(client) {
  // Fill your code here

};
}

/**
/////////////////////////////////////////////////////////////////////
////                                                             ////
\\\\               Handlers Coded by GalaXd#9165                 \\\\
////                                                             ////
\\\\   Work for MGalaCyber Development | https://galacyber.xyz   \\\\
////                                                             ////
\\\\                    All Right Reserved!                      \\\\
////                                                             ////
/////////////////////////////////////////////////////////////////////
 */
Handler Structures Example
//=====================================| Import the Module |=====================================\\

const { readdirSync } = require('fs');
const color = require('colors');

// ========================================| Code |======================================= \\

module.exports = async (client) => {
  // Fill your code here

};

/**
/////////////////////////////////////////////////////////////////////
////                                                             ////
\\\\               Handlers Coded by GalaXd#9165                 \\\\
////                                                             ////
\\\\   Work for MGalaCyber Development | https://galacyber.xyz   \\\\
////                                                             ////
\\\\                    All Right Reserved!                      \\\\
////                                                             ////
/////////////////////////////////////////////////////////////////////
 */

πŸ’– Support


πŸ’ Credit

If consider using this Template, make sure to credit me!


πŸ“œ Licence

GitHub

About

[OUTDATED] Discord.js v14 Handler Template | Open Source, Javascript, with Message, Slash, Button, Select, Modal Commands, Mongoose Database, Multi Events, Multi Handler, Multi Features, Support Error Logs Report, etc.

Topics

Resources

License

Stars

Watchers

Forks

Contributors