ezslash
v0.0.3
Published
<h1 align="center">EzSlash</h1> <p align="center">The easiest and best way to create Discord Slash Commands</p>
Downloads
4
Readme
- Documentation (COMING SOON)
Installation
npm install ezslash --save
Example
Creator
const { Client } = require('discord.js')
const { Creator } = require('ezslash')
const path = require('path')
const client = new Client()
const creator = new Creator({
client: client,
token: 'TOKEN',
publicKey: 'PUBLIC_KEY',
applicationID: 'APPLICATION_ID'
})
creator.loadCommands(path.join(__dirname + '/commands/'))
client.login('TOKEN')
Command
const CommandType = require('ezslash')
module.exports = {
data: {
type: CommandType.GUILD_ONLY, // CommandType.GLOBAL for global commands
description: 'Test',
options: [],
guildID: '' // Only if you want guild-restricted commands
},
execute: async (client, interaction) => {
interaction.send(`Hello, ${interaction.user.username}`)
}
}