Code Monkey home page Code Monkey logo

discord-bot-boilerplate's Introduction

Discord Bot boilerplate

Made with node 15.8.0 Uses discord.js. Learn more here

A complete discord js bot boilerplate with dynamic help command and set-prefix command. Works on multiple servers. Easy to set up and modify. Support for DMs.

Setup

  1. Install node js from here https://nodejs.org/en/

  2. Clone the github repository. https://github.com/Parth-2412/Discord-Bot-Boilerplate. Run git clone https://github.com/Parth-2412/Discord-Bot-Boilerplate.

  3. Go into the root directory. Run cd Discord-Bot-Boilerplate

  4. Install dependencies. Run npm install

  5. Create and invite a bot and get your bot token from here

  6. Now that you have your token, create a .env file in the root directory and in that .env file write TOKEN=YOUR_BOT_TOKEN

  7. Start the bot. Run npm start.

    Thats's it!!

Adding a command

In the commands folder create a new js file for your command and enter the following in it:

module.exports = {
   name : "the name of the command. Required",

   description : "the description of the command. Required",

   argsNumber : 1, // the number of arguments the command requires default is 0

   permissions : ["ADMINISTRATOR"], // the list of permissions required to execute this command. Optional. Full list can be found https://discord.com/developers/docs/topics/permissions#permissions-bitwise-permission-flags
   
   usage : "example usage", // no need to use the command prefix and command name here, it is automatically prepended to the usage string. Optional

   guildOnly : true, // sets whether the command can only be executed in servers or not. Optional. If the permissions list is set then guildOnly will always be true.

   execute(message,args){
       // function which is called when the command is executed
       // takes the message object and the list of arguments in the message as function arguments.
       // REQUIRED
   },

}

Existing Commands

  1. help - !help [command name]. Lists all commands or info about a specific command. Only shows the commands which the users are allowed to see
  2. set-prefix !set-prefix prefix. Sets the prefix for a specific server. Default prefix is !. Change default prefix in index.js line 12. The default prefix will be used in DMs.

discord-bot-boilerplate's People

Watchers

Parth Patil avatar

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.