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

GuildCommand

xlyr.on edited this page Jan 23, 2021 · 5 revisions

GuildCommand extends Command

constructor

new Slash.GuildCommand({data});
Parameter Type Description required
name string name of command true
description string description of command true
permissions array<string> required user permissions to execute command true
options array<object> options for command false
execute function function to be executed true

properties

.name - command name
type: string
.descriptions - command descriptions
type: string
.permssions - required user permissions
type: array<string>
.options - command options
type: array<object>

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 Interaction a slash interaction true
.id(client) - check command name
returns Promise <Command.id>
Parameter Type Description required
client Discord Client a discord client true
.post(client) - posts command
returns Promise <Command>
Parameter Type Description required
client Discord Client a discord client true
.delete(client) - deletes command
returns Promise <Command>
Parameter Type Description required
client Discord Client a discord client true

usage

commandTwo.js

const Slash = require('da-slash');
module.exports = new Slash.GuildCommand({
  name: 'bye',
  description: 'sends a bye message',
  guilds: ["GuildIdHere"]
  permissions: ["SEND_MESSAGES"],
  execute(interaction) {
    interaction.sendMessage("bye");
  }
})