[Discord.js] Impossible de lire un fichier audio

Par MaximilienLIX, il y a 8 ans


Javascript NodeJS

Hello world!
J'ai un soucis avec mon bot sur discord.js.
J'aimerais reproduire ce que Grafikart a fait sur sa vidéo sur Discord.js sauf que j'obtiens une erreur particulière. Voici la classe :

const Command = require('./command') module.exports = class Play extends Command { static match (message) { return message.content.startsWith('!play') } static action (message) { let voiceChannel = message.guild.channels .filter(function (channel) { return channel.type === 'voice' }) .first() voiceChannel .join() .then(connection => { const dispatcher = connection.playFile('./stillAlive.mp3'); }) .catch(console.error); } }

J'ai l'erreur suivante :

(node:6957) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: send EPERM 83.142.224.102:53705 (node:6957) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

Je n'arrive pas à comprendre ce qui ne fonctionne pas dans mon utilisation du voiceChannel :/
Si quelqu'un peut éclairer ma lanterne, je suis preneur :D

Merci.

1 réponse

MaximilienLIX, il y a 8 ans

C'est bon problèmme résolu! En fait c'était mon parefeu qui bloquait les ports udp.