I am not sure if I miss something in the documentation or it is still not in the Discord API, but what I need to find a way to record Discord soundboard sounds with the discord.js library.
Like it is done for the voice:
const connection = getVoiceConnection(<guild ID>);
const receiver = connection.receiver;
receiver.speaking.on('start', (userId) => {
log.debug(`User ${userId} started speaking`);
createListeningStream(receiver, channel, userId, conversationThreadId);
});
Is it possible at all?
Soundboard sounds are handled differently than voice, so you won't receive them through a voice receiver like that.
Discord.js does not support receiving soundboard sounds because it isn't well documented by Discord yet. There's an open Pull Request on the discord-api-docs repo where they're making progress documenting it. When that's merged, Discord.js will probably start making progress towards adding it.