Shandler
  • Shandler
  • Information
    • Basic Usage
    • SHClient and Interaction
    • Deleting Commands
  • Interactions
    • Methods
  • Buttons
    • Getting Started with Buttons
    • Dropdowns
    • buttonClick Event
    • Buttons Documentation
Powered by GitBook
On this page
  • Deletion without Shandler
  • Deletion with Shandler

Was this helpful?

  1. Information

Deleting Commands

Registration and Deletion

For registering and deleting commands, you can use the following methods (Guild specific commands won't be automatically deleted even if autoDelete is true)

Deletion without Shandler

Normally to delete a command you would have to use

<client>.api.applications(client.user.id).commands('COMMAND-ID').delete(); //globad command
<client>.api.applications(client.user.id).guilds('GUILD-ID').commands('COMMAND-ID').delete(); //guild specific commmand

Deletion with Shandler

With Shandler, you can use the much easier .delete() method.

const commands = [
    {
        name:'ping',//this is optional when there is an id
        id:'965874566987541265'/* this is optional when there is a name,
        as we will fetch all the commands and then find the command
        according to the given values */
    },
    {
        name:'user',
        id:'877645876978676234'
    }
]
const guild = []
client.on('ready', () => {
    handler.delete(commands,guild)
})
PreviousSHClient and InteractionNextMethods

Last updated 3 years ago

Was this helpful?