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

246
Views
DisTubeError [INVALID_TYPE]: 'número' esperado para 'volumen', pero obtuvo '50' discord.js V13

Estoy tratando de hacer un bot de música Discord. Todo el código funciona bien, pero en el comando Volumen, aparece este error cuando ejecuto !volume 50 :

 throw new __1.DisTubeError("INVALID_TYPE", "number", volume, "volume"); ^ DisTubeError [INVALID_TYPE]: Expected 'number' for 'volume', but got '50'

Este es mi código:

 const { guild, channel, member } = message; if ( member.roles.cache.has('926674590200123502') || member.roles.cache.has('945435842258808862') || member.roles.cache.has('928717168001024020') || member.roles.cache.has('935939126123974726') || member.permissions.has(Permissions.FLAGS.ADMINISTRATOR) ) { const voicechannel = member.voice.channel; if (!voicechannel) return message.reply( 'You must be in a voice channel to use Music commands', ); if (guild.me.voice.channelID && voicechannel.id !== guild.me.voice.channelID) return message.reply( `I am already playing music in <#${guild.me.voice.channelID}>`, ); const volume = args[0]; if (volume > 100 || volume < 1) return message.reply('the volume must be a number between 1 and 100'); await client.distube.setVolume(voicechannel, volume); await message.reply(`🔊 volume set to ${volume}`); } else return message.reply("You can't use this command");
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Es porque '50' no es un número sino una cadena. Intenta analizarlo primero:

 const volume = parseInt(args[0], 10); if (isNaN(volume)) return message.reply('Volume must be a valid number'); if (volume > 100 || volume < 1 ) return message.reply('Volume must be a number between 1 and 100');
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!