Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/317.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 我的轮询命令不是';t在discord.js v12中工作_Javascript_Discord_Discord.js - Fatal编程技术网

Javascript 我的轮询命令不是';t在discord.js v12中工作

Javascript 我的轮询命令不是';t在discord.js v12中工作,javascript,discord,discord.js,Javascript,Discord,Discord.js,我的代码没有给我任何错误。但是,它不起作用: client.on('message',异步(msg)=>{ if(msg.content.startsWith('>poll')){ if(msg.member.hasPermission('ADMINISTRATOR')返回; const args=message.content .slice(前缀.length) .trim() .split(+/+/g); const embed=new Discord.MessageEmbed() .set

我的代码没有给我任何错误。但是,它不起作用:

client.on('message',异步(msg)=>{
if(msg.content.startsWith('>poll')){
if(msg.member.hasPermission('ADMINISTRATOR')返回;
const args=message.content
.slice(前缀.length)
.trim()
.split(+/+/g);
const embed=new Discord.MessageEmbed()
.setTitle('Poll!')
.setColor(“#0099ff”)
.setDescription(args[0]);
等待消息.channel.send(嵌入);

wait botMSG.react(“您尚未定义
botMSG
更改
wait msg.channel.send(嵌入)
让botMSG=wait msg.channel.send(嵌入)

没有任何错误,我们只能猜测问题。因此,我的猜测是,尝试执行命令的用户具有管理员权限。由于您的
if
语句,如果用户具有管理员权限,代码将停止。但是,我注意到另外两个问题。您有
const args=message.content…
但是您在哪里定义了
消息
?与
botMSG.react(…)
相同,您在哪里定义了
botMSG