Skip to content
This repository has been archived by the owner on Feb 9, 2021. It is now read-only.

Command

xlyr.on edited this page Jan 17, 2021 · 18 revisions

Slash Command

constructor

new Slash.Command({data});
Parameter Type Description required
name string name of command true
description string description of command true
permissions array strings required user permissions to execute command true
options array objects options for command false
execute function function to be executed true
guildOnly boolean coming soon! true

properties

.name - command name
type: string
.descriptions - command descriptions
type: string
.permssions - required user permissions
type: array strings
.options - command options
type: array objects

methods

.expressionCheck(name) - check command name
returns Promise <...command, pass>
Parameter Type Description required
name string name of command true
.permissionCheck(user) - check user permissions
returns Promise <...command, pass>
Parameter Type Description required
user GuildMember a guild member true
.securityCheck(interaction) - combination of expressionCheck and permissionCheck
returns Promise <...command, pass>
Parameter Type Description required
interaction Slash Interaction a slash interaction true

usage

commandOne.js
module.exports = new Slash.Command({
  name: 'hello',
  description: 'sends a hello world message',
  permissions: ["SEND_MESSAGES"],
  execute(interaction) {
  
    interaction.sendMessage("Hello World")
    
  }
})
Clone this wiki locally