3.0.0 • Published 2 years ago

ez-discordslash.js v3.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

ez-discordslash.js

  • Easy To Use

How To Use

  • Create A Dir (i created a Dir/Folder and Named It commands)
  • Now Copy This Code
const { Client, Intents } = require("discord.js")

const client = new Client({ intents: [Intents.FLAGS.GUILDS] })

const { SlashCommands } = require("discord-slash.js")

const commands = new SlashCommands({
  client: client,
  dir: "commands"
})
  • Now Go To Commands Dir and Create A Folder Which Will Be Our Command File
  • Example Command
    module.exports = {
      name: "ping",
      description: "ping Command",
      run: async(i, client) =>{
      
      i.reply({content: "Pong"})
      
      }
      }
  • Use .register Function To Register The Command
 commands.register()
  • Then Use .handle Function To Handle The Commands
commands.handle()
  • Or If You Want Addtional Parms to be added to Commands
commands.handle(parms1, parms2)
  • To Delete All Commands Use .deleteAll Function
commands.deleteAll()
  • To Delete A Particular Command Use .delete Function
commands.delete(name)
  • Add A Single Command use .registerSingleCommand Function
commands.registerSingleCommand({name: "some-name", description: "Some Description"})

Credits

  • Developed By Agent Hacker
  • Discord : Agent Hacker#0477