Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

95
Views
DIscord bot deletes 50 messages instead of 1

That's my code

const { SlashCommandBuilder } = require('@discordjs/builders');
const { Permissions } = require('discord.js');

module.exports = {
     data: new SlashCommandBuilder()
         .setName('clear')
         .setDescription('Deletes shit')
         .addNumberOption(option => option.setName('amount')
             .setDescription('amount to clear')
             .setRequired(true)),
     permissions: [Permissions.FLAGS.MANAGE_MESSAGES],
     async execute(interaction) {
        const amount = interaction.options.getNumber('amount');
        interaction.channel.bulkDelete(amount, true);
        await interaction.reply(`Удалено ${amount} сообщение(сообщений)`);
     },
}

When I try to delete something my bot writes that he deleted null messages and deletes 50 messages. And if I enter 2, he deletes 100 messages. Please, help!

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

I've found solution. I needed to just restart deploy-commands.js file. System just didn't notice my IntegerOption. I restarted deploy-commands.js and all is working now.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!