Skeleton of a discord.js bot

Overview

BotSkelet

Skelet of a discord.js bot

Tired of making the whole "base" of your discord bot? Never been easier!

The following versions was used to test the project:

VERSIONS
Discord.js v13.6.0
Node.js v17.3.0

How to get started

Install the project with the following command:

$ npm install

Events

Get started by duplicating the template named event.js.structure and renaming it to a new more convenient name ending on .js

The template include the following:

module.exports = (client, config) => {
    var eventObj = {};

    // Settings
    eventObj.name = 'test'; // Event name
    eventObj.once = false; // Set this to true if it should listen once.

    // Main function
    eventObj.execute = () => {
        // Do something in the event here
    }

    return eventObj;
}

All event modules should go into the folder named events.

Commands

Get started by duplicating the template named cmd.js.structure and renaming it to a new more convenient name ending on .js

The template include the following:

// Imports
const Discord = require('discord.js');
const { SlashCommandBuilder } = require('@discordjs/builders');

module.exports = (client, config) => {
    var cmdObj = {};

    // Settings
    cmdObj.name = 'test';
    cmdObj.description = 'test description';
    cmdObj.permissions = null;
    cmdObj.data = new SlashCommandBuilder()
        .setName(cmdObj.name)
        .setDescription(cmdObj.description); // Build properties for a Slash Command here if wanted. If not, set the property to null

    // Main function
    /**
     * @param {Discord.Message} message - Will be set if the command was executed by standard message command.
     * @param {Array<String> || Discord.CommandInteractionOptionResolver} args - If the command was executed by standard message command, it will send an array of string arguments. If executed by slash commands it will return the interaction options.
     * @param {Discord.CommandInteraction} interaction - Will be set if command was executed by a slash command.
     */
    cmdObj.execute = (message, args, interaction) => {}

    return cmdObj;
}

This project includes both slash command handling and standard message command handling.

Finish up

To start the project run the following command:

$ npm run start

Important!!

If you experience any problems in your way using this awesome skeleton for your bot, don't hesitate to contact me on discord! Croixai#2003

You might also like...

It is a discord bot bot which can play lofi song in different language 24/7. It has premium system and cool embed looks with buttons. It can play youtube songs, playlists. This bot code was made by Supreme#2401. It uses djs V12

It is a discord bot bot which can play lofi song in different language 24/7. It has premium system and cool embed looks with buttons. It can play youtube songs, playlists. This bot code was made by Supreme#2401. It uses djs V12

Lofi-Radio-Music-Bot It is a discord bot bot which can play lofi song in different language 24/7. It has premium system and cool embed looks with butt

Jan 2, 2023

New base bot WhatsApp 🈴 bukan self bot lagi atau buka bot yang bisa di pakai oleh bot sendiri 😎

New base bot WhatsApp 🈴 bukan self bot lagi atau buka bot yang bisa di pakai oleh bot sendiri 😎

Installation • Thanks to • Donate Official Group Bot • Settings Instalasi Heroku Buildpack Click the deploy icon below ! heroku/nodejs https://g

Feb 9, 2022

⚡ Discord bot with economy, gambling, music, fun, moderation features based on discord.js v12

⚡ Discord bot with economy, gambling, music, fun, moderation features based on discord.js v12

Crucian Crucian is my discord bot with simple structure based on discord.js Click Here to invite Crucian to your server Author Crucian © Apoo Authored

Jul 26, 2021

A multipurpose Discord-bot created using discord.js.

Flame A multipurpose Discord-bot with music, economy, utils, and also auto-moderation. Flame is a powerfull, multipurpose and fully modular Discord-bo

Nov 14, 2021

Cyrus is a Discord Bot with focus on Fun, Moderation, information and much more commands! Made it with Discord.js

Cyrus is a Discord Bot with focus on Fun, Moderation, information and much more commands! Made it with Discord.js

Cyrus Cyrus is a Discord Bot with focus on Fun, Moderation, information and much more commands! Made it with Discord.js Invite : Click here Vote : Top

Dec 3, 2022

OptiBOT - My discord.js V13 discord bot.

OptiBOT Just a discord.js v13 bot for my discord server. if you plan to use this bot for your server, dont. This i made this bot just for learning js

Jan 3, 2022

A discord bot using @discord.js and mongoose. Used for music, moderation, and entertainment.

hazel A discord bot using @discord.js and mongoose. Used for music, moderation, and entertainment. Features Music ― supporting YouTube, Spotify and So

Dec 31, 2022

Denky is a multipurpose Discord bot, build with Node.js, TypeScript and discord.js.

🤖 Denky Bot Denky is a brazilian Discord bot, build with Node.js, TypeScript and discord.js. ⚙️ How to Create a Discord application. Guide Install No

Apr 6, 2022

Sample discord bot using clashofclans.js and discord.js

Clash of Clans sample discord bot using NodeJs Introduction This sample bot project aims to help you get started with interacting Clash of Clans API u

Dec 16, 2022
Comments
  • Bug Fix and QoL change

    Bug Fix and QoL change

    Bug Fix

    • Fixed prefix detection incorrectly only checking if command name exists with correct prefix length, and not if the prefix actually exists in the message.

    Quality of Life

    • Added an automatic addition of the current prefix to the help menu, if it is set.
    opened by ghost 0
Releases(v1.0.1-mongodb)
  • v1.0.1-mongodb(Jan 21, 2022)

    You can now through a variable on the client, access all the command objects sorted by their category.

    A basic command named "help" has been added, showing how to use this data to make a list of commands sorted by their category.

    Source code(tar.gz)
    Source code(zip)
  • v1.0.1(Jan 21, 2022)

    You can now through a variable on the client, access all the command objects sorted by their category.

    A basic command named "help" has been added, showing how to use this data to make a list of commands sorted by their category.

    Source code(tar.gz)
    Source code(zip)
  • v1.0.0-mongodb(Jan 19, 2022)

    Discord.js v13 with MongoDB integration Never been easier to begin developing the structure of your bot with v13, easy copy the templates for event and command modules, for both Event Handling and Command handling, including Slash Commands and basic Message Commands.

    Complete integration with MongoDB makes it easier and faster to develop and interact with your database directly in the event and command modules.

    Source code(tar.gz)
    Source code(zip)
  • v1.0.0(Jan 19, 2022)

    Discord.js v13 Easily copy the template modules for both events and commands, and set up your bot faster without spending time on the basics of Event Handling, Command Handling both with the Slash Commands and basic Message Commands.

    Source code(tar.gz)
    Source code(zip)
Owner
Mr. Crab
Crabby IT Nerd
Mr. Crab
A skeleton JS discord bot.

Discord-Bot-Skeleton A skeleton JS discord bot. PLEASE NOTE THIS IS A WIP If you need any questions answered or have issues with this bot go ahead and

Ella Rekow 13 Aug 15, 2022
Discord-Bot - You can use the discord bot codes that are updated in every video of the codes I use in the discord bot making series that I have published on my youtube channel.

Discord-Bot You can use the discord bot codes that are updated in every video of the codes I use in the discord bot making series that I have publishe

Umut Bayraktar 114 Jan 3, 2023
A multipurpose bot, a clan bot, a all in one bot. The one bot u need for ur server originally made as Milrato discord Bot and by Tomato6966.

Public Bot and Support Server! Invite the Public Version of this Bot so you don't need to host it by yourself or join my Discord server to get a custo

Tomato6966 472 Dec 25, 2022
Gitlift Discord Bot is a discord bot which is listening Discord Messages to reply with user gitlift profile and total contributions.

Remoklify - Gitlift Discord Bot Gitlift Discord Bot is a discord bot which is listening Discord Messages to reply with user gitlift profile and total

Remoklify 3 Mar 20, 2022
About Discord bot draft that does not contain ready-made commands, compatible with discord.js v14. Create your own discord bot with this command handler.

discordJS-V14 About Discord bot draft that does not contain ready-made commands, compatible with discord.js v14. Create your own discord bot with this

Umut Bayraktar 36 Dec 28, 2022
A simple & easy2use API for obtaining information about a discord user, discord bot or discord guild and their use for some purpose on websites!

discord-web-api A simple & easy2use API for obtaining information about a discord user, discord bot or discord guild and their use for some purpose on

InvalidLenni 2 Jun 28, 2022
Discord Neura - a Discord bot framework built on discord.js

Discord Neura Description Discord Neura is a Discord bot framework built on discord.js. Features Command Handler, Arguments, Preconditions and Listene

Discord Neura 3 Mar 23, 2022
A discord bot made using discord.js and discord-player

Musx A custom discord bot that can play music in your server ?? Add the bot to your server If you are looking for a music bot for your Discord server

Shashwat Singh 4 Mar 28, 2022
This bot is a cool Discord bot made in discord.js using Node.JS

Anti-Crosspost Discord Bot This bot is a cool Discord bot made in discord.js using Node.JS. It detects when a user cross-posts a message in multiple c

Muhammad Usman Mithani 4 May 31, 2022
Co-Pilot is a discord Bot designed to be the all-in-one, open-source Discord bot that handles all your server needs.

Welcome to Co-Pilot Bot repo! ?? ?? Co-Pilot (All-in-one Discord Bot) Co-Pilot is a discord Bot designed to be the all-in-one, open-source Discord bot

YMafalha 19 Nov 11, 2022