GithubHelp home page GithubHelp logo

bracketbyte / djs-handler Goto Github PK

View Code? Open in Web Editor NEW
21.0 3.0 14.0 42 KB

Simple and easy to use Discord.js command and event handler, use this template for your next bot!

JavaScript 100.00%
discord-bot discord-js command-handler event-handler djs bot discord-command

djs-handler's Introduction

Command and Event Handler For Discord.js!

Simple and easy to use command and event handler with useful features.

INFO

! The command handler used in this repository is based on the official discord.js command handler

! Make sure that you have Node.js and NPM installed and up to to date on your system

HOW DO I SETUP MY BOT?

! If you'r hosting the bot on your loca machine create a new file in the root of the directory of the project called .env and write in it TOKEN=your_token_goes_here if not, add the token to your bot environtment variables with the name of TOKEN

! Set your prefix in utils/config.json

! Run npm install in your terminal

HOW DO I START THE BOT?

! If it's not your first time running this bot, run npm run start in your terminal

! Use npm run LocalStart in your terminal if you'r running the bot on a local machine to make use of the .env file

HOW TO ADD NEW COMMANDS?

1 Create a new .js file in the commands folder with the name of your command.

2 Populate the file with the code reprezented here:

module.exports = {
  name: "commanad name",
  description: "description of your command",
  aliases: ["aleas1", "alias2"],
  usage: "[argument1] [argument2]",
  guildOnly: false, //true if only used in server
  args: false, //true if the command cant run without arguments
  permissions: {
    bot: [], //permissions that the bot requires for the command
    user: [], //permissions that the user requires for the command
  },
  execute: async (message, args, client) => {
    //code for the command goes here
  },
};

3 start your bot and see if it works!

djs-handler's People

Contributors

bracketbyte avatar grosun avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

djs-handler's Issues

Missing Permission. yes

Idk what happen but when I put **ADMINISTRATOR** . and I had administrator permission. It say unmet permission when I literally had it. I try MANAGE_SERVER but still not work. pls fix

Update to Discord.js V13

Update to Discord.js V13... I really wanted to use a discord.js v13, Pleasee Update to discord.js v13.

How to run a command that includes "await"

Soo.. this is the command runner I guess..

module.exports = {
	name: 'ping',
	description: 'Just a test command',
	aliases: [],
	guildOnly: false,
	args: false,
	usage: '',
	execute:(message, args, client) => {

Anyways, I have a command that has "await", when I run it in this handler, it says "await" is only valid in async function. I don't know how to turn execute: thing to async run. Please help.

PM Command not working

I have that kinda problem, that i setted up the bot, in guilds reacts to commands, but if I send commands in DM to it, nothing happens... I gave him all of the intents, included the DIRECT_MESSAGES intent, but nothing happens, even the guildOnly error message doesnt seem to work...

Missing Pemissions

Hey! I like your handler and it is really nice. I didn't changed anything yet. I tryed to run the command help or test and it says, that the bot and the user have not the required permissions. In the console log it says nothing just "Permission that the bot/user need:" Please fix the issue

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.