Installation

Guide to Install sdhandler package into the user's system.

Lets start by installing the package into your computer.

npm i sdhandler

Now open your main project file and import the package and create a basic client object.

const sdhandler = require('sdhandler')
const {Client , Intents}= require('discord.js')

const client = new Client({
    intents: [
        Intents.FLAGS.GUILDS,
        Intents.FLAGS.GUILD_MESSAGES
    ]
}) // Specify the necessary intents.

Let us now start using the package.

sdhandler.sdhandler({
    client : client , //Supply the Client Object 
    testOnly : true,  // Use true if you want to test the slash commands for the guild only 
    guildID : [Array-of-guild-IDs] , // The GUILD ID if you have set testOnly to true
    commandsDir : "commands-path", // (Optional) The relative path to your commands folder. If nothing is provided ./commands will be taken by default
    eventsDir : "events-path" , // (Optional) The relative path to your events folder . If nothing is provided ./events will be taken by default
    token : "YOUR-TOKEN" , // The token of your Bot
    prefix : [ARRAY-of-PREFIX] , // (Optional) The prefix(es) of your Bot (For legacy commands). Default is ["!"] .
    buttonsDir : "buttons-path" // (Optional) The relative path to your buttons folder. If nothing is provided , ./buttons will be taken by default
})

Here is an example :

sdhandler.sdhandler({
    client : client ,
    testOnly : true,  
    guildID : "9518473750166897567" , 
    commandsDir : "./commands", 
    eventsDir : "./events" , 
    token : "YOUR-TOKEN" , 
    prefix : ['!' , '$'] ,
    buttonsDir : "./buttons" 
})

Support For multiple prefixes has been introduced since Version 1.1

Last updated