Unable to create slash commands

This is my code:
client.application.commands.create({
  name: 'test',
  description: 'devs',
})
  .then(console.log)
  .catch(console.error);


This is the error Im getting
Uncaught TypeError TypeError: Cannot read properties of null (reading 'commands')
Was this page helpful?