Skip to content

Instantly share code, notes, and snippets.

@workframes
Last active December 4, 2022 18:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save workframes/785e9396105da6489fd212281d04f809 to your computer and use it in GitHub Desktop.
Save workframes/785e9396105da6489fd212281d04f809 to your computer and use it in GitHub Desktop.
const { SlashCommandBuilder } = require('discord.js');
const BaseSlashCommand = require('../../util/BaseSlashCommand');
module.exports = class Name extends BaseSlashCommand{
constructor(){
super("name", true) // name in lowercase, is restricted to managers
}
async run(client, interaction){ // Basic Discord.js client, Basic Discord.js interaction
// DO Stuff
}
getRaw(){
// Slash Commnad Building
// How to add more options and stuff, https://discordjs.guide/slash-commands/advanced-creation.html#adding-options
return new SlashCommandBuilder()
.setName(this.name)
.setDescription('Example Command')
.addStringOption((option) =>
option
.setName('example option')
.setDescription('this is a example option')
)
.toJSON();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment