Skip to content

ItzzBastien/ExtendedClient

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

47 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Extended Client

A Client who extends the base of discord.js, offers an integrated builder of SlashCommands with @discordjs/builders and handlers.

Installation

Node.js 16.9.0 is required (same version as discord.js)

npm install extended-client

Example Usage (ESM syntax)

Setup the client.

const extendedClient = new ExtendedClient({
    intents: myIntents,
    token: "TOKEN"
})

Load the handlers.

extendedCLient.eventHandler.load("myDirectory")

extendedClient.slashHandler.load("myDirectory", 0) // 0 is a default value but you can use another positive value
/**
 * Warning !!
 * handler must be in the following format:
 * 
 * index.js
 * eventHandler/
 *  |-> event.js
 **/

Do a command file

// commandHandler/utilities/ping.js

export const data = new SlashCommandBuilder()
    .setName('ping')
    .setDescription("Send the bot ping")

export const execute = async (client, interaction) {
    //your code
}

Do an event file

// eventHandler/ready.js

export const name = "ready"
export const once = true

export function execute(client){
    //your code
}

Use the integrated Builder

import { Builder } from "extended-client"

const builder = new Builder(extendedClient)

builder.globalBuild(extendedClient.slashHandler.slashCommands)

// actually, the builder only support global push

Help

if you need help for something don't hesitate to join this discord server and ping Bastien#1414

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published