admin管理员组

文章数量:1023815

I have a Looping mand on my Discord Bot where you can repeat songs in a voice channel. Although when I run the mand, it shows a message that its going to loop the current song:

But then when the song ends (it should repeat itself again) the bot disconnects from voice channel. It uses YTDL-Core. Any Idea on how to solve this? Repeat.JS

let { RichEmbed } = require('discord.js')
const config = require('../../config.json')

exports.run = async(client, msg, args) => {
  const serverQueue = client.queue.get(msg.guild.id);
  if (!msg.member.voiceChannel) return msg.channel.send('You are not in a voice channel!');
  if(!serverQueue) return msg.channel.send('Not playing anything right now');
  if(serverQueue.voiceChannel.id !== msg.member.voiceChannel.id) return msg.channel.send(`You must be in **${serverQueue.voiceChannel.name}** to loop the queue`);
  serverQueue.loop = !serverQueue.loop;
  client.queue.set(msg.guild.id, serverQueue);
  if(serverQueue.loop) return msg.channel.send('**

I have a Looping mand on my Discord Bot where you can repeat songs in a voice channel. Although when I run the mand, it shows a message that its going to loop the current song:

But then when the song ends (it should repeat itself again) the bot disconnects from voice channel. It uses YTDL-Core. Any Idea on how to solve this? Repeat.JS

let { RichEmbed } = require('discord.js')
const config = require('../../config.json')

exports.run = async(client, msg, args) => {
  const serverQueue = client.queue.get(msg.guild.id);
  if (!msg.member.voiceChannel) return msg.channel.send('You are not in a voice channel!');
  if(!serverQueue) return msg.channel.send('Not playing anything right now');
  if(serverQueue.voiceChannel.id !== msg.member.voiceChannel.id) return msg.channel.send(`You must be in **${serverQueue.voiceChannel.name}** to loop the queue`);
  serverQueue.loop = !serverQueue.loop;
  client.queue.set(msg.guild.id, serverQueue);
  if(serverQueue.loop) return msg.channel.send('**

本文标签: javascriptHow do you fix the loop command in DiscordJSStack Overflow