Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

153
Visualizações
TypeError: no se pueden leer las propiedades de undefined (leyendo 'fuente')

Así que traté de hacer una función tts para mi bot discord.js usando este código:

 const { SlashCommandBuilder } = require("@discordjs/builders") const { getAudioUrl } = require('google-tts-api'); module.exports = { data: new SlashCommandBuilder().setName("talk").setDescription("Nói tin nhắn trong voice channel").addStringOption((option) => option.setName("text").setDescription("Your text").setRequired(true)), _run: async ({ client, interaction }) => { if (!interaction.member.voice.channel) return interaction.editReply("Mày phải vào một ``voice channel`` để sử dụng lệnh này."); const queue = client.player.getQueue(interaction.guildId); if (queue) return await interaction.editReply("Nhạc đang được bật. Vui lòng thử lại khi nhạc được tắt."); const text = interaction.options.getString("text"); if (text > 200) return await interaction.editReply("Tin nhắn không được quá 200 chữ."); const voiceChannel = await client.player.createQueue(interaction.guild); const audioURL = await getAudioUrl(text, { lang: 'vi', slow: false, host: 'https://translate.google.com', timeout: 10000, }); try { voiceChannel.connect(interaction.member.voice.channel).then(connection => { const dispatcher = connection.play(audioURL); dispatcher.on('finish', () => { voiceChannel.disconnect(); message.reply('đã xong.'); }); }); } catch (e) { await interaction.editReply('T lại bị lỗi rồi, đm <@877004766956363828> cứu t ;-;'); console.error(e); }; }, get run() { return this._run; }, set run(value) { this._run = value; }, }

pero luego apareció este error:

 C:\Users\Administrator\Dropbox\PC\Desktop\im innocent\discord-music-bot\node_modules\discord-player\dist\Structures\Queue.js:646 if (["youtube", "spotify"].includes(track.raw.source)) { ^ TypeError: Cannot read properties of undefined (reading 'source')

¿Qué debería hacer ahora? Y si quieren ver algo más, háganmelo saber. Como tengo otros archivos, pero me pregunto si debería mostrarlos todos o no, o si me gusta solo el archivo principal o algo así. Soy un principiante de node.js.

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda