DiscordJs13-handler is the solution for all the discord.js developper who want a complete handler for slash commands

Overview

Advanced and complete discord.js 13 handler

Presentation

DiscordJs13-handler is the solution for all the discord.js developper who want a complete handler for slash commands

Fonctionnalities

  • Events and commands in differents files
  • New useButton, useSlashCommand and useDropdown events
  • Permissions configurable in each command file with a simple array

How to use ?

Installation

  • Node.js 16.6.0 or newer is required.
  • Download the repo and run npm i to install the packages.
  • Setup the config.js file with your bot's token, its ID and the ID of the guild where you will use the bot.

Add new slash-command

Create a new file in the commands folder then copy put this template :

const { SlashCommandBuilder } = require('@discordjs/builders');

module.exports.run = async (client, interaction) => {
	// put your code here
};

module.exports.data = new SlashCommandBuilder()
    .setName('command')
	.setDescription('Command Description')

    .setDefaultPermission(false)

module.exports.perms = ["849368264965750814"];

You can setup the command with the SlashCommandBuilder(). It's better if your file name is the same than your .setName()

the module.exports.perms is an array which can contain role's or user's ID. If you want to enable the permission restriction, you have to put .setDefaultPermission(false) to your SlashCommandBuilder as I did.

Add new event

Create a new file called by the name of the event you want then copy this template :

module.exports = async (client) => {
    // put your code here
};

You can sorte the events as you want in subfolder but to work, the events have to be in one (example: ./events/interaction/interactionCreate.js)

By default, each events return the parameter client as first, you can add the others parameter of each event after client. Refer to discord.js docs to know what are the parameters for each event. Example for guildMemberAdd:

module.exports = async (client, member) => {
    // put your code here
};

Example for interactionCreate:

module.exports = async (client, interaction) => {
    // put your code here
};

Note : don't edit the system_dont_edit folder.

Use the custom interaction events

The interactionCreate event is for me not really good, it's why, I created three new events more precise, you can use them as others events. But don't edit interactionCreate event if you want to use them.

Event name Parameters What is this ?
useButton (client, interaction) run when a button is clicked
useDropdown (client, interaction) run when a dropdown is clicked
useSlashCommand (client, interaction) don't edit ! it's to handle the commands in different files

If you have any question, ask it on discord

gaetan20#6791

You might also like...

Grupprojekt för kurserna 'Javascript med Ramverk' och 'Agil Utveckling'

JavaScript-med-Ramverk-Laboration-3 Grupprojektet för kurserna Javascript med Ramverk och Agil Utveckling. Utvecklingsguide För information om hur utv

May 18, 2022

Hemsida för personer i Sverige som kan och vill erbjuda boende till människor på flykt

Getting Started with Create React App This project was bootstrapped with Create React App. Available Scripts In the project directory, you can run: np

May 3, 2022

Kurs-repo för kursen Webbserver och Databaser

Webbserver och databaser This repository is meant for CME students to access exercises and codealongs that happen throughout the course. I hope you wi

Jan 3, 2023

Foot Locker is an online store specialized in selling shoes of all kinds, where you can find all the shoes you want

Foot Locker is an online store specialized in selling shoes of all kinds, where you can find all the shoes you want

Foot Locker Links 🖇 Heroku link Adobe XD link Description Foot Locker is an online store specialized in selling shoes of all kinds, where you can fin

Apr 16, 2022

Omnivore - a complete, open source read-it-later solution for people who like text

Omnivore - a complete, open source read-it-later solution for people who like text

Omnivore Omnivore is a complete, open source read-it-later solution for people who like text. We built Omnivore because we love reading and we want it

Jan 1, 2023

All-in-one solution for configuring ESLint in all of your projects

All-in-one solution for configuring ESLint in all of your projects

✨ All-in-one solution for configuring ESLint in all of your projects ✨ ⚠️ May not work in your project. This is related to eslint module resolution pr

Nov 28, 2022

A utility package for making discord-bot commands much easier to write with discord.js.

Cordcommand About A utility package for making discord-bot commands much easier to write with discord.js. Usage Example // initiate discord.js client

Dec 13, 2022

SafeCycle—a tool that keeps cyclists safe. Gone are days of weaving through busy city streets, SafeCycle finds all the bike routes for you to ensure a smooth ride wherever you want to go.

Inspiration Biking—an everyday form of travel for students and professionals across the globe. On-campus, back home, and with the people that we know

May 2, 2022

Pack all your node_modules and other files you want inside your project to a zip file.

🚀 Node Modules Packer Use Cases | Usage | Examples | Headless | Benchmarks | Reference This is a library to package all your node_modules and other f

Dec 1, 2022
Owner
null
New Discord.JS v14 Slash and Prefix Commands handler with Events. Check it out now!

Discord.js v14 Command-Handler Commands, Events, Permissions and Cooldown Handlers for Discord.js v14 bot ~ Made by Lynx Discord.js v14 (dev version)

Comet Development 20 Dec 19, 2022
Grayce Muthui 8 Jun 16, 2022
A discord bot to track "owo", usually used to help with OwO bot. Made with Discord.js v13 includes Slash commands, Leaderboards, Auto Resets etc.

Discord-OwO-tracker A discord bot to track "owo", usually used to help with OwO bot Requirements Discord.js v13 (npm install discord.js@latest) applic

Astrex 4 Nov 24, 2022
Discord.js bot starter template, Slash Commands only (Raymond forced me to make a bot template)

boat-template Raymond forced me to make a bot template This template is meant is just for stupidness ig Getting Started Rename the config.example.ts t

Drxckzyz tha idiot 3 Jan 5, 2022
A good looking help command made with discord.js with select menus. Works with prefix and slash commands too!

fancy-help-command A good looking help command made with discord.js with select menus. Works with prefix and slash commands too! Dependencies: Select

LunarCodes 11 Dec 12, 2022
All terminal commands in one place (you can Contribute to it by putting latest commands and adding Readme)

Terminal-Commands All basic terminal commands in one place Show some ❤ by some repositories You can contribute to this readme If you to contribute wit

Shehzad Iqbal 7 Dec 15, 2022
A Discord.JS Command Handler to handle commands eaiser

TABLE OF CONTENTS Installation Setup Changing Default Prefix Creating a Command Usage of minArgs and maxArgs Syntax Errors Global Syntax Errors Per Co

AaTherf 3 Jun 8, 2022
V14 Slash Command Handler! (ES6 Module Destekli)

V14 Slash Command Handler Proje discord.js v14 üzerine yazılmıştır. Gerekli olan minimum nodejs versiyonu v16.9 Örnek kullanım src/commands/ping.js do

Mehmet 137 Dec 31, 2022
Dank Memer (Selfbot) Farm with slash commands support and random delays and breaks to avoid any suspicion

Slashy Slashy is a Dank Memer (Selfbot) Farm with slash commands support and random delays and breaks to avoid any suspicion. This is completely undet

Taha Gorme 16 Dec 30, 2022