尝试使用connection.play时会弹出错误消息

时间:2020-05-03 05:03:41

标签: javascript discord.js

当我尝试使用connection.play函数播放本地文件时,弹出错误提示

TypeError:无法将“ null”转换为int

var Module = typeof Module!==“ undefined”?Module:{}; var moduleOverrides = {}; var key; for(模块中的键){if(Module.hasOwnProperty(key)){moduleOverrides [key] = Module [key]}} Module [“ arguments”] = []; Module [“ thisProgram”] =“ ./ this.program”; Module [“ quit”] = function(status,toThrow){throw toThrow}; Module [“ preRun”] = []; Module [“ postRun”] = []; var ENVIRONMENT_IS_WEB = false; var ENVIRONMENT_IS_WORKER = false; var ENVIRONMENT_IS_NODE = false; var ENVIRONMENT_HAS_NODE = false; var ENVIRONMENT_IS_SHELL = false; ENVIRONMENTIS_of ==“ object”; ENVguments“] = [];模块[” tg“; ENVIRONMENT_IS_NODE = ENVIRONMENT_HAS_NODE &&!ENVIRONMENT_IS_WEB &&!ENVIRONMENT_IS_WORKER; ENVIRONMENT_IS_SHELL =!ENVIRONMENT_IS_WEB &&!ENVIRONMENT;路径){if(Module [“ locateFile”]){函数“; ENVIRONMENT_H abort(TypeError:无法将“ null”转换为int)。使用-s ASSERTIONS = 1进行构建以获取更多信息。

为什么会弹出此错误?

这是我的代码

message.member.voice.channel.join().then(connection=>{
  const dispatcher = connection.play('./'+args[1]+'.mp3', { volume: 0.5 });     
  dispatcher.on("end", end => {message.member.voice.channel.leave()});             
}).catch(err=>console.log(err));

0 个答案:

没有答案