skick1234 / DisTube

A powerful Discord.js module for simplifying music commands and effortless playback of various sources with integrated audio filters.
https://distube.js.org
MIT License
422 stars 94 forks source link

Add Options for Deafing #37

Closed Tomato6966 closed 3 years ago

Tomato6966 commented 3 years ago

Add option for : <voiceState>.setDeaf(<true/false>)

as well as for : <voiceState>.setSelfDeaf(<true/false>)

Thanks ;)

skick1234 commented 3 years ago

You can do it with <Queue>.connection and playSong, playList event.

Tomato6966 commented 3 years ago

if I do:

distube.on("playSong", async (message, queue, song) => {
    queue.connection.setDeaf(true);
         functions.playsongyes(client, message, queue, song);
 })

I get: queue.connection.setDeaf is not a function

skick1234 commented 3 years ago

Because it is VoiceConnection https://discord.js.org/#/docs/main/stable/class/VoiceConnection

Tomato6966 commented 3 years ago

doesnt work neither -_-

Tomato6966 commented 3 years ago

nvm i will do before distube starts

const connection = await voiceChannel.join();
connection.voice.setDeaf(true);
connection.voice.setSelfDeaf(true)
skick1234 commented 3 years ago

It's queue.connection.voice.setSelfDeaf(true) in playSong event 😕

Tomato6966 commented 3 years ago

oh connection is a connection parameter oh then ok

skick1234 commented 3 years ago

I see, your issue should be <VoiceState>.setSelfDeaf(), not <VoiceConnection>

skick1234 commented 3 years ago

You should read the docs carefully, It has type expressions. Or use TypeScript.

Tomato6966 commented 3 years ago

i dont read docs 💯