-
Notifications
You must be signed in to change notification settings - Fork 0
Joining and Leaving

Joining and leaving voice channels in Discord+PS is extremely simple compared to Discord.JS
For example, here's how to join a voice channel using Discord+PS:
PSClient.voice.join(channel);
And here's how to join a voice channel in the current version of Discord.JS as of writing this:
voice.joinVoiceChannel({
channelId: channel.id,
guildId: channel.guild.id,
adapterCreator: channel.guild.voiceAdapterCreator
});
Joining is very similar to how Discord.JS was before
// discord.js
channel.join();
Though modified to work for the new version and with the PSClient
Join is called with PSClient.voice.join(channel) as you can see here in this example where it finds where a user is then joins their voice channel:
PSClient.voice.find(user, (channel) => {
PSClient.voice.join(channel);
console.log(`Joined ${channel.name}`;
});
Leaving is pretty simple to use only requiring a channel
PSClient.voice.leave(channel);
// or
PSClient.voice.disconnect(channel);
Here's the code for leaving if you want it:
leave(channel) {
const connection = voice.getVoiceConnection(channel.guild.id);
try {
connection.destroy();
} catch(err) {
throw new CoolError("Leaving Voice Channel", "Not in channel or cannot leave.");
}
}
For a look at some examples check out the examples folder
If anything with the mod is updated you can look to the releases for info on it
For a look into the development check out the index.js file
This mod is not associated with the creators of Discord, Discord.JS, or Discord.PY this was created out of love for Discord bot development because I wanted to make things easier for people. I do not condone harassment of the original developers and or anyone else involved in the creation of them.
I am not responsible for anything made with this mod and be sure to follow Discord's terms of service and their community guildlines while developing.
Basics
wc.command()
wc.slashCommand()
wc.commandList
wc.slashCommandList
Basics
wc.event()
wc.eventList
wc.commandAction()
wc.buttonAction()
wc.selectionAction()
wc.rowAction()
wc.fetchMessage()
wc.fetchReply()
wc.fetchUser()
wc.fetchGuildUser()
wc.fetchChannel()
wc.fetchGuildChannel()
wc.fetchRole()
wc.fetchGuildRole()
wc.fetchGuild()
wc.parseEmoji()
wc.parseSticker()