Magikaas
Magikaas
DIAdiscord.js - Imagine an app
Created by Magikaas on 8/26/2024 in #djs-questions
PermissionOverwrites question.
I want to deny viewing access for a specific channel (that already has specific viewing permissions (for set to it) to everyone, but also be able to easily revert them. What should I pay attention to to avoid possibly overwriting permissions for that channel? I know I need the PermissionOverwrites to do this to set a deny on everyone, but if I then set an allow later, does that overwrite the existing permissions?
18 replies
DIAdiscord.js - Imagine an app
Created by Magikaas on 8/24/2023 in #djs-voice
Playing a soundfile
I'm trying to use discord.js voice to play a sound file. Is my thinking in how to get this to work in the right direction here or am I missing important parts here?
...

const resource = createAudioResource(soundfilePath);
this.getAudioPlayer().play(resource);
return;
}

...

getAudioPlayer() {
if (!this._audioPlayer) {
this._audioPlayer = this.createAudioPlayer();
}
return this._audioPlayer;
}

createAudioPlayer() {
return createAudioPlayer({
behaviors: {
noSubscriber: NoSubscriberBehavior.Pause,
},
});
}
...

const resource = createAudioResource(soundfilePath);
this.getAudioPlayer().play(resource);
return;
}

...

getAudioPlayer() {
if (!this._audioPlayer) {
this._audioPlayer = this.createAudioPlayer();
}
return this._audioPlayer;
}

createAudioPlayer() {
return createAudioPlayer({
behaviors: {
noSubscriber: NoSubscriberBehavior.Pause,
},
});
}
5 replies