#setUserVoiceSettings() not working...

1 messages · Page 1 of 1 (latest)

analog grove

Hello! I am very new to the discord.js library. I have managed to get some example code to work and communicate via the RPC to set my activity status. I have now copied the ID of a member in my voice channel and use it as the id param of "setUserVoiceSettings()" aswell as passing in a settings param to the function to lower his volume. This does not work, has this functionality been deprecated?

Discord js version >>>

$ npm list discord.js
npm WARN config global `--global`, `--local` are deprecated. Use `--location=global` instead.
discord-rpc@4.0.1 C:\Users\elias\OneDrive\Dokument\ProgrammeringEgnaProjekt\RPC-master
└── (empty)

Node version>>>

  v16.16.0

Code block >>>

async function setVolumeOnUser() {
  if (!rpc || !mainWindow) {
    return;
  }
  const boops = await mainWindow.webContents.executeJavaScript('window.boops');
  // You'll need to have snek_large and snek_small assets uploaded to
  // https://discord.com/developers/applications/<application_id>/rich-presence/assets
  console.log(boops);
  const settings = {
    pan: null,
    mute: null,
    volume: boops,
  };
  rpc.setUserVoiceSettings('myfriendsidstring', settings).then(console.log('success')).catch(console.log('fail'));
}