Skip to content
This repository has been archived by the owner on Jan 12, 2022. It is now read-only.

.join command #151

Open
Toyuuu opened this issue Sep 25, 2021 · 3 comments
Open

.join command #151

Toyuuu opened this issue Sep 25, 2021 · 3 comments

Comments

@Toyuuu
Copy link

Toyuuu commented Sep 25, 2021

Can you help me? I've got this so far:

const util = require("../util");

var arr = []
module.exports = {
name: "join",
aliases: ["j"],
exec: async (msg) => {
const { music } = msg.guild;
if (!msg.member.voice.channel)
return msg.channel.send(:x: You need to be in a voice channel to run this command!);
if (msg.guild.me.voice.channel && !msg.guild.me.voice.channel.equals(msg.member.voice.channel))
return msg.channel.send(:thumbsup: **I've left** ${msg.guild.me.voice.channel} **and joining** ${msg.member.voice.channel}!);
await music.leave(msg.guild);
await music.join(msg.member.voice.channel);
const missingPerms = util.missingPerms(msg.guild.me.permissionsIn(msg.member.voice.channel), ["CONNECT", "SPEAK"]);
if ((!music.player || !music.player.playing) && missingPerms.length)
return msg.channel.send(Hmm :thinking: I am unable to join you're voice chat! I am missing the permission: ${missingPerms.map(x => `${x}`).join(", ")}. Do I have access to this voice chat?);
else {
await music.join(msg.member.voice.channel);
}

}

}

How do I make it leave voice channel? I got it to join just not leave to move channel.

@Allvaa
Copy link
Owner

Allvaa commented Sep 26, 2021

this.client.manager.leave(this.guild.id);

@yofukashino
Copy link
Contributor

Instead of leaving the vc and then joining other vc, move the bot its more efficient.

@yofukashino
Copy link
Contributor

Can you help me? I've got this so far:

const util = require("../util");

var arr = [] module.exports = { name: "join", aliases: ["j"], exec: async (msg) => { const { music } = msg.guild; if (!msg.member.voice.channel) return msg.channel.send(:x: You need to be in a voice channel to run this command!); if (msg.guild.me.voice.channel && !msg.guild.me.voice.channel.equals(msg.member.voice.channel)) return msg.channel.send(:thumbsup: **I've left** ${msg.guild.me.voice.channel} **and joining** ${msg.member.voice.channel}!); await music.leave(msg.guild); await music.join(msg.member.voice.channel); const missingPerms = util.missingPerms(msg.guild.me.permissionsIn(msg.member.voice.channel), ["CONNECT", "SPEAK"]); if ((!music.player || !music.player.playing) && missingPerms.length) return msg.channel.send(Hmm :thinking: I am unable to join you're voice chat! I am missing the permission: ${missingPerms.map(x => ``${x}``).join(", ")}. Do I have access to this voice chat?); else { await music.join(msg.member.voice.channel); }

}

}

How do I make it leave voice channel? I got it to join just not leave to move channel.

ctx.guild.members.cache.get(ctx.client.user.id).voice.setChannel(ctx.member.voice.channel) use this to move channel instead bruh

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants